/* ============================================================
   GESTÃO TAREFAS MKT ROXO — Main Stylesheet
   Purple theme + Dark mode
   ============================================================ */

/* --- Variables ------------------------------------------- */
:root {
  --purple:       #582c87;
  --purple-dark:  #4a2472;
  --purple-light: #7040a8;
  --purple-xlight:#f0eaf8;
  --purple-50:    rgba(88,44,135,.08);
  --accent:       #d8db29;
  --accent-dark:  #b8bb1a;

  --bg:           #F5F3FB;
  --bg-card:      #FFFFFF;
  --bg-sidebar:   #1a0f2e;
  --bg-topbar:    #FFFFFF;

  --text:         #1F1B2E;
  --text-muted:   #6B7280;
  --border:       #E5E7EB;

  --success:  #10B981;
  --warning:  #F59E0B;
  --danger:   #EF4444;
  --info:     #3B82F6;
  --orange:   #F97316;
  --teal:     #14B8A6;
  --indigo:   #6366F1;

  --sidebar-w: 240px;
  --topbar-h:  64px;
  --radius:    12px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);

  --transition: all .2s ease;
}

[data-theme="dark"], .dark-mode {
  --bg:           #0F0B18;
  --bg-card:      #1A1428;
  --bg-sidebar:   #0A0812;
  --bg-topbar:    #1A1428;
  --text:         #F1EEF9;
  --text-muted:   #9CA3AF;
  --border:       #2D2845;
  --purple-xlight:#2d1a4a;
  --purple-50:    rgba(88,44,135,.18);
  --shadow:       0 2px 12px rgba(0,0,0,.3);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.4);
}

/* --- Reset / Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: background .3s, color .3s;
  overflow-x: hidden;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width .25s ease, transform .25s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .sidebar-menu span,
.sidebar.collapsed .menu-label,
.sidebar.collapsed .sidebar-footer span { display: none; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--purple);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  white-space: nowrap;
}

.logo-text strong { color: var(--purple-light); }

.sidebar-toggle, .mobile-toggle {
  background: none; border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.08); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.user-avatar {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

.user-info { overflow: hidden; }
.user-name {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { color: rgba(255,255,255,.45); font-size: 11px; }

.sidebar-menu {
  list-style: none;
  margin: 8px 0 0; padding: 0 8px;
  flex: 1; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.menu-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  padding: 12px 8px 4px;
}

.sidebar-menu > li > a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.6);
  padding: 9px 10px;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.sidebar-menu > li > a i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }

.sidebar-menu > li > a:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}

.sidebar-menu > li.active > a {
  color: #fff;
  background: var(--purple);
  box-shadow: 0 4px 12px rgba(124,58,237,.4);
}

.badge-count {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.dark-toggle {
  background: rgba(255,255,255,.08);
  border: none;
  color: rgba(255,255,255,.6);
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.dark-toggle:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left .25s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed + .main-content { margin-left: 68px; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0; z-index: 900;
  box-shadow: var(--shadow);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.mobile-toggle {
  display: none;
  color: var(--text-muted);
}

.breadcrumb-area { color: var(--text-muted); font-size: 14px; }

/* Timer widget */
.timer-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--purple-50);
  border: 1.5px solid var(--purple-xlight);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  color: var(--purple);
  box-shadow: 0 2px 8px rgba(88,44,135,.15);
}
.timer-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.timer-task-name {
  font-size: 10px;
  font-weight: 500;
  opacity: .75;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#timerDisplay {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.timer-pulse-dot {
  width: 9px; height: 9px;
  background: #ef4444;
  border-radius: 50%;
  flex-shrink: 0;
  animation: timer-pulse 1.4s ease-in-out infinite;
}
@keyframes timer-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  50%       { opacity: .8; transform: scale(1.15); box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Timer banner (injected abaixo do topbar) */
.timer-active-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, rgba(88,44,135,.12), rgba(88,44,135,.06));
  border-bottom: 2px solid var(--purple-xlight);
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
}
.timer-active-banner .tab-time {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 72px;
}
.timer-active-banner .tab-task {
  flex: 1;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-timer-pause, .btn-timer-stop {
  background: none; border: none; cursor: pointer;
  color: var(--purple); padding: 3px 6px;
  border-radius: 4px;
  font-size: 13px;
  transition: var(--transition);
}
.btn-timer-stop { color: var(--danger); }
.btn-timer-pause:hover { background: rgba(124,58,237,.15); }
.btn-timer-stop:hover  { background: rgba(239,68,68,.12); }

/* Histórico de tarefas */
.historico-list { max-height: 280px; overflow-y: auto; }
.historico-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.historico-item:last-child { border-bottom: none; }
.historico-icon {
  width: 18px; text-align: center; flex-shrink: 0;
  font-size: 11px; padding-top: 1px;
}
.historico-body { flex: 1; font-size: 11px; line-height: 1.4; }
.historico-meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

/* Notif button */
.notif-btn {
  position: relative;
  background: none; border: none;
  color: var(--text-muted); font-size: 18px;
  cursor: pointer; padding: 6px;
  border-radius: 8px;
  transition: var(--transition);
}
.notif-btn:hover { color: var(--purple); background: var(--purple-50); }

.notif-badge {
  position: absolute;
  top: 0; right: 0;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-topbar);
}

