/* ============================================================
   PLANEJA — Design System & Estilos Globais
   Paleta: Light Mode | Lavanda + Céu | Inter (Google Fonts)
   ============================================================ */

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

/* ── Custom Properties ───────────────────────────────────── */
:root {
  /* Superfícies */
  --bg:          #F2F4FB;
  --surface:     #FFFFFF;
  --surface-2:   #EEF0FA;
  --surface-3:   #E3E6F5;
  --border:      rgba(108, 99, 212, 0.13);
  --border-hover:rgba(108, 99, 212, 0.32);

  /* Cores primárias */
  --primary:     #6C63D4;
  --primary-h:   #7E77DC;
  --primary-glow:rgba(108, 99, 212, 0.18);
  --secondary:   #38B6D8;
  --secondary-h: #55CAEA;
  --accent:      #F7A440;

  /* Status / Semântica */
  --success:  #27B899;
  --warning:  #F7A440;
  --danger:   #E85B5B;
  --info:     #4F8FE6;

  /* Texto */
  --text:       #1C1C3A;
  --text-muted: #565C80;
  --text-dim:   #9499BC;

  /* Gradientes */
  --grad-primary: linear-gradient(135deg, #6C63D4 0%, #38B6D8 100%);
  --grad-card:    linear-gradient(135deg, rgba(108,99,212,.05) 0%, rgba(56,182,216,.03) 100%);
  --grad-sidebar: linear-gradient(180deg, #FFFFFF 0%, #F5F6FD 100%);

  /* Layout */
  --sidebar-w:  260px;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  18px;

  /* Transições */
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Sombras */
  --shadow:     0 4px 24px rgba(80, 70, 180, 0.10);
  --shadow-sm:  0 2px 10px rgba(80, 70, 180, 0.07);
  --shadow-glow:0 0 24px rgba(108, 99, 212, 0.14);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--secondary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary-h); }

img { max-width: 100%; display: block; }

::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Layout Principal ────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--grad-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  padding: 0 0 1rem;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  background: var(--grad-primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.sidebar-logo .logo-sub {
  font-size: .65rem;
  color: var(--text-dim);
  margin-top: -2px;
}

.sidebar-section {
  padding: 1rem .75rem .25rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.sidebar-nav { padding: 0 .75rem; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
  font-weight: 500;
  font-size: .875rem;
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: inherit;
}

.nav-item:hover {
  color: var(--primary);
  background: rgba(108,99,212,.08);
}

.nav-item.active {
  color: var(--primary);
  background: rgba(108,99,212,.12);
  border: 1px solid var(--border-hover);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.nav-item .nav-icon { font-size: 1.1rem; flex-shrink: 0; width: 1.4rem; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem .75rem 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.user-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.user-card:hover { background: rgba(108,99,212,.06); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: .68rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Conteúdo Principal ──────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.top-bar-title { font-size: 1.1rem; font-weight: 700; color: var(--text); flex: 1; }
.top-bar-sub   { font-size: .8rem; color: var(--text-muted); }

.page-container {
  padding: 1.75rem;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.card-glass {
  background: var(--grad-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: .75rem;
}

.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Stats / Métricas ────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  margin-bottom: .85rem;
}

.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: .25rem; }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.stat-delta { font-size: .72rem; margin-top: .4rem; }
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ── Projeto Card ────────────────────────────────────────── */
.projetos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}

.projeto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.projeto-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--project-color, var(--primary));
  opacity: .7;
}

.projeto-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 16px var(--project-color, var(--primary-glow));
}

.projeto-card:hover::before { opacity: 1; }

.projeto-header { display: flex; align-items: flex-start; gap: .75rem; }

.projeto-icone {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: var(--surface-2);
  flex-shrink: 0;
}

.projeto-nome { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.35; }
.projeto-cat  { font-size: .72rem; color: var(--text-dim); margin-top: 3px; }

.projeto-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.projeto-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.projeto-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.progress-bar-wrap {
  flex: 1;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.progress-bar {
  height: 5px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 99px;
  transition: width var(--transition-slow);
}

.prazo-label { font-size: .72rem; color: var(--text-dim); text-align: right; flex-shrink: 0; margin-left: .75rem; }
.prazo-label.vencido { color: var(--danger); }
.prazo-label.proximo { color: var(--warning); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .2px;
}

.badge-ideia       { background: rgba(148,163,184,.18);  color: #64748B; border: 1px solid rgba(148,163,184,.35); }
.badge-planejando  { background: rgba(79,143,230,.14);  color: #2F6EC9; border: 1px solid rgba(79,143,230,.3); }
.badge-andamento   { background: rgba(108,99,212,.14);  color: #5248B0; border: 1px solid rgba(108,99,212,.3); }
.badge-revisao     { background: rgba(247,164,64,.14);  color: #B8720A; border: 1px solid rgba(247,164,64,.3); }
.badge-concluido   { background: rgba(39,184,153,.14);  color: #1A8F74; border: 1px solid rgba(39,184,153,.3); }
.badge-arquivado   { background: rgba(120,120,140,.12); color: #706F8E; border: 1px solid rgba(120,120,140,.25); }
.badge-default     { background: rgba(148,163,184,.18); color: #64748B; border: 1px solid rgba(148,163,184,.3); }

.prio-baixa  { color: var(--text-dim); }
.prio-media  { color: var(--info); }
.prio-alta   { color: var(--warning); }
.prio-critica{ color: var(--danger); }

.badge-prio {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .65rem;
  font-weight: 700;
}
.badge-prio.prio-baixa   { background: rgba(120,120,140,.12); color: #706F8E; }
.badge-prio.prio-media   { background: rgba(79,143,230,.14);  color: #2F6EC9; }
.badge-prio.prio-alta    { background: rgba(247,164,64,.14);  color: #B8720A; }
.badge-prio.prio-critica { background: rgba(232,91,91,.14);   color: #C0373B; }

/* ── Botões ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 6px 22px var(--primary-glow); color: #fff; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--primary); background: rgba(108,99,212,.06); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: .45rem .75rem;
}
.btn-ghost:hover { color: var(--primary); background: rgba(108,99,212,.08); }

.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-sm { padding: .35rem .85rem; font-size: .78rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon  { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }

/* ── Formulários ─────────────────────────────────────────── */
.form-group  { margin-bottom: 1.1rem; }
.form-label  { display: block; font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .45rem; }
.form-required::after { content: ' *'; color: var(--danger); }

.form-control {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .875rem;
  padding: .6rem .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-dim); }

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

select.form-control { cursor: pointer; }

.form-hint { font-size: .72rem; color: var(--text-dim); margin-top: .3rem; }
.form-error  { font-size: .75rem; color: var(--danger); margin-top: .3rem; }

.input-group { display: flex; gap: .5rem; }
.input-group .form-control { flex: 1; }

/* ── Alertas / Flash ─────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  margin-bottom: 1rem;
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.alert-success { background: rgba(39,184,153,.10); border: 1px solid rgba(39,184,153,.28); color: #186A55; }
.alert-danger  { background: rgba(232,91,91,.10);  border: 1px solid rgba(232,91,91,.28);  color: #A82828; }
.alert-warning { background: rgba(247,164,64,.10); border: 1px solid rgba(247,164,64,.28); color: #8A5200; }
.alert-info    { background: rgba(79,143,230,.10); border: 1px solid rgba(79,143,230,.28); color: #1E4FA0; }

/* ── Modais ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,20,80,.35);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: scale(.96) translateY(10px);
  transition: all var(--transition);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; }

.modal-body   { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; justify-content: flex-end; }

/* ── Tabelas ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}

th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-dim); }
tr:hover td { background: rgba(108,99,212,.04); }
tr:last-child td { border-bottom: none; }

/* ── Kanban ──────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem;
  min-height: 350px;
}

.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .85rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.kanban-count { background: var(--surface-3); padding: 1px 8px; border-radius: 99px; font-size: .7rem; font-weight: 700; color: var(--text-muted); }

.kanban-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem .85rem .85rem;
  margin-bottom: .65rem;
  transition: all var(--transition);
}
.kanban-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.kanban-card.sortable-ghost { opacity: .4; border: 1px dashed var(--primary); }
.kanban-card.sortable-chosen { box-shadow: var(--shadow-glow); }

.kanban-drag-handle {
  font-size: .9rem;
  color: var(--text-dim);
  cursor: grab;
  margin-bottom: .3rem;
  line-height: 1;
  user-select: none;
}
.kanban-drag-handle:active { cursor: grabbing; }
.kanban-drag-handle:hover  { color: var(--primary); }

.kanban-card-title { font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
.kanban-card-meta  { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.kanban-card-date  { font-size: .7rem; color: var(--text-dim); margin-left: auto; }

/* ── Mapa Mental Frame ───────────────────────────────────── */
.mindmap-container {
  width: 100%;
  height: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

/* ── Timeline / Gantt ────────────────────────────────────── */
.timeline-wrap { overflow-x: auto; padding-bottom: .5rem; }
.timeline-row  { display: flex; align-items: center; gap: .75rem; margin-bottom: .45rem; min-width: 800px; }
.timeline-label { width: 200px; font-size: .8rem; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-track { flex: 1; height: 24px; background: var(--surface-2); border-radius: 99px; position: relative; overflow: hidden; }
.timeline-bar   { position: absolute; top: 4px; bottom: 4px; background: var(--grad-primary); border-radius: 99px; opacity: .8; transition: opacity var(--transition); }
.timeline-bar:hover { opacity: 1; }

/* ── AI Chat / Painel ────────────────────────────────────── */
.ai-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ai-panel-header {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(6,182,212,.06));
  border-bottom: 1px solid var(--border);
}
.ai-panel-title  { font-weight: 700; font-size: .9rem; }
.ai-panel-status { font-size: .72rem; color: var(--success); display: flex; align-items: center; gap: .3rem; }
.ai-panel-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.ai-messages { padding: 1rem 1.25rem; min-height: 200px; max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; }

.ai-msg { border-radius: var(--radius-sm); padding: .85rem 1rem; font-size: .85rem; line-height: 1.6; max-width: 90%; }
.ai-msg.user { background: rgba(108,99,212,.12); border: 1px solid rgba(108,99,212,.25); margin-left: auto; color: var(--text); }
.ai-msg.bot  { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.ai-msg-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-dim); margin-bottom: .35rem; }

.ai-input-wrap { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; }
.ai-input-wrap .form-control { flex: 1; }

/* ── Loader / Skeleton ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #EEF0FA 25%, #E3E6F5 50%, #EEF0FA 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dropzone (upload) ───────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: rgba(124,58,237,.06); color: var(--text); }

/* ── Utilidades ──────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm        { gap: .5rem; }
.gap-md        { gap: 1rem; }
.gap-lg        { gap: 1.5rem; }
.mt-sm         { margin-top: .5rem; }
.mt-md         { margin-top: 1rem; }
.mt-lg         { margin-top: 1.5rem; }
.mb-sm         { margin-bottom: .5rem; }
.mb-md         { margin-bottom: 1rem; }
.mb-lg         { margin-bottom: 1.5rem; }
.text-sm       { font-size: .8rem; }
.text-muted    { color: var(--text-muted); }
.text-dim      { color: var(--text-dim); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-primary  { color: var(--primary); }
.font-bold     { font-weight: 700; }
.hidden        { display: none; }
.sr-only       { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.truncate      { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider       { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.w-full        { width: 100%; }
.relative      { position: relative; }

/* ── Página de Login ─────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(108,99,212,.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(56,182,216,.08) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
  animation: fadeUp .4s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-big {
  width: 64px; height: 64px;
  background: var(--grad-primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto .85rem;
  box-shadow: 0 8px 32px var(--primary-glow);
}
.login-logo h1 {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p { font-size: .85rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .kanban-board {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projetos-grid {
    grid-template-columns: 1fr;
  }
  .page-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}
