/* ============================================================
   MAIN.CSS — Design System Completo
   FlowSpace — Sistema Notion Moderno
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   CSS TOKENS / VARIÁVEIS
   ============================================================ */
:root {
  /* Cores base */
  --bg-base:        #07070F;
  --bg-surface:     #0D0D1A;
  --bg-elevated:    #13132A;
  --bg-hover:       rgba(255,255,255,0.04);
  --bg-active:      rgba(124,58,237,0.15);

  /* Glass morphism */
  --glass-bg:       rgba(255,255,255,0.04);
  --glass-border:   rgba(255,255,255,0.08);
  --glass-hover:    rgba(255,255,255,0.07);
  --glass-blur:     24px;

  /* Texto */
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #475569;
  --text-disabled:  #2D3748;

  /* Brand / Primária */
  --brand-500:      #7C3AED;
  --brand-600:      #6D28D9;
  --brand-400:      #8B5CF6;
  --brand-300:      #A78BFA;
  --brand-glow:     rgba(124,58,237,0.3);

  /* Indigo */
  --indigo-500:     #6366F1;
  --indigo-glow:    rgba(99,102,241,0.3);

  /* Semânticas */
  --success:        #10B981;
  --success-bg:     rgba(16,185,129,0.1);
  --warning:        #F59E0B;
  --warning-bg:     rgba(245,158,11,0.1);
  --danger:         #EF4444;
  --danger-bg:      rgba(239,68,68,0.1);
  --info:           #3B82F6;
  --info-bg:        rgba(59,130,246,0.1);

  /* Prioridades */
  --priority-low:    #6B7280;
  --priority-medium: #3B82F6;
  --priority-high:   #F59E0B;
  --priority-urgent: #EF4444;

  /* Status Kanban */
  --status-todo:    #6366F1;
  --status-doing:   #F59E0B;
  --status-waiting: #8B5CF6;
  --status-done:    #10B981;

  /* Espaçamentos */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.7);
  --shadow-brand: 0 4px 24px rgba(124,58,237,0.25);

  /* Transições */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;

  /* Z-index */
  --z-sidebar:  100;
  --z-header:   200;
  --z-dropdown: 300;
  --z-modal:    400;
  --z-toast:    500;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background animado */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(124,58,237,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(99,102,241,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(139,92,246,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */
h1 { font-size: 2rem;   font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem;  font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.35; }
h4 { font-size: 1rem;    font-weight: 600; line-height: 1.4; }
h5 { font-size: 0.875rem;font-weight: 500; }
h6 { font-size: 0.75rem; font-weight: 500; }

p { color: var(--text-secondary); font-size: 0.9375rem; }
a { color: var(--brand-400); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-300); }

/* ============================================================
   LAYOUT — SIDEBAR + MAIN
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: rgba(13,13,26,0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-sidebar);
  transition: width var(--transition-normal), transform var(--transition-normal);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--glass-border);
  min-height: 72px;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand-500), var(--indigo-500));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-brand);
}

.sidebar-logo-text {
  flex: 1;
  overflow: hidden;
}

.sidebar-logo-text h2 {
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--brand-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: normal;
  line-height: 1.2;
}

.sidebar-logo-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: var(--space-6);
}

.nav-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 var(--space-2) var(--space-2);
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  margin-bottom: 2px;
}

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

.nav-item.active {
  background: var(--bg-active);
  color: var(--brand-300);
  border: 1px solid rgba(124,58,237,0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, var(--brand-500), var(--indigo-500));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--glass-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover { background: var(--glass-hover); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--indigo-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-normal);
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(7,7,15,0.6);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  gap: var(--space-4);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.page-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* PAGE BODY */
.page-body {
  flex: 1;
  padding: var(--space-8);
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--indigo-500));
  color: white;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(124,58,237,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.2);
}

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.2);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: var(--space-3) var(--space-8);
  font-size: 1rem;
  font-weight: 600;
}