.notif-dropdown {
  width: 340px;
  padding: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
  border-radius: var(--radius);
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.btn-link { background: none; border: none; color: var(--purple); cursor: pointer; font-size: 12px; }
.btn-link:hover { text-decoration: underline; }

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover { background: var(--purple-50); }
.notif-item.unread { border-left: 3px solid var(--purple); }
.notif-item-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.notif-item-msg   { font-size: 12px; color: var(--text-muted); }
.notif-item-time  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-empty      { padding: 24px; text-align: center; color: var(--text-muted); }

/* New task button */
.btn-new-task {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-new-task:hover { background: var(--purple-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.35); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content { padding: 24px; flex: 1; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.stat-purple .stat-icon { background: var(--purple-50); color: var(--purple); }
.stat-warning .stat-icon { background: rgba(245,158,11,.1); color: var(--warning); }
.stat-success .stat-icon { background: rgba(16,185,129,.1); color: var(--success); }
.stat-danger  .stat-icon { background: rgba(239,68,68,.1); color: var(--danger); }
.stat-info    .stat-icon { background: rgba(59,130,246,.1); color: var(--info); }
.stat-orange  .stat-icon { background: rgba(249,115,22,.1); color: var(--orange); }
.stat-teal    .stat-icon { background: rgba(20,184,166,.1); color: var(--teal); }
.stat-indigo  .stat-icon { background: rgba(99,102,241,.1); color: var(--indigo); }

/* ============================================================
   GLASS CARDS
   ============================================================ */
.card-glass {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-glass-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.card-glass-body { padding: 20px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-purple {
  background: var(--purple) !important;
  border-color: var(--purple) !important;
  color: #fff !important;
}
.btn-purple:hover {
  background: var(--purple-dark) !important;
  border-color: var(--purple-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124,58,237,.35);
}
.btn-outline-purple {
  border-color: var(--purple) !important;
  color: var(--purple) !important;
}
.btn-outline-purple:hover {
  background: var(--purple) !important;
  color: #fff !important;
}
.bg-purple { background-color: var(--purple) !important; }
.text-purple { color: var(--purple) !important; }
.border-purple { border-color: var(--purple) !important; }

/* ============================================================
   PRIORITY BADGES
   ============================================================ */
.badge-priority {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-urgente { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.badge-alta    { background: rgba(249,115,22,.15); color: var(--orange); border: 1px solid rgba(249,115,22,.3); }
.badge-media   { background: rgba(245,158,11,.15); color: var(--warning); border: 1px solid rgba(245,158,11,.3); }
.badge-baixa   { background: rgba(16,185,129,.15); color: var(--success); border: 1px solid rgba(16,185,129,.3); }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.status-pendente              { background: rgba(107,114,128,.1); color: var(--text-muted); }
.status-em-andamento          { background: var(--purple-50); color: var(--purple); }
.status-aguardando-aprovacao  { background: rgba(245,158,11,.1); color: var(--warning); }
.status-ajuste-solicitado     { background: rgba(239,68,68,.1); color: var(--danger); }
.status-concluido             { background: rgba(16,185,129,.1); color: var(--success); }

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.filter-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-form .form-select, .filter-form .form-control { font-size: 13px; }

.view-switcher { display: flex; gap: 4px; }
.view-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}
.view-btn.active, .view-btn:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 200px);
  align-items: flex-start;
  scrollbar-width: thin;
}

.kanban-col {
  min-width: 260px;
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}

.kanban-col-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
}

.col-purple .kanban-col-header { border-color: var(--purple); }
.col-gray   .kanban-col-header { border-color: #9CA3AF; }
.col-orange .kanban-col-header { border-color: var(--orange); }
.col-red    .kanban-col-header { border-color: var(--danger); }
.col-green  .kanban-col-header { border-color: var(--success); }

.kanban-col-title { font-weight: 700; font-size: 13px; display: flex; align-items: center; }
.col-purple .kanban-col-title { color: var(--purple); }
.col-gray   .kanban-col-title { color: #9CA3AF; }
.col-orange .kanban-col-title { color: var(--orange); }
.col-red    .kanban-col-title { color: var(--danger); }
.col-green  .kanban-col-title { color: var(--success); }

.kanban-count {
  background: var(--purple-50);
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
}

.kanban-cards {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 80px;
  scrollbar-width: thin;
}

/* Drag & drop feedback */
.kanban-cards.sortable-over {
  background: var(--purple-50);
  border-radius: 8px;
}

.sortable-ghost {
  opacity: .3;
}

/* Kanban Card */
.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.kanban-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  border-color: var(--purple);
}
.kanban-card:active { cursor: grabbing; }

.card-urgente-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--danger), var(--orange));
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-tipo { font-size: 11px; color: var(--text-muted); }
.card-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; line-height: 1.4; }
.card-client {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.client-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-meta { display: flex; gap: 8px; align-items: center; }
.card-deadline, .card-time {
  font-size: 11px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 3px;
}
.card-deadline.overdue { color: var(--danger); font-weight: 600; }

.card-actions { display: flex; gap: 4px; opacity: 0; transition: var(--transition); }
.kanban-card:hover .card-actions { opacity: 1; }

.card-action-btn {
  background: none; border: none;
  color: var(--text-muted); font-size: 12px;
  padding: 3px 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition);
}
.card-action-btn:hover { color: var(--purple); background: var(--purple-50); }

.card-avatar {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   TABLE TASKS
   ============================================================ */
.table-tasks { color: var(--text); }
.table-tasks thead th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}
.table-tasks tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.table-tasks tbody tr:hover { background: var(--purple-50); }

/* ============================================================
   MINI TASK ITEMS (dashboard lists)
   ============================================================ */
.task-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  transition: var(--transition);
}
.task-mini-item:hover { background: var(--purple-50); }
.task-mini-item:last-child { border-bottom: none; }
.task-mini-info { flex: 1; overflow: hidden; }
.task-mini-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.task-mini-client { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   RANKING ITEMS
   ============================================================ */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.ranking-item:last-child { border-bottom: none; }

.rank-pos {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.rank-1 { background: #FFD700; color: #5a3e00; }
.rank-2 { background: #C0C0C0; color: #333; }
.rank-3 { background: #CD7F32; color: #fff; }
.rank-4, .rank-5 { background: var(--purple-50); color: var(--purple); }

.rank-info { flex: 1; }
.rank-name { font-weight: 600; font-size: 13px; }
.rank-sub  { font-size: 11px; color: var(--text-muted); }

.rank-bar {
  width: 60px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.rank-bar div {
  height: 100%;
  background: var(--purple);
  border-radius: 2px;
}

/* ============================================================
   CLIENT CARDS
   ============================================================ */
.client-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}
.client-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.client-card-color { height: 4px; }
.client-card-body { padding: 20px; text-align: center; }

.client-initial {
  width: 54px; height: 54px;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}

.client-name    { font-weight: 700; margin-bottom: 2px; }
.client-company { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

.client-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.client-card-actions {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  justify-content: flex-end;
}

/* ============================================================
   APPROVAL CARDS
   ============================================================ */
.approval-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  transition: var(--transition);
}
.approval-card:hover { box-shadow: var(--shadow-lg); }

.approval-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.approval-task        { font-weight: 700; margin-bottom: 4px; font-size: 14px; }
.approval-client      { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.approval-meta        { display: flex; gap: 8px; margin-bottom: 8px; }
.approval-desc        { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.approval-feedback    {
  background: rgba(239,68,68,.08);
  border-left: 3px solid var(--danger);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--danger);
  margin-bottom: 10px;
}
.approval-footer { display: flex; justify-content: space-between; align-items: center; }

/* ============================================================
   USER AVATAR SMALL
   ============================================================ */
.user-avatar-sm {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-avatar-wrap {
  position: relative;
  width: 100px; height: 100px;
  margin: 0 auto;
}

.profile-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--purple);
}

.profile-avatar-initials {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--purple-dark);
}

.profile-avatar-edit {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 28px; height: 28px;
  background: var(--purple);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}
.profile-avatar-edit:hover { background: var(--purple-dark); }

/* ============================================================
   AUTH PAGES — SPLIT LAYOUT
   ============================================================ */
.auth-body {
  margin: 0;
  padding: 0;
  background: #0d0d12;
}

/* Container split 50/50 */
.auth-split-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Painel esquerdo: branding roxo ---- */
.auth-left-panel {
  width: 50%;
  background: linear-gradient(135deg, #2a1254 0%, #582c87 55%, #7040a8 100%);
  position: relative;
  overflow: hidden;
  display: flex;
}

.auth-left-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 55%, rgba(255,255,255,.06) 0%, transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.06) 0%, transparent 50%);
  pointer-events: none;
}

.auth-left-inner {
  flex: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 56px 48px;
}

/* Grupo central: logo + título + desc + cards */
.alp-main {
  display: flex;
  flex-direction: column;
  gap: 36px;
  width: 100%;
  max-width: 460px;
}

.alp-logo {
  text-align: center;
}

.alp-logo img {
  max-height: 60px;
  width: auto;
  object-fit: contain;
}

.alp-footer {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: rgba(255,255,255,.3);
  font-size: .78rem;
  margin: 0;
}

.alp-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
}

.alp-title {
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin: 0;
  text-align: center;
}
.alp-title span { color: rgba(255,255,255,.7); }

.alp-desc {
  color: rgba(255,255,255,.68);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
  text-align: center;
}

.alp-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.alp-feature {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: background .2s;
}
.alp-feature:hover { background: rgba(255,255,255,.15); }

.alp-feature i {
  font-size: 1.5rem;
  color: var(--accent);
}

.alp-feature-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.alp-feature-text strong {
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
}
.alp-feature-text span {
  color: rgba(255,255,255,.55);
  font-size: .77rem;
}

/* ---- Painel direito: formulário escuro ---- */
.auth-right-panel {
  flex: 1;
  background: #0d0d12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow-y: auto;
}

.auth-right-inner {
  width: 100%;
  max-width: 400px;
}

.arp-header {
  margin-bottom: 36px;
}
.arp-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}
.arp-header p {
  color: #71717a;
  font-size: .9rem;
  margin: 0;
}

.arp-field {
  margin-bottom: 18px;
}
.arp-field label {
  display: block;
  color: #a1a1aa;
  font-size: .83rem;
  margin-bottom: 8px;
  font-weight: 500;
}
.arp-field label i { color: #52525b; margin-right: 4px; }

.arp-input {
  width: 100%;
  background: #18181f;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 13px 16px;
  color: #fff;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.arp-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(88,44,135,.25);
}
.arp-input::placeholder { color: #3f3f46; }

.arp-input-wrap { position: relative; }
.arp-input-wrap .arp-input { padding-right: 44px; }

.arp-eye {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #52525b;
  cursor: pointer;
  padding: 0;
  font-size: .9rem;
  transition: color .2s;
}
.arp-eye:hover { color: #a1a1aa; }

.arp-btn {
  width: 100%;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background .2s, transform .1s;
  letter-spacing: .3px;
}
.arp-btn:hover:not(:disabled) { background: var(--purple-dark); }
.arp-btn:active:not(:disabled) { transform: scale(.99); }
.arp-btn:disabled { opacity: .65; cursor: not-allowed; }

.arp-link {
  color: #a78bfa;
  font-size: .85rem;
  text-decoration: none;
  transition: color .2s;
}
.arp-link:hover { color: #c4b5fd; }

/* Mobile: esquerdo oculto */
@media (max-width: 1023px) {
  /* Empilha verticalmente no mobile */
  .auth-split-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  /* Painel esquerdo: aparece no topo, altura automática */
  .auth-left-panel {
    display: flex;
    width: 100%;
  }
  .auth-left-inner {
    padding: 36px 28px 28px;
  }
  .alp-main { gap: 24px; }
  .alp-title { font-size: 1.9rem; }
  .alp-desc  { font-size: .95rem; }
  .alp-features { gap: 10px; }
  .alp-feature  { padding: 14px 12px; }
  .alp-footer   { display: none; }

  /* Painel direito: formulário abaixo */
  .auth-right-panel {
    width: 100%;
    min-height: auto;
    padding: 36px 28px 48px;
  }
  .auth-body { background: #0d0d12; }
}

/* ============================================================
   LOADER
   ============================================================ */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
}
.loader-overlay.show { display: flex; }

.loader-spinner {
  width: 48px; height: 48px;
  border: 5px solid rgba(255,255,255,.2);
  border-top-color: var(--purple-light);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp .25s ease;
  pointer-events: auto;
  border-left: 4px solid var(--purple);
}
.toast-item.success { border-left-color: var(--success); }
.toast-item.danger  { border-left-color: var(--danger); }
.toast-item.warning { border-left-color: var(--warning); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ============================================================
   MODAL IMPROVEMENTS
   ============================================================ */
.modal-content {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.form-control, .form-select {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
  border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-50);
  background: var(--bg);
  color: var(--text);
}
.form-label { font-weight: 600; font-size: 13px; color: var(--text-muted); }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  color: var(--text-muted);
}

/* ============================================================
   DATE FILTER BAR
   ============================================================ */
.date-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.date-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.date-pill:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--purple-50);
}

.date-pill.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 3px 10px rgba(124,58,237,.3);
}

.date-pill.pill-danger { color: var(--danger); border-color: rgba(239,68,68,.3); }
.date-pill.pill-danger:hover, .date-pill.pill-danger.active {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 3px 10px rgba(239,68,68,.3);
}

.date-pill-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
}

.date-range-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn .2s ease;
}

