/* ============================================================
   HANDOFF MOBILE — DESIGN SYSTEM (Mobile-First)
   ============================================================ */

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

/* ── Variáveis de Tema ──────────────────────────────────────── */
:root {
  --primary:        #0052cc;
  --primary-light:  #00b4d8;
  --primary-grad:   linear-gradient(135deg, #0052cc, #00b4d8);
  --primary-alpha:  rgba(0, 82, 204, 0.08);
  --primary-shadow: rgba(0, 82, 204, 0.22);

  --bg:     #f4f7fb;
  --card:   #ffffff;
  --card2:  #f8fafc;
  --border: #e2e8f0;
  --text:   #1e293b;
  --muted:  #64748b;
  --field:  #f1f5f9;

  --success: #10b981;
  --danger:  #ef4444;
  --warning: #f59e0b;
  --info:    #0ea5e9;
  --purple:  #8b5cf6;
  --orange:  #f97316;

  --bottom-nav-h: 64px;
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
  --radius-lg:    20px;
  --radius-md:    14px;
  --radius-sm:    10px;

  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --trans:        all 0.32s var(--ease-premium);
}

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

html {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* ── Tela de Login ──────────────────────────────────────────── */
#tela-login {
  position: fixed;
  inset: 0;
  background: var(--primary);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(0,180,216,0.35) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(0,82,204,0.5) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.login-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 28px 36px;
}

.login-hero-logo {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
}

.login-hero-logo i { color: #fff; font-size: 22px; }

.login-hero h1 {
  color: #fff;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.login-hero p {
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  font-weight: 400;
}

.login-sheet {
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 32px 28px;
  padding-bottom: calc(32px + var(--safe-bottom));
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
}

.login-sheet h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-sheet p.login-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.login-field {
  position: relative;
  margin-bottom: 16px;
}

.login-field i.field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  pointer-events: none;
}

.login-field input {
  width: 100%;
  padding: 15px 48px 15px 46px;
  background: var(--field);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: var(--trans);
  -webkit-appearance: none;
}

.login-field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-alpha);
}

.login-field .toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  min-width: auto;
  box-shadow: none;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--primary-grad);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
  box-shadow: 0 4px 16px var(--primary-shadow);
  margin-top: 8px;
  letter-spacing: 0.3px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  display: none;
}

.login-error.visible { display: block; }

/* ── Loader Global ──────────────────────────────────────────── */
#global-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 900;
}

#global-loader.hidden { display: none; }

.loader-logo {
  width: 64px;
  height: 64px;
  background: var(--primary-grad);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--primary-shadow);
  animation: logoPulse 1.5s ease-in-out infinite;
}

.loader-logo i { color: #fff; font-size: 28px; }

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--primary-alpha);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loader-text { font-size: 14px; color: var(--muted); font-weight: 500; }

/* ── App Shell ──────────────────────────────────────────────── */
#app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top Bar ────────────────────────────────────────────────── */
.top-bar {
  flex-shrink: 0;
  height: 60px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 50;
}

.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar-logo {
  width: 34px;
  height: 34px;
  background: var(--primary-grad);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-bar-logo i { color: #fff; font-size: 16px; }

.top-bar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.top-bar-actions { display: flex; align-items: center; gap: 4px; }

.icon-btn-top {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--trans);
  position: relative;
  box-shadow: none;
  min-width: auto;
  padding: 0;
}

.icon-btn-top:hover { background: var(--field); color: var(--text); transform: none; }
.icon-btn-top:active { background: var(--border); transform: scale(0.95); }

.top-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: none;
  min-width: auto;
  padding: 0;
}

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

/* ── Content Area ───────────────────────────────────────────── */
#content-area {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 8px);
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s var(--ease-premium), transform 0.28s var(--ease-premium);
}

.tab-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.tab-view::-webkit-scrollbar { display: none; }

/* ── Bottom Navigation ──────────────────────────────────────── */
.bottom-nav {
  flex-shrink: 0;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  padding-bottom: var(--safe-bottom);
  padding-left: 4px;
  padding-right: 4px;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  transition: var(--trans);
  position: relative;
  min-height: 48px;
  background: none;
  border: none;
  box-shadow: none;
}

.nav-item:active { transform: scale(0.92); }

