/* ============================================================
   MARKETING CLINIC — SISTEMA INTERNO
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;900&family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,700;1,400&display=swap');

:root {
  --purple:       #6E3D9C;
  --purple-dark:  #3D1F6E;
  --purple-deep:  #1A0A2E;
  --yellow:       #F9B931;
  --yellow-light: #FDD87A;
  --white:        #FFFFFF;
  --off-white:    #F8F5FF;
  --gray:         #F2F2F2;
  --text:         #1A0A2E;
  --text-muted:   #7A6E8A;
  --border:       #E8E0F4;
  --success:      #22C55E;
  --warning:      #F59E0B;
  --danger:       #EF4444;
  --info:         #3B82F6;

  --sidebar-w: 240px;
  --header-h: 64px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 2px 12px rgba(110,61,156,.10);
  --shadow-md: 0 4px 24px rgba(110,61,156,.15);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body { font-family: var(--font-body); color: var(--text); background: #F4F0FB; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }
img { max-width: 100%; display: block; }

/* ─── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 10px; }

/* ════════════════════════════════════════════════════════
   LOGIN
════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  background: var(--purple-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
}
.login-bg-orb.orb1 { width: 500px; height: 500px; background: var(--purple); top: -150px; right: -100px; }
.login-bg-orb.orb2 { width: 350px; height: 350px; background: var(--yellow); bottom: -100px; left: -80px; }

.login-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(20px);
  border-radius: var(--r-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .brand {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--white);
  letter-spacing: -0.5px;
}
.login-logo .brand span { color: var(--yellow); }
.login-logo .subtitle {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  margin-top: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-card h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--white);
  margin-bottom: 8px;
}
.login-card p { color: rgba(255,255,255,.5); font-size: .875rem; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.6); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-group input {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  color: var(--white);
  font-size: .95rem;
  transition: border-color .2s, background .2s;
}
.form-group input::placeholder { color: rgba(255,255,255,.3); }
.form-group input:focus { outline: none; border-color: var(--yellow); background: rgba(255,255,255,.12); }

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: var(--white);
  border-radius: var(--r-sm);
  padding: 13px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .5px;
  transition: transform .2s, box-shadow .2s;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,.15);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(110,61,156,.4); }

.login-error {
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.3);
  color: #FCA5A5;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: .85rem;
  margin-top: 14px;
  display: none;
}

/* ════════════════════════════════════════════════════════
   LAYOUT — SIDEBAR + MAIN
════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--purple-deep);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .3s var(--ease);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo .brand {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--white);
}
.sidebar-logo .brand span { color: var(--yellow); }
.sidebar-logo .tag {
  font-size: .7rem;
  color: rgba(255,255,255,.35);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}
.nav-section { margin-bottom: 24px; }
.nav-section-title {
  font-size: .65rem;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  font-weight: 500;
  transition: all .2s;
  margin-bottom: 2px;
  position: relative;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.nav-link:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-link:hover svg { opacity: 1; }
.nav-link.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(110,61,156,.4);
}
.nav-link.active svg { opacity: 1; }

.sidebar-user {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .2s;
  position: relative;
}
.sidebar-user-info:hover { background: rgba(255,255,255,.08); }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .8rem;
  color: var(--white);
  flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name { font-size: .85rem; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .7rem; color: rgba(255,255,255,.4); }

.user-menu {
  position: absolute;
  bottom: 60px; left: 12px; right: 12px;
  background: var(--purple-dark);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-md);
  padding: 8px;
  display: none;
  z-index: 200;
  box-shadow: var(--shadow-md);
}
.user-menu.open { display: block; }
.user-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: .85rem;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: all .2s;
}
.user-menu-item:hover { background: rgba(255,255,255,.1); color: var(--white); }
.user-menu-item.danger { color: #FCA5A5; }
.user-menu-item.danger:hover { background: rgba(239,68,68,.15); }
.user-menu-item svg { width: 15px; height: 15px; }

/* ─── MAIN CONTENT ──────────────────────────────────── */

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── HEADER ────────────────────────────────────────── */