.date-range-inputs .form-control {
  width: 130px;
  font-size: 12px;
}

.date-clear-btn {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.date-clear-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239,68,68,.06);
}

@keyframes fadeIn {
  from { opacity:0; transform:translateX(-6px); }
  to   { opacity:1; transform:translateX(0); }
}

@media (max-width: 768px) {
  .date-pills { gap: 4px; }
  .date-pill  { padding: 5px 10px; font-size: 11px; }
  .date-range-inputs .form-control { width: 110px; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Overlay escuro quando sidebar está aberta no mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    z-index: 200;
    transition: transform .25s ease;
  }
  .sidebar.mobile-open { transform: translateX(0); }

  .main-content { margin-left: 0 !important; }
  .mobile-toggle { display: flex; }

  .page-content { padding: 16px; }
  .kanban-board { gap: 12px; }
  .kanban-col   { min-width: 230px; }

  .toolbar-right .filter-form { display: none; }
  .topbar { padding: 0 14px; }

  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }

  .btn-new-task span { display: none; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .stat-value { font-size: 18px; }
}

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ============================================================
   BOOTSTRAP DARK MODE OVERRIDES
   ============================================================ */
.dark-mode .table {
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,.03);
  --bs-table-hover-bg: var(--purple-50);
  --bs-table-border-color: var(--border);
}
.dark-mode .alert-danger {
  --bs-alert-bg: rgba(239,68,68,.15);
  --bs-alert-border-color: rgba(239,68,68,.3);
  --bs-alert-color: #fca5a5;
}
.dark-mode .dropdown-menu {
  background: var(--bg-card);
  border-color: var(--border);
}