.btn-icon {
  padding: var(--space-2);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
}

.btn-icon-sm {
  padding: 4px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   CARDS / GLASS PANELS
   ============================================================ */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: var(--shadow-md);
}

.card-body {
  padding: var(--space-6);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  letter-spacing: 0.01em;
}

.form-label span.required { color: var(--danger); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  padding: var(--space-3) var(--space-4);
  transition: all var(--transition-fast);
  outline: none;
  appearance: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand-500);
  background: rgba(124,58,237,0.05);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: var(--space-1); }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: var(--space-1); }

/* Grid de formulário */
.form-grid { display: grid; gap: var(--space-5); }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ============================================================
   BADGES / TAGS / CHIPS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-priority-low    { background: rgba(107,114,128,0.15); color: #9CA3AF; border: 1px solid rgba(107,114,128,0.2); }
.badge-priority-medium { background: rgba(59,130,246,0.15);  color: #60A5FA; border: 1px solid rgba(59,130,246,0.2); }
.badge-priority-high   { background: rgba(245,158,11,0.15);  color: #FCD34D; border: 1px solid rgba(245,158,11,0.2); }
.badge-priority-urgent { background: rgba(239,68,68,0.15);   color: #F87171; border: 1px solid rgba(239,68,68,0.2); }

.badge-status-todo    { background: rgba(99,102,241,0.15);  color: #A5B4FC; }
.badge-status-doing   { background: rgba(245,158,11,0.15);  color: #FCD34D; }
.badge-status-waiting { background: rgba(139,92,246,0.15);  color: #C4B5FD; }
.badge-status-done    { background: rgba(16,185,129,0.15);  color: #6EE7B7; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  color: var(--brand-300);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag:hover { background: rgba(124,58,237,0.2); }

.tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.tag-remove:hover { opacity: 1; }

/* Tags container */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  min-height: 44px;
  cursor: text;
  transition: all var(--transition-fast);
}

.tags-input-container:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.tags-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  flex: 1;
  min-width: 100px;
}

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

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(8px);
  transition: transform var(--transition-normal);
  position: relative;
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-sm  { max-width: 480px; }
.modal-md  { max-width: 640px; }
.modal-lg  { max-width: 860px; }
.modal-xl  { max-width: 1100px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title { font-size: 1.125rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  background: transparent; border: none; font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--glass-hover); color: var(--text-primary); }
.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ============================================================
   UPLOAD DE IMAGENS
   ============================================================ */
.upload-area {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--brand-500);
  background: var(--bg-active);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon { font-size: 2.5rem; margin-bottom: var(--space-3); }
.upload-label { font-size: 0.9375rem; font-weight: 500; color: var(--text-secondary); }
.upload-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: var(--space-1); }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.image-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.image-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.image-thumb-remove {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.image-thumb:hover .image-thumb-remove { opacity: 1; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease forwards;
  backdrop-filter: blur(20px);
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-message { flex: 1; }

.toast-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6EE7B7; }
.toast-error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3);  color: #FCA5A5; }
.toast-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #FCD34D; }
.toast-info    { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); color: #A5B4FC; }

.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ============================================================
   LOADING / SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--glass-bg) 0%, rgba(255,255,255,0.08) 50%, var(--glass-bg) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Full page loading */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  flex-direction: column;
  gap: var(--space-4);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  gap: var(--space-4);
}

.empty-state-icon { font-size: 3.5rem; opacity: 0.4; }
.empty-state-title { font-size: 1.125rem; font-weight: 600; color: var(--text-secondary); }
.empty-state-text { font-size: 0.875rem; color: var(--text-muted); max-width: 300px; }

/* ============================================================
   KANBAN
   ============================================================ */
.kanban-board {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-8);
  overflow-x: auto;
  min-height: calc(100vh - 140px);
  align-items: flex-start;
}

.kanban-column {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.column-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.column-title {
  font-size: 0.875rem;
  font-weight: 600;
  flex: 1;
}

.column-count {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.column-add-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px;
  transition: all var(--transition-fast);
}

.column-add-btn:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 200px;
  padding: 4px 0;
}

.kanban-cards.drag-over {
  background: rgba(124,58,237,0.05);
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(124,58,237,0.3);
}

/* KANBAN CARD */
.task-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: grab;
  position: relative;
  transition: all var(--transition-fast);
  overflow: hidden;
  user-select: none;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  transition: opacity var(--transition-fast);
}

.task-card[data-priority="low"]::before    { background: var(--priority-low); }
.task-card[data-priority="medium"]::before { background: var(--priority-medium); }
.task-card[data-priority="high"]::before   { background: var(--priority-high); }
.task-card[data-priority="urgent"]::before { background: var(--priority-urgent); }

.task-card:hover {
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.task-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.task-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.task-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.task-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-3);
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.task-due-date {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
}

.task-due-date.overdue { color: var(--danger); }
.task-due-date.soon { color: var(--warning); }

.task-stale-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245,158,11,0.2);
}