.nav-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--muted);
  transition: var(--trans);
  position: relative;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  transition: var(--trans);
  white-space: nowrap;
}

.nav-item.active .nav-icon {
  color: var(--primary);
  transform: scale(1.1);
}

.nav-item.active .nav-label { color: var(--primary); }

.nav-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  display: none;
}

.nav-badge.visible { display: flex; }

/* ── Toast / Snackbar ───────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: toastIn 0.3s var(--ease-premium) forwards;
  width: 100%;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.out { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ── Banner de Instalação PWA ───────────────────────────────── */
#pwa-install-banner {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
  left: 12px;
  right: 12px;
  background: var(--primary-grad);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: none;
  align-items: center;
  gap: 14px;
  z-index: 200;
  box-shadow: 0 8px 32px var(--primary-shadow);
  animation: slideUp 0.4s var(--ease-premium) forwards;
}

#pwa-install-banner.show { display: flex; }

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

#pwa-install-banner i { font-size: 28px; flex-shrink: 0; }

#pwa-install-banner .banner-text { flex: 1; }
#pwa-install-banner .banner-text strong { display: block; font-size: 14px; font-weight: 700; }
#pwa-install-banner .banner-text span { font-size: 12px; opacity: 0.85; }

.banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-banner-install {
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  min-height: auto;
}

.btn-banner-dismiss {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: none;
  min-height: auto;
}

/* ── Sections e Headers internos ────────────────────────────── */
.page-header {
  padding: 16px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.page-header p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.search-bar {
  margin: 0 16px 12px;
  position: relative;
}

.search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: var(--trans);
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* ── CHAT ───────────────────────────────────────────────────── */
#chat-view { padding: 0; }

/* Lista de conversas */
.chat-list-header {
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-list-header h2 { font-size: 22px; font-weight: 800; }

.chat-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border);
  position: relative;
  min-height: 72px;
}

.chat-contact-item:active { background: var(--field); }
.chat-contact-item.active { background: var(--primary-alpha); }

.chat-avatar-wrap { position: relative; flex-shrink: 0; }

.chat-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #fff;
}

.chat-info { flex: 1; min-width: 0; }

.chat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-preview {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }

.chat-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

.chat-unread {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Tela de mensagens (full-screen, empilhada sobre a lista) */
#chat-messages-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s var(--ease-premium);
}

#chat-messages-screen.open {
  transform: translateX(0);
}

.chat-screen-header {
  flex-shrink: 0;
  height: 60px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top, 0);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  min-width: auto;
  padding: 0;
}

.chat-screen-header .chat-avatar { width: 38px; height: 38px; font-size: 13px; }

.chat-screen-header-info { flex: 1; min-width: 0; }
.chat-screen-header-info .chat-name { font-size: 15px; }
.chat-screen-header-info .status-label { font-size: 12px; color: var(--success); font-weight: 500; }

.chat-messages-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}

.chat-messages-body::-webkit-scrollbar { display: none; }

/* Balões de mensagem */
.msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 100%;
}

.msg-row.sent { flex-direction: row-reverse; }

.msg-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-alpha);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  align-self: flex-end;
}

.msg-mini-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.msg-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 72vw;
  align-items: flex-start;
}

.msg-row.sent .msg-col { align-items: flex-end; }

.msg-sender { font-size: 11px; font-weight: 600; color: var(--primary); margin-bottom: 2px; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}

.msg-row.received .msg-bubble {
  background: #fff;
  color: var(--text);
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.msg-row.sent .msg-bubble {
  background: var(--primary-grad);
  color: #fff;
  border-radius: 18px 4px 18px 18px;
  box-shadow: 0 2px 8px var(--primary-shadow);
}

.msg-bubble.deleted {
  background: var(--field) !important;
  color: var(--muted) !important;
  font-style: italic;
  box-shadow: none;
}

.msg-bubble p { margin: 0; }
.msg-bubble strong { font-weight: 700; }
.msg-bubble em { font-style: italic; }
.msg-bubble code {
  background: rgba(0,0,0,0.1);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

.msg-row.sent .msg-bubble code { background: rgba(255,255,255,0.2); }

.msg-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.msg-checks { color: var(--muted); }
.msg-checks.read { color: #3b82f6; }

/* Input de mensagem */
.chat-input-bar {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  padding-bottom: calc(10px + var(--safe-bottom));
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-input-bar textarea {
  flex: 1;
  background: var(--field);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 10px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.4;
  transition: var(--trans);
  overflow-y: auto;
}

.chat-input-bar textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-grad);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-shadow);
  transition: var(--trans);
  min-width: auto;
  padding: 0;
}

.chat-send-btn:active { transform: scale(0.92); }

/* Msg long press menu */
.msg-menu {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 10;
  overflow: hidden;
  display: none;
}
.msg-menu.show { display: block; }
.msg-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--danger);
  background: none;
  border: none;
  width: 100%;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
}