.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.topbar-title p { font-size: .78rem; color: var(--text-muted); margin-top: 1px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gray);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s;
  border: 1px solid var(--border);
}
.notif-btn:hover { background: var(--off-white); }
.notif-btn svg { width: 18px; height: 18px; color: var(--text); }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: var(--white);
  font-size: .6rem;
  font-weight: 700;
  width: 17px; height: 17px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white);
}

.page-body { flex: 1; padding: 28px; }

/* ─── NOTIFICATION PANEL ────────────────────────────── */

.notif-panel {
  position: fixed;
  top: var(--header-h); right: 0;
  width: 360px;
  height: calc(100vh - var(--header-h));
  background: var(--white);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s var(--ease);
  box-shadow: -4px 0 24px rgba(110,61,156,.1);
}
.notif-panel.open { transform: translateX(0); }
.notif-panel-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-panel-header h3 { font-family: var(--font-head); font-size: .95rem; font-weight: 700; }
.notif-panel-header button { font-size: .75rem; color: var(--purple); font-weight: 600; padding: 4px 10px; border-radius: 20px; background: var(--off-white); }
.notif-list { flex: 1; overflow-y: auto; padding: 8px; }
.notif-item {
  display: flex; gap: 12px;
  padding: 12px;
  border-radius: var(--r-sm);
  margin-bottom: 2px;
  cursor: pointer;
  transition: background .2s;
  border: 1px solid transparent;
}
.notif-item:hover { background: var(--off-white); }
.notif-item.unread { background: rgba(110,61,156,.06); border-color: rgba(110,61,156,.12); }
.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.notif-icon.tarefa { background: rgba(110,61,156,.12); }
.notif-icon.lembrete { background: rgba(249,185,49,.15); }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: .85rem; font-weight: 600; color: var(--text); }
.notif-msg { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }
.notif-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); font-size: .875rem; }

/* ════════════════════════════════════════════════════════
   COMPONENTES PARTILHADOS
════════════════════════════════════════════════════════ */