.task-card-image {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

/* ============================================================
   CALENDÁRIO
   ============================================================ */
.calendar-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.calendar-month-label {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 220px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-weekday {
  background: var(--bg-surface);
  padding: var(--space-2) var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day {
  background: var(--glass-bg);
  min-height: 100px;
  padding: var(--space-2) var(--space-3);
  position: relative;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calendar-day:hover { background: var(--glass-hover); }

.calendar-day.other-month { opacity: 0.35; }

.calendar-day.today .day-number {
  background: linear-gradient(135deg, var(--brand-500), var(--indigo-500));
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-number {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-tasks { display: flex; flex-direction: column; gap: 2px; }

.day-task-pill {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.day-task-pill:hover { opacity: 0.8; }
.day-task-pill.status-todo    { background: rgba(99,102,241,0.2); color: #A5B4FC; }
.day-task-pill.status-doing   { background: rgba(245,158,11,0.2); color: #FCD34D; }
.day-task-pill.status-waiting { background: rgba(139,92,246,0.2); color: #C4B5FD; }
.day-task-pill.status-done    { background: rgba(16,185,129,0.2); color: #6EE7B7; }

.day-tasks-overflow {
  font-size: 0.6875rem;
  color: var(--text-muted);
  padding: 1px 4px;
}

/* ============================================================
   COTAÇÕES — CALCULADORA
   ============================================================ */
.quotation-calculator {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--space-8);
  align-items: flex-start;
}

.calc-result-box {
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: sticky;
  top: 90px;
}

.calc-result-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: 0.875rem;
}

.calc-row + .calc-row { border-top: 1px solid var(--glass-border); }
.calc-row-label { color: var(--text-secondary); }
.calc-row-value { font-weight: 600; font-variant-numeric: tabular-nums; }

.calc-total {
  background: linear-gradient(135deg, var(--brand-500), var(--indigo-500));
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calc-total-label { font-size: 0.875rem; font-weight: 600; opacity: 0.9; }
.calc-total-value { font-size: 1.375rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.platform-prices { margin-top: var(--space-5); }
.platform-prices-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.platform-price-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.platform-price-row:hover { background: rgba(255,255,255,0.03); }
.platform-icon { width: 24px; height: 24px; border-radius: var(--radius-sm); object-fit: contain; }
.platform-name { font-size: 0.8125rem; font-weight: 500; flex: 1; }
.platform-fee  { font-size: 0.75rem; color: var(--text-muted); }
.platform-price-value { font-size: 0.9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Quotations table */
.quotations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
}

.quotation-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.quotation-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.quotation-card-photo {
  width: 100%; height: 140px;
  object-fit: cover;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}

.quotation-card-body { padding: var(--space-4); }
.quotation-card-name { font-size: 0.9375rem; font-weight: 600; margin-bottom: var(--space-1); }
.quotation-card-supplier { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: var(--space-4); }
.quotation-card-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.quotation-price-item {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.price-platform { font-size: 0.6875rem; color: var(--text-muted); margin-bottom: 2px; }
.price-value { font-size: 0.9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Margin indicator */
.margin-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.margin-good   { background: var(--success-bg); color: var(--success); }
.margin-medium { background: var(--warning-bg); color: var(--warning); }
.margin-low    { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   NOTIFICAÇÕES / DROPDOWN
   ============================================================ */
.notifications-btn {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  display: none;
}

.notifications-panel.open { display: block; animation: dropIn 0.2s ease; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notifications-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.notification-item:hover { background: var(--glass-hover); }
.notification-item:last-child { border-bottom: none; }

.notification-icon { font-size: 1.25rem; flex-shrink: 0; padding-top: 2px; }
.notification-content { flex: 1; }
.notification-title { font-size: 0.8125rem; font-weight: 600; margin-bottom: 2px; }
.notification-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.relative { position: relative; }
.hidden { display: none !important; }

.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.8125rem; }
.text-base { font-size: 0.9375rem; }
.text-lg   { font-size: 1.125rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.rounded-full { border-radius: var(--radius-full); }
.rounded-lg { border-radius: var(--radius-lg); }

.divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--space-5) 0;
}

/* Scrollbar customizada */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1024px) {
  .quotation-calculator { grid-template-columns: 1fr; }
  .calc-result-box { position: static; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: var(--z-sidebar);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .page-header { padding: var(--space-4) var(--space-5); }
  .page-body { padding: var(--space-4) var(--space-5); }
  .kanban-board { padding: var(--space-4) var(--space-5); }
  .kanban-column { flex: 0 0 260px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .modal { border-radius: var(--radius-md); }
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: calc(var(--z-sidebar) - 1);
  backdrop-filter: blur(4px);
}

.sidebar-overlay.visible { display: block; }

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-xl), 0 0 80px rgba(124,58,237,0.1);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.auth-title { font-size: 1.625rem; font-weight: 800; margin-bottom: var(--space-1); }
.auth-subtitle { font-size: 0.875rem; color: var(--text-muted); }

.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-8);
}

.auth-tab {
  flex: 1;
  padding: var(--space-2);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--radius-md) - 2px);
  transition: all var(--transition-fast);
  color: var(--text-muted);
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
}

.auth-tab.active {
  background: var(--brand-600);
  color: white;
  box-shadow: var(--shadow-brand);
}

.auth-btn-submit {
  width: 100%;
  padding: var(--space-3);
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--space-6);
}

/* Decoration dots */
.auth-deco {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.auth-deco-1 {
  width: 400px; height: 400px;
  background: rgba(124,58,237,0.12);
  top: -100px; left: -100px;
}

.auth-deco-2 {
  width: 300px; height: 300px;
  background: rgba(99,102,241,0.1);
  bottom: -80px; right: -80px;
}

/* ============================================================
   SPLIT LAYOUT (Landing Page)
   ============================================================ */
.split-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  max-width: 1200px;
  margin: 0 auto;
  gap: var(--space-10);
  align-items: center;
  padding: var(--space-8);
}

.auth-pitch {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.pitch-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--brand-300);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-pitch h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--brand-400), var(--indigo-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pitch-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 90%;
}

.pitch-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-2);
}

.feature {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.feature h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.feature p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pitch-pricing {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.price-val {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
}

.pitch-pricing .period {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
}

.pitch-pricing .period span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-wrapper {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 992px) {
  .split-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-8);
  }
  .pitch-badge {
    align-self: center;
  }
  .pitch-desc {
    max-width: 100%;
  }
  .feature {
    text-align: left;
  }
  .pitch-pricing {
    justify-content: center;
  }
  .auth-wrapper {
    justify-content: center;
  }
}