/* ── KANBAN MOBILE (lista por coluna) ───────────────────────── */
#kanban-view { padding: 0 0 8px; }

.kanban-col-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 12px 16px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.kanban-col-tabs::-webkit-scrollbar { display: none; }

.col-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--trans);
  box-shadow: none;
  min-height: auto;
}

.col-tab.active {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px var(--primary-shadow);
}

.col-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.1);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  margin-left: 5px;
}

.col-tab.active .col-tab-badge { background: rgba(255,255,255,0.25); }

.kanban-cards-list { padding: 12px 16px 0; }

.kanban-card-mobile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  cursor: pointer;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
}

.kanban-card-mobile:active { transform: scale(0.98); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.kanban-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--primary-grad);
}

.kanban-card-accent.danger { background: linear-gradient(180deg, var(--danger), #f97316); }
.kanban-card-accent.warning { background: linear-gradient(180deg, var(--warning), #fcd34d); }
.kanban-card-accent.success { background: linear-gradient(180deg, var(--success), #34d399); }
.kanban-card-accent.purple { background: linear-gradient(180deg, var(--purple), #a78bfa); }

.kanban-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }

.kanban-card-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }

.kanban-card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-primary { background: var(--primary-alpha); color: var(--primary); }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #ffedd5; color: #c2410c; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-gray { background: var(--field); color: var(--muted); }

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.kanban-card-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-alpha);
  color: var(--primary);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.kanban-card-date { font-size: 11px; color: var(--muted); }

/* ── DRAWER de Detalhes do Card ─────────────────────────────── */
#card-drawer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#card-drawer.open { pointer-events: all; }

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.32s var(--ease-premium);
}

#card-drawer.open .drawer-backdrop { background: rgba(0,0,0,0.4); }

.drawer-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(16px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.38s var(--ease-premium);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
}

.drawer-sheet::-webkit-scrollbar { display: none; }
#card-drawer.open .drawer-sheet { transform: translateY(0); }

.drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin: 12px auto 16px;
}

.drawer-header {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h3 { font-size: 18px; font-weight: 700; }

.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--field);
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  min-width: auto;
  padding: 0;
}

.drawer-body { padding: 16px 20px; }

.drawer-field { margin-bottom: 16px; }

.drawer-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  display: block;
}

.drawer-field .field-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.drawer-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── CLIENTES ───────────────────────────────────────────────── */
#clientes-view { padding: 0; }

.cliente-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 16px 10px;
  cursor: pointer;
  transition: var(--trans);
  display: flex;
  align-items: center;
  gap: 14px;
}

.cliente-card:active { transform: scale(0.98); }

.cliente-initials {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary-grad);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cliente-info { flex: 1; min-width: 0; }
.cliente-name { font-size: 15px; font-weight: 600; color: var(--text); }
.cliente-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── CURSOS ─────────────────────────────────────────────────── */
#cursos-view { padding: 0; }

.curso-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 0 16px 10px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--trans);
}
.curso-card:active { transform: scale(0.98); }