/* ─── CARDS ─────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-family: var(--font-head); font-size: .95rem; font-weight: 700; }
.card-body { padding: 20px; }

/* ─── STAT CARDS ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon.purple { background: rgba(110,61,156,.12); }
.stat-icon.yellow { background: rgba(249,185,49,.15); }
.stat-icon.green  { background: rgba(34,197,94,.12); }
.stat-icon.red    { background: rgba(239,68,68,.12); }
.stat-info { flex: 1; }
.stat-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 900; color: var(--text); line-height: 1; margin-top: 4px; }
.stat-sub { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* ─── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .875rem;
  transition: all .2s;
  cursor: pointer;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); color: var(--white); border: 1px solid transparent; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(110,61,156,.35); transform: translateY(-1px); }
.btn-secondary { background: var(--off-white); color: var(--purple); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--gray); }
.btn-yellow { background: var(--yellow); color: var(--purple-deep); border: 1px solid transparent; }
.btn-yellow:hover { background: var(--yellow-light); }
.btn-danger { background: rgba(239,68,68,.1); color: var(--danger); border: 1px solid rgba(239,68,68,.2); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid transparent; padding: 7px 12px; }
.btn-ghost:hover { background: var(--gray); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-icon { padding: 8px; border-radius: var(--r-sm); }

/* ─── BADGES ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}
/* Status */
.badge-a_fazer    { background: rgba(107,114,128,.12); color: #4B5563; }
.badge-em_progresso { background: rgba(59,130,246,.12); color: #2563EB; }
.badge-em_revisao { background: rgba(249,185,49,.15); color: #B45309; }
.badge-concluida  { background: rgba(34,197,94,.12); color: #16A34A; }
.badge-arquivada  { background: rgba(156,163,175,.12); color: #9CA3AF; }
/* Priority */
.badge-baixa    { background: rgba(34,197,94,.1); color: #16A34A; }
.badge-media    { background: rgba(59,130,246,.1); color: #2563EB; }
.badge-alta     { background: rgba(249,185,49,.15); color: #B45309; }
.badge-urgente  { background: rgba(239,68,68,.12); color: #DC2626; }
/* Pipeline */
.badge-lead       { background: rgba(107,114,128,.1); color: #6B7280; }
.badge-proposta   { background: rgba(59,130,246,.1); color: #3B82F6; }
.badge-negociacao { background: rgba(249,185,49,.15); color: #B45309; }
.badge-ativo      { background: rgba(34,197,94,.1); color: #16A34A; }
.badge-inativo    { background: rgba(156,163,175,.1); color: #9CA3AF; }
/* Network */
.badge-instagram { background: rgba(225,48,108,.1); color: #E1306C; }
.badge-facebook  { background: rgba(24,119,242,.1); color: #1877F2; }
.badge-tiktok    { background: rgba(0,0,0,.08); color: #010101; }
.badge-linkedin  { background: rgba(0,119,181,.1); color: #0077B5; }
.badge-youtube   { background: rgba(255,0,0,.1); color: #FF0000; }

/* ─── FORMS ─────────────────────────────────────────── */
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-field label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  background: var(--off-white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: .9rem;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(110,61,156,.1); }
.form-control::placeholder { color: rgba(26,10,46,.35); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237A6E8A' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* ─── MODAL ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,10,46,.5);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95) translateY(10px);
  transition: transform .25s var(--ease);
  box-shadow: 0 20px 60px rgba(26,10,46,.3);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal.modal-lg { max-width: 780px; }
.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; background: var(--white); z-index: 1; border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal-header h2 { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gray);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s;
}
.modal-close:hover { background: var(--border); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── TABLE ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--off-white);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--off-white); }

/* ─── SEARCH / FILTER BAR ───────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .875rem;
  color: var(--text);
  transition: border-color .2s;
}
.search-input:focus { outline: none; border-color: var(--purple); }

/* ─── TAGS ──────────────────────────────────────────── */
.tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: rgba(110,61,156,.1);
  color: var(--purple);
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.tag .rm-tag { cursor: pointer; opacity: .6; }
.tag .rm-tag:hover { opacity: 1; }

/* ─── SUBTASKS ──────────────────────────────────────── */
.subtask-list { display: flex; flex-direction: column; gap: 6px; }
.subtask-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--off-white);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  border: 1px solid var(--border);
}
.subtask-item input[type=checkbox] { accent-color: var(--purple); width: 16px; height: 16px; cursor: pointer; }
.subtask-item span { flex: 1; font-size: .875rem; }
.subtask-item span.done { text-decoration: line-through; color: var(--text-muted); }
.subtask-rm { color: var(--text-muted); cursor: pointer; }
.subtask-rm:hover { color: var(--danger); }
.subtask-add { display: flex; gap: 8px; margin-top: 8px; }
.subtask-add input { flex: 1; padding: 7px 12px; background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r-sm); font-size: .85rem; }
.subtask-add input:focus { outline: none; border-color: var(--purple); }

/* ─── PROGRESS BAR ──────────────────────────────────── */
.progress-wrap { margin-top: 6px; }
.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--yellow)); border-radius: 10px; transition: width .4s; }

/* ─── EMPTY STATE ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.empty-state h3 { font-family: var(--font-head); font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.empty-state p { font-size: .85rem; color: var(--text-muted); margin-top: 6px; }

/* ─── TOAST ─────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--purple-deep);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px;
  animation: toastIn .3s var(--ease);
  border-left: 3px solid var(--yellow);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ════════════════════════════════════════════════════════
   DASHBOARD
════════════════════════════════════════════════════════ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.welcome-bar {
  background: linear-gradient(135deg, var(--purple-deep) 0%, var(--purple-dark) 100%);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}
.welcome-bar::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(249,185,49,.08);
}
.welcome-text h2 { font-family: var(--font-head); font-size: 1.3rem; font-weight: 900; color: var(--white); }
.welcome-text p { color: rgba(255,255,255,.55); font-size: .875rem; margin-top: 4px; }
.welcome-date { font-family: var(--font-head); font-size: .8rem; color: rgba(255,255,255,.4); background: rgba(255,255,255,.07); padding: 6px 14px; border-radius: 20px; }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--off-white);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: .875rem;
  cursor: pointer;
  transition: all .2s;
}
.recent-item:hover { border-color: var(--purple); background: rgba(110,61,156,.04); }
.recent-item-icon { font-size: 1.1rem; }
.recent-item-info { flex: 1; min-width: 0; }
.recent-item-info strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item-info span { font-size: .75rem; color: var(--text-muted); }

.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════
   CRM
════════════════════════════════════════════════════════ */

.pipeline-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 28px;
}
.pipeline-col {
  flex: 0 0 220px;
  background: var(--off-white);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 14px;
}
.pipeline-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.pipeline-col-title { font-family: var(--font-head); font-size: .8rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .5px; }
.pipeline-count {
  background: var(--purple);
  color: var(--white);
  font-size: .7rem;
  font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.pipeline-card {
  background: var(--white);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .2s;
}
.pipeline-card:hover { border-color: var(--purple); box-shadow: var(--shadow); }
.pipeline-card-name { font-weight: 600; font-size: .875rem; }
.pipeline-card-company { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.pipeline-card-value { font-family: var(--font-head); font-weight: 700; color: var(--purple); font-size: .85rem; margin-top: 8px; }
.pipeline-card[draggable=true] { cursor: grab; }
.pipeline-card[draggable=true]:active { cursor: grabbing; }
.pipeline-col.drag-over { background: rgba(110,61,156,.08); border-color: var(--purple); outline: 2px dashed var(--purple); }
.pipeline-col-cards { min-height: 60px; }
.pipeline-drop-hint { padding: 20px 0; text-align: center; color: var(--text-muted); font-size: .78rem; border: 2px dashed var(--border); border-radius: var(--r-sm); }

/* ════════════════════════════════════════════════════════
   TAREFAS
════════════════════════════════════════════════════════ */

.tasks-view-toggle { display: flex; gap: 4px; background: var(--gray); border-radius: var(--r-sm); padding: 3px; }
.view-btn { padding: 6px 14px; border-radius: calc(var(--r-sm) - 2px); font-size: .8rem; font-weight: 600; color: var(--text-muted); transition: all .2s; }
.view-btn.active { background: var(--white); color: var(--purple); box-shadow: var(--shadow); }

.task-kanban {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  min-height: 500px;
}
.kanban-col {
  background: var(--off-white);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 12px;
}
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kanban-col-title { font-family: var(--font-head); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.kanban-count { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.k-col-a_fazer .kanban-col-title    { color: #4B5563; } .k-col-a_fazer .kanban-count    { background: rgba(107,114,128,.12); color: #4B5563; }
.k-col-em_progresso .kanban-col-title { color: #2563EB; } .k-col-em_progresso .kanban-count { background: rgba(59,130,246,.12); color: #2563EB; }
.k-col-em_revisao .kanban-col-title { color: #B45309; } .k-col-em_revisao .kanban-count { background: rgba(249,185,49,.15); color: #B45309; }
.k-col-concluida .kanban-col-title  { color: #16A34A; } .k-col-concluida .kanban-count  { background: rgba(34,197,94,.12); color: #16A34A; }
.k-col-arquivada .kanban-col-title  { color: #9CA3AF; } .k-col-arquivada .kanban-count  { background: rgba(156,163,175,.1); color: #9CA3AF; }

.task-card {
  background: var(--white);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .2s;
}
.task-card:hover { border-color: var(--purple); box-shadow: var(--shadow); transform: translateY(-1px); }
.task-card-title { font-weight: 600; font-size: .875rem; line-height: 1.3; }
.task-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.task-card-client { font-size: .72rem; color: var(--text-muted); }
.task-card-date { font-size: .72rem; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.task-card-date.overdue { color: var(--danger); }
.task-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.assignee-chip {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(110,61,156,.1);
  color: var(--purple);
}
.assignee-chip.danae { background: rgba(249,185,49,.15); color: #B45309; }
.assignee-chip.ambas { background: rgba(34,197,94,.1); color: #16A34A; }

/* Lista view */
.task-list-view { display: flex; flex-direction: column; gap: 6px; }
.task-list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: all .2s;
}
.task-list-item:hover { border-color: var(--purple); background: rgba(110,61,156,.02); }
.task-list-item .status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.task-list-item .t-title { flex: 1; font-weight: 600; font-size: .875rem; }
.task-list-item .t-client { font-size: .78rem; color: var(--text-muted); min-width: 100px; }
.task-list-item .t-date { font-size: .78rem; color: var(--text-muted); min-width: 90px; }
.task-list-item .t-date.overdue { color: var(--danger); font-weight: 600; }
.task-list-item .t-assignee { min-width: 80px; }
.task-list-item .t-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.task-list-item:hover .t-actions { opacity: 1; }

.status-dot.a_fazer    { background: #9CA3AF; }
.status-dot.em_progresso { background: #3B82F6; }
.status-dot.em_revisao { background: #F59E0B; }
.status-dot.concluida  { background: #22C55E; }
.status-dot.arquivada  { background: #D1D5DB; }

/* ════════════════════════════════════════════════════════
   CALENDÁRIO DE CONTEÚDOS
════════════════════════════════════════════════════════ */

.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav button { width: 34px; height: 34px; border-radius: 50%; background: var(--white); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; }
.cal-nav button:hover { border-color: var(--purple); }
.cal-nav button svg { width: 16px; height: 16px; }
.cal-month { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.cal-day-header {
  background: var(--off-white);
  padding: 8px;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.cal-day {
  background: var(--white);
  min-height: 100px;
  padding: 6px;
  position: relative;
  transition: background .15s;
}
.cal-day:hover { background: rgba(110,61,156,.02); }
.cal-day.other-month { background: var(--off-white); }
.cal-day.today { background: rgba(110,61,156,.05); }
.cal-day-num {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cal-day.today .cal-day-num {
  background: var(--purple);
  color: var(--white);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cal-post {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-post.instagram { background: rgba(225,48,108,.12); color: #E1306C; }
.cal-post.facebook  { background: rgba(24,119,242,.12); color: #1877F2; }
.cal-post.tiktok    { background: rgba(0,0,0,.08); color: #333; }
.cal-post.linkedin  { background: rgba(0,119,181,.12); color: #0077B5; }
.cal-post.youtube   { background: rgba(255,0,0,.1); color: #FF0000; }

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 1024px) {
  .task-kanban { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .task-kanban { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .pipeline-board { flex-direction: column; }
  .pipeline-col { flex: none; }
}

/* ─── PWA Install Banner ──────────────────────────────────── */
#pwa-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #7B4FA6;
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .88rem;
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(123,79,166,.45);
  z-index: 9999;
  white-space: nowrap;
}
#pwa-banner button { border: none; cursor: pointer; border-radius: 8px; padding: .4rem .85rem; font-size: .83rem; font-weight: 600; }
#pwa-install-btn { background: #fff; color: #7B4FA6; }
#pwa-dismiss-btn { background: rgba(255,255,255,.2); color: #fff; padding: .4rem .6rem; }