.curso-card-body { padding: 16px; }
.curso-card-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.curso-card-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }
.curso-card-footer {
  padding: 10px 16px;
  background: var(--field);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.curso-lessons { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ── PERFIL ─────────────────────────────────────────────────── */
#perfil-view { padding: 0; }

.perfil-header {
  background: var(--primary-grad);
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.perfil-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.5);
}
.perfil-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.perfil-name { font-size: 20px; font-weight: 700; color: #fff; }
.perfil-role { font-size: 13px; color: rgba(255,255,255,0.8); font-weight: 500; }

.perfil-cards {
  margin: -48px 16px 0;
  position: relative;
}

.perfil-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.perfil-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.perfil-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.perfil-row:last-child { border-bottom: none; }

.perfil-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.perfil-row-label i { color: var(--primary); width: 18px; text-align: center; }

.perfil-row-val { font-size: 13px; color: var(--muted); }

.btn-logout {
  width: calc(100% - 32px);
  margin: 4px 16px 24px;
  padding: 15px;
  background: #fef2f2;
  color: var(--danger);
  border: 1.5px solid #fecaca;
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--trans);
  box-shadow: none;
  min-height: auto;
}
.btn-logout:active { background: var(--danger); color: #fff; }

/* ── Notificação de permissão iOS ──────────────────────────── */
#ios-notification-guide {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 var(--safe-bottom);
}
#ios-notification-guide.show { display: flex; }

.ios-guide-sheet {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 28px 24px;
  width: 100%;
}

.ios-guide-sheet h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.ios-guide-sheet p { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }

.ios-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.ios-step { display: flex; align-items: center; gap: 12px; }
.ios-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ios-step-text { font-size: 14px; color: var(--text); font-weight: 500; }

/* ── Empty States ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  text-align: center;
  gap: 12px;
}

.empty-state i { font-size: 48px; color: var(--border); }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text); }
.empty-state p { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ── Utilitários ────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── btn-secondary ──────────────────────────────────────────── */
.btn-secondary {
  width: 100%;
  padding: 14px;
  background: var(--field);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-secondary:active { background: var(--border); transform: scale(0.98); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Pipeline Selector (Kanban) ─────────────────────────────── */
.pipeline-selector {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pipeline-selector::-webkit-scrollbar { display: none; }

.pipeline-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--trans);
  box-shadow: none;
  min-height: auto;
}
.pipeline-btn:active { transform: scale(0.95); }
.pipeline-btn.active {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--primary-shadow);
}

/* ── Kanban — mini checklist badge no card ──────────────────── */
.kanban-checklist-mini {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Drawer — Accordion Sections ────────────────────────────── */
.drawer-accordion {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
}

.drawer-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--field);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.drawer-accordion-header:active { background: var(--border); }

.drawer-accordion-chevron {
  color: var(--muted);
  font-size: 13px;
  transition: transform 0.28s var(--ease-premium);
  transform: rotate(-90deg);
}

.drawer-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-premium);
  padding: 0 16px;
}

.drawer-accordion.open .drawer-accordion-chevron {
  transform: rotate(0deg);
}

.drawer-accordion.open .drawer-accordion-body {
  max-height: 800px;
  padding: 12px 16px 16px;
}

/* ── Drawer — Link ───────────────────────────────────────────── */
.drawer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 12px;
  background: var(--primary-alpha);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

/* ── Drawer — Checklist Interativo ──────────────────────────── */
.drawer-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.drawer-checklist-item:last-child { border-bottom: none; }
.drawer-checklist-item:active { opacity: 0.7; }

.drawer-check-box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: var(--trans);
}
.drawer-check-box.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* ── Progress Bar (Cursos) ──────────────────────────────────── */
.progress {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary-grad);
  border-radius: 999px;
  transition: width 0.6s var(--ease-premium);
}

/* ── Cursos — Módulos e Aulas ───────────────────────────────── */
.curso-modulo {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
}

.curso-modulo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--field);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.curso-modulo-header:active { background: var(--border); }

.curso-modulo-chevron {
  color: var(--muted);
  font-size: 13px;
  transition: transform 0.28s var(--ease-premium);
  transform: rotate(-90deg);
}

.curso-modulo-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-premium);
}

.curso-modulo-body.open {
  max-height: 1000px;
}

.curso-aula-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.curso-aula-item:last-child { border-bottom: none; }
.curso-aula-item:active { background: var(--field); }

.curso-aula-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: var(--trans);
}
.curso-aula-check.done {
  background: var(--success);
  border-color: var(--success);
}

/* ── Modal de Permissão de Notificação ──────────────────────── */
#modal-notif-permission {
  opacity: 0;
  transition: opacity 0.3s var(--ease-premium);
}
#modal-notif-permission.visible {
  opacity: 1;
}

/* ── Perfil — card do App install ──────────────────────────── */
#perfil-card-install { display: none; }
#perfil-card-install.show { display: block; }

