/* ============================================================
   PH3A CRM - Custom Stylesheet
   Digital Marketing Agency CRM
   ============================================================ */

:root {
  /* ── Cores Oficiais PH3A ── */
  --ph3a-primary:       #FF511B;   /* laranja PH3A */
  --ph3a-primary-light: #FF7043;
  --ph3a-primary-dark:  #D93E10;
  --ph3a-accent:        #051F4E;   /* azul navy PH3A */
  --ph3a-accent-light:  #0A2D6E;
  --ph3a-accent-dark:   #02132E;

  /* ── Sidebar (navy) ── */
  --ph3a-sidebar-bg:     #051F4E;
  --ph3a-sidebar-hover:  #0A2D6E;
  --ph3a-sidebar-active: #0D3580;

  /* ── Layout ── */
  --ph3a-bg:         #F5F6FA;
  --ph3a-white:      #ffffff;
  --ph3a-text:       #4b4b4b;
  --ph3a-text-light: #7a7a8c;
  --ph3a-border:     #e9eaec;

  /* ── Status ── */
  --ph3a-success: #10b981;
  --ph3a-warning: #f59e0b;
  --ph3a-danger:  #ef4444;
  --ph3a-info:    #3b82f6;

  --sidebar-width:  260px;
  --topbar-height:  64px;
  --transition:     0.25s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--ph3a-bg);
  color: var(--ph3a-text);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

a {
  color: var(--ph3a-primary);
  text-decoration: none;
}

a:hover {
  color: var(--ph3a-accent);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.ph3a-wrapper {
  display: flex;
  min-height: 100vh;
}

.ph3a-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.ph3a-content {
  flex: 1;
  padding: 28px 32px;
  margin-top: var(--topbar-height);
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.ph3a-sidebar {
  width: var(--sidebar-width);
  background: var(--ph3a-sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
  transition: transform var(--transition);
}

.ph3a-sidebar::-webkit-scrollbar {
  width: 4px;
}

.ph3a-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.ph3a-sidebar::-webkit-scrollbar-thumb {
  background-color: #334155;
  border-radius: 2px;
}

/* Logo area */
.sidebar-logo {
  padding: 0 0 0 15px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--ph3a-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
  letter-spacing: -1px;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-text .brand {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: 1px;
}

.sidebar-logo-text .tagline {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Nav section label */
.nav-section-label {
  padding: 20px 24px 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #FF511B;
}

/* Nav items */
.ph3a-nav {
  flex: 1;
  padding: 8px 0;
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item-link:hover {
  background: var(--ph3a-sidebar-hover);
  color: #e2e8f0;
  text-decoration: none;
}

.nav-item-link.active {
  background: var(--ph3a-primary);
  color: #ffffff;
}

.nav-item-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ph3a-accent);
  border-radius: 0 2px 2px 0;
}

.nav-item-link .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* ── Nav dropdown (submenu na sidebar) ───────────────────────── */
.nav-dropdown { position: relative; }

.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  background: rgba(0,0,0,.18);
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px 9px 44px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--ph3a-sidebar-hover); color: #e2e8f0; }
.nav-dropdown-menu a.active { color: #fff; background: var(--ph3a-primary); }
.nav-dropdown-menu a.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  top: 0; bottom: 0;
  background: var(--ph3a-accent);
  border-radius: 0 2px 2px 0;
}

.nav-dropdown-toggle .nav-chevron {
  margin-left: auto;
  font-size: 11px;
  transition: transform .2s;
}
.nav-dropdown.open .nav-chevron { transform: rotate(180deg); }

.nav-item-link .nav-badge {
  margin-left: auto;
  background: var(--ph3a-accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  line-height: 1.4;
}

/* ── Sub-menu ─────────────────────────────────────────────────────────────── */
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: all var(--transition);
  user-select: none;
}
.nav-group-toggle:hover { background: var(--ph3a-sidebar-hover); color: #e2e8f0; }
.nav-group-toggle .nav-chevron {
  margin-left: auto;
  font-size: 11px;
  transition: transform .2s ease;
  color: #64748b;
}
.nav-group-toggle.open .nav-chevron { transform: rotate(90deg); }
.nav-sub-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}
.nav-sub-items.open { max-height: 500px; }

/* ── Sub-sub-menu (3º nível: ex: E-mail Marketing) ───────────────────────── */
.nav-sub-group-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 36px;
  font-size: 12px; font-weight: 600; color: #94a3b8;
  cursor: pointer; border-radius: 8px; user-select: none;
  transition: all var(--transition); position: relative;
}
.nav-sub-group-toggle:hover { background: var(--ph3a-sidebar-hover); color: #e2e8f0; }
.nav-sub-group-toggle.open  { color: #cbd5e1; }
.nav-sub-chevron { margin-left: auto; font-size: 10px; color: #64748b; transition: transform .2s ease; }
.nav-sub-group-toggle.open .nav-sub-chevron { transform: rotate(90deg); }
.nav-sub-sub-items { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.nav-sub-sub-items.open { max-height: 300px; }
.nav-sub-sub-link {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 52px;
  font-size: 11.5px; font-weight: 500; color: #64748b;
  border-radius: 8px; text-decoration: none; transition: all var(--transition);
}
.nav-sub-sub-link:hover { background: var(--ph3a-sidebar-hover); color: #e2e8f0; text-decoration: none; }
.nav-sub-sub-link.active { color: #fff; background: rgba(255,255,255,.06); }
.nav-sub-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px 9px 52px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.nav-sub-link::before {
  content: '';
  position: absolute;
  left: 34px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #475569;
  transition: background var(--transition);
}
.nav-sub-link:hover { background: var(--ph3a-sidebar-hover); color: #e2e8f0; text-decoration: none; }
.nav-sub-link:hover::before, .nav-sub-link.active::before { background: var(--ph3a-accent); }
.nav-sub-link.active { color: #fff; background: rgba(255,255,255,.06); }

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ph3a-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.2;
}

.sidebar-user-info .user-role {
  font-size: 11px;
  color: #64748b;
  line-height: 1.2;
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */

.ph3a-topbar {
  height: var(--topbar-height);
  background: var(--ph3a-white);
  border-bottom: 1px solid var(--ph3a-border);
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  transition: left var(--transition);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ph3a-text);
  flex: 1;
}

.topbar-title .breadcrumb-sep {
  color: var(--ph3a-text-light);
  margin: 0 6px;
  font-weight: 400;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--ph3a-border);
  background: transparent;
  color: var(--ph3a-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.topbar-btn:hover {
  background: var(--ph3a-bg);
  color: var(--ph3a-text);
}

.topbar-btn .notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--ph3a-accent);
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.topbar-user:hover {
  background: var(--ph3a-bg);
  border-color: var(--ph3a-border);
}

.topbar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ph3a-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.topbar-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ph3a-text);
}

/* ============================================================
   METRIC CARDS
   ============================================================ */

.metric-card {
  background: var(--ph3a-white);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--ph3a-border);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-color, var(--ph3a-primary));
  border-radius: 0 0 16px 16px;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.metric-card .card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  background: var(--card-icon-bg, rgba(26,35,126,0.1));
  color: var(--card-color, var(--ph3a-primary));
}

.metric-card .metric-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--ph3a-text);
  line-height: 1;
  margin-bottom: 6px;
}

.metric-card .metric-label {
  font-size: 13px;
  color: var(--ph3a-text-light);
  font-weight: 500;
}

.metric-card .metric-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 10px;
  font-weight: 600;
}

.metric-trend.up { color: var(--ph3a-success); }
.metric-trend.down { color: var(--ph3a-danger); }
.metric-trend.neutral { color: var(--ph3a-text-light); }

/* ============================================================
   CHART CARDS
   ============================================================ */

.chart-card {
  background: var(--ph3a-white);
  border-radius: 16px;
  border: 1px solid var(--ph3a-border);
  padding: 24px;
  height: 100%;
}

.chart-card .chart-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ph3a-text);
  margin-bottom: 4px;
}

.chart-card .chart-subtitle {
  font-size: 12px;
  color: var(--ph3a-text-light);
  margin-bottom: 20px;
}

.chart-wrapper {
  position: relative;
  height: 260px;
}

/* ============================================================
   DATA TABLE
   ============================================================ */

.ph3a-table-card {
  background: var(--ph3a-white);
  border-radius: 16px;
  border: 1px solid var(--ph3a-border);
  overflow: hidden;
}

.table-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--ph3a-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ph3a-text);
  margin: 0;
}

.ph3a-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ph3a-table thead th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ph3a-text-light);
  border-bottom: 1px solid var(--ph3a-border);
  white-space: nowrap;
}

.ph3a-table tbody tr {
  border-bottom: 1px solid var(--ph3a-border);
  transition: background var(--transition);
}

.ph3a-table tbody tr:last-child {
  border-bottom: none;
}

.ph3a-table tbody tr:hover {
  background: #f8fafc;
}

.ph3a-table td {
  padding: 13px 16px;
  vertical-align: middle;
  color: var(--ph3a-text);
}

.ph3a-table td .text-muted-sm {
  font-size: 12px;
  color: var(--ph3a-text-light);
  display: block;
  margin-top: 2px;
}

/* ============================================================
   BADGES & STATUS
   ============================================================ */

.ph3a-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-primary { background: rgba(255,81,27,0.1);  color: var(--ph3a-primary); }
.badge-accent  { background: rgba(5,31,78,0.1);    color: var(--ph3a-accent); }
.badge-success { background: rgba(16,185,129,0.1); color: var(--ph3a-success); }
.badge-warning { background: rgba(245,158,11,0.1); color: var(--ph3a-warning); }
.badge-danger  { background: rgba(239,68,68,0.1);  color: var(--ph3a-danger); }
.badge-info    { background: rgba(59,130,246,0.1);  color: var(--ph3a-info); }
.badge-secondary { background: #f1f5f9; color: #64748b; }
.badge-orange  { background: rgba(255,107,0,0.1);  color: var(--ph3a-accent); }
.badge-purple  { background: rgba(168,85,247,0.1); color: #a855f7; }
.badge-teal    { background: rgba(20,184,166,0.1); color: #14b8a6; }

/* Lead source badges */
.source-google  { background: rgba(66,133,244,0.1); color: #4285F4; }
.source-meta    { background: rgba(24,119,242,0.1); color: #1877F2; }
.source-whatsapp{ background: rgba(37,211,102,0.1); color: #25D366; }
.source-form    { background: rgba(26,35,126,0.1);  color: var(--ph3a-primary); }
.source-organic { background: rgba(16,185,129,0.1); color: var(--ph3a-success); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-ph3a {
  background: var(--ph3a-primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ph3a:hover {
  background: var(--ph3a-primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,81,27,0.35);
}

.btn-accent {
  background: var(--ph3a-accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-accent:hover {
  background: var(--ph3a-accent-light);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(5,31,78,0.35);
}

.btn-outline-ph3a {
  background: transparent;
  color: var(--ph3a-primary);
  border: 1.5px solid var(--ph3a-primary);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline-ph3a:hover {
  background: var(--ph3a-primary);
  color: white;
}

.btn-link-ph3a {
  background: none;
  border: none;
  color: var(--ph3a-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity var(--transition);
}
.btn-link-ph3a:hover { opacity: 0.75; }

/* ============================================================
   FORMS
   ============================================================ */

.ph3a-form-card {
  background: var(--ph3a-white);
  border-radius: 16px;
  border: 1px solid var(--ph3a-border);
  padding: 32px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ph3a-text);
  margin-bottom: 6px;
}

.form-control, .form-select {
  border: 1.5px solid var(--ph3a-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ph3a-text);
  background: var(--ph3a-white);
  transition: all var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--ph3a-primary);
  box-shadow: 0 0 0 3px rgba(255,81,27,0.12);
  outline: none;
}

.form-control::placeholder {
  color: #94a3b8;
  font-size: 13px;
}

.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ph3a-primary);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ph3a-border);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--ph3a-text);
  margin: 0;
}

.page-header .page-subtitle {
  font-size: 13px;
  color: var(--ph3a-text-light);
  margin-top: 4px;
}

/* ============================================================
   SEARCH & FILTERS
   ============================================================ */

.search-bar {
  position: relative;
}

.search-bar input {
  padding-left: 40px;
  background: var(--ph3a-white);
}

.search-bar .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ph3a-text-light);
  font-size: 14px;
}

/* ============================================================
   KANBAN BOARD
   ============================================================ */

.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 200px);
}

.kanban-board::-webkit-scrollbar {
  height: 6px;
}

.kanban-board::-webkit-scrollbar-track {
  background: var(--ph3a-border);
  border-radius: 3px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 3px;
}

.kanban-column {
  min-width: 280px;
  width: 280px;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid var(--ph3a-border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}

.kanban-column-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ph3a-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-radius: 14px 14px 0 0;
  z-index: 1;
}

.kanban-column-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ph3a-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count {
  background: var(--ph3a-border);
  color: var(--ph3a-text-light);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  background: var(--ph3a-white);
  border-radius: 12px;
  border: 1px solid var(--ph3a-border);
  padding: 14px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
}

.kanban-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ph3a-text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.kanban-card-contact {
  font-size: 12px;
  color: var(--ph3a-text-light);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.kanban-card-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--ph3a-accent);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ph3a-border);
}

/* ============================================================
   CONTACT / ACCOUNT DETAIL CARDS
   ============================================================ */

.detail-hero {
  background: linear-gradient(135deg, var(--ph3a-accent) 0%, var(--ph3a-accent-light) 100%);
  border-radius: 16px;
  padding: 32px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.detail-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.detail-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 80px;
  width: 140px;
  height: 140px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
}

.detail-name {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.detail-meta {
  font-size: 14px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-section {
  background: var(--ph3a-white);
  border-radius: 16px;
  border: 1px solid var(--ph3a-border);
  padding: 24px;
  margin-bottom: 20px;
}

.detail-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ph3a-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ph3a-border);
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.detail-field:last-child {
  margin-bottom: 0;
}

.detail-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ph3a-text-light);
}

.detail-field-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--ph3a-text);
}

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */

.flash-container {
  padding: 0 32px;
  margin-top: 80px;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9999;
  width: 380px;
  pointer-events: none;
}

.flash-container .alert {
  pointer-events: all;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 18px;
  margin-bottom: 10px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   AVATAR INITIAL
   ============================================================ */

.avatar-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ph3a-primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.ph3a-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px;
  border-top: 1px solid var(--ph3a-border);
}

.page-link {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ph3a-text-light);
  border: 1px solid var(--ph3a-border);
  background: white;
  transition: all var(--transition);
}

.page-link:hover {
  background: var(--ph3a-bg);
  color: var(--ph3a-text);
  border-color: var(--ph3a-primary);
}

.page-item.active .page-link {
  background: var(--ph3a-primary);
  color: white;
  border-color: var(--ph3a-primary);
}

.page-item.disabled .page-link {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--ph3a-border);
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ph3a-text);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--ph3a-text-light);
  max-width: 320px;
  margin: 0 auto 24px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--ph3a-accent-dark) 0%, var(--ph3a-accent) 50%, var(--ph3a-accent-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: rgba(255,81,27,0.12);
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -80px;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.login-card {
  background: white;
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 72px;
  height: 72px;
  background: var(--ph3a-primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  font-weight: 900;
  color: white;
  letter-spacing: -2px;
  position: relative;
}

.login-logo .logo-icon::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--ph3a-accent);
  border-radius: 6px;
  border: 3px solid white;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--ph3a-accent);
  letter-spacing: 2px;
  margin: 0;
}

.login-logo p {
  font-size: 13px;
  color: var(--ph3a-text-light);
  margin: 4px 0 0;
}

.login-form-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ph3a-text);
  margin-bottom: 6px;
}

.login-form-subtitle {
  font-size: 14px;
  color: var(--ph3a-text-light);
  margin-bottom: 28px;
}

/* ============================================================
   UTILITIES
   ============================================================ */

.text-accent { color: var(--ph3a-accent) !important; }
.text-primary-ph3a { color: var(--ph3a-primary) !important; }
.bg-ph3a { background-color: var(--ph3a-primary) !important; }
.bg-accent { background-color: var(--ph3a-accent) !important; }

.font-weight-800 { font-weight: 800 !important; }

.border-radius-12 { border-radius: 12px !important; }
.border-radius-16 { border-radius: 16px !important; }

.shadow-card { box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important; }

.divider {
  height: 1px;
  background: var(--ph3a-border);
  margin: 20px 0;
}

/* ============================================================
   RESPONSIVE — MOBILE / TABLET (iOS & Android)
   ============================================================ */

/* ── Touch & iOS baseline ──────────────────────────────────── */
*,
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
[role="button"],
.btn,
.btn-ph3a,
.btn-accent,
.btn-outline-ph3a,
.nav-item-link,
.topbar-btn {
  touch-action: manipulation; /* elimina delay de 300ms em iOS */
}

/* Garante tamanho mínimo de toque (44px) nos botões */
.btn-ph3a,
.btn-accent,
.btn-outline-ph3a,
.btn-primary,
.btn-secondary,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  min-height: 40px;
}

/* Evita zoom automático no iOS ao focar inputs (precisa de 16px) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="date"],
select,
textarea {
  font-size: 16px !important;
}

/* Exceção: labels e textos menores em campos pequenos ficam menores visualmente */
.form-control-sm,
.form-select-sm {
  font-size: 15px !important;
}

/* ── Tablet (≤ 991px) ──────────────────────────────────────── */
@media (max-width: 991.98px) {
  /* Sidebar desliza para fora por padrão */
  .ph3a-sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }
  .ph3a-sidebar.open {
    transform: translateX(0);
  }

  /* Main e topbar ocupam toda a largura */
  .ph3a-main   { margin-left: 0; }
  .ph3a-topbar { left: 0; padding: 0 16px; }

  /* Conteúdo com menos padding */
  .ph3a-content { padding: 20px 16px; }

  /* Kanban sem altura fixa */
  .kanban-board  { min-height: auto; }
  .kanban-column { max-height: none; }

  /* Título da topbar: compacto em tablet, oculto em mobile */
  .topbar-title { font-size: 15px; }

  /* Empurra ações para o lado direito quando o título some */
  .topbar-actions { margin-left: auto; }

  /* Botão toggle visível */
  .sidebar-toggle { display: flex; }

  /* Tabelas: overflow horizontal automático */
  .ph3a-table-card > .table-responsive,
  .ph3a-table-card > table,
  .ph3a-table-card .table-responsive,
  .ph3a-table-card table:not(.no-responsive) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    width: 100%;
  }
}

/* ── Mobile (≤ 767px) ──────────────────────────────────────── */
@media (max-width: 767.98px) {
  /* Menos padding no conteúdo principal */
  .ph3a-content {
    padding: 16px 12px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  /* Page header: empilha título e ações */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }
  .page-header h1  { font-size: 20px; }
  .page-header > *:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  /* Botões de ação no header viram largura total em telas muito pequenas */
  .page-header .btn-accent,
  .page-header .btn-ph3a,
  .page-header .btn-outline-ph3a,
  .page-header .btn-primary,
  .page-header .btn-outline-secondary {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 120px;
  }

  /* Cards: padding reduzido */
  .ph3a-table-card  { border-radius: 12px; }
  .ph3a-form-card   { padding: 18px 16px; border-radius: 12px; }
  .detail-section   { padding: 16px; border-radius: 12px; }
  .metric-card      { padding: 16px; border-radius: 12px; }
  .chart-card       { padding: 16px; border-radius: 12px; }

  /* Table card header: empilha filtros e título */
  .table-card-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 10px;
  }
  .table-card-header > * { width: 100%; }

  /* Metric cards: números menores */
  .metric-card .metric-value { font-size: 26px; }
  .metric-card .card-icon    { width: 44px; height: 44px; font-size: 18px; }

  /* Detail hero: padding reduzido */
  .detail-hero   { padding: 20px 18px; border-radius: 12px; }
  .detail-name   { font-size: 20px; }
  .detail-avatar { width: 60px; height: 60px; font-size: 22px; }

  /* Flash messages */
  .flash-container {
    width: calc(100vw - 24px);
    right: 12px;
    padding: 0;
    margin-top: 68px;
  }

  /* Topbar */
  .ph3a-topbar { padding: 0 12px; }
  .topbar-title { display: none; }
  .topbar-user-name { display: none; }

  /* Formulários */
  .form-section-title { font-size: 13px; }

  /* Kanban mobile: scroll horizontal fluido */
  .kanban-board {
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-column {
    min-width: 260px;
    width: 260px;
    scroll-snap-align: start;
  }

  /* Back link */
  .back-link { font-size: 13px; }

  /* Grids com 2+ colunas colapsam para 1 coluna */
  .row.g-4 > .col-lg-8,
  .row.g-4 > .col-lg-4,
  .row.g-4 > .col-lg-6,
  .row.g-4 > .col-lg-3,
  .row.g-4 > .col-lg-9 {
    width: 100%;
  }

  /* Tags/badges em listas: wrap suave */
  .ph3a-badge,
  .badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Botões de ação inline (editar/excluir) */
  .btn-sm { min-height: 36px; padding: 5px 10px; }
}

/* ── Mobile pequeno (≤ 480px) ──────────────────────────────── */
@media (max-width: 480px) {
  .ph3a-content { padding: 12px 10px; }

  .page-header h1 { font-size: 18px; }

  /* Topbar: menos padding */
  .ph3a-topbar { padding: 0 10px; gap: 8px; }

  /* Formulários full-width */
  .col-sm-6,
  .col-md-6,
  .col-lg-6 { width: 100% !important; }

  /* Tabela: fonte menor para caber */
  .ph3a-table      { font-size: 12px; }
  .ph3a-table td,
  .ph3a-table th   { padding: 10px 10px; }

  /* Kanban mais estreito */
  .kanban-column { min-width: 240px; width: 240px; }

  /* Badges ainda menores */
  .ph3a-badge { font-size: 9px; padding: 2px 6px; }
}

/* ── Safe Area (notch iOS / barra Android) ──────────────────── */
@supports (padding: max(0px)) {
  .ph3a-sidebar {
    padding-top: max(0px, env(safe-area-inset-top));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
  .ph3a-topbar {
    padding-top: max(0px, env(safe-area-inset-top));
    height: calc(var(--topbar-height) + max(0px, env(safe-area-inset-top)));
  }
  .ph3a-content {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================================
   TOGGLE BUTTON (mobile)
   ============================================================ */

.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--ph3a-border);
  background: transparent;
  color: var(--ph3a-text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 991.98px) {
  .sidebar-toggle {
    display: flex;
  }
}

/* ============================================================
   DEAL STAGE COLORS ON KANBAN
   ============================================================ */

.stage-novo_lead .kanban-column-header         { border-top: 3px solid var(--ph3a-info); }
.stage-contato_realizado .kanban-column-header { border-top: 3px solid #8b5cf6; }
.stage-proposta_enviada .kanban-column-header  { border-top: 3px solid var(--ph3a-warning); }
.stage-negociacao .kanban-column-header        { border-top: 3px solid var(--ph3a-accent); }
.stage-fechado_ganho .kanban-column-header     { border-top: 3px solid var(--ph3a-success); }
.stage-fechado_perdido .kanban-column-header   { border-top: 3px solid var(--ph3a-danger); }
/* Estágios reais do modelo */
.stage-prospeccao .kanban-column-header  { border-top: 3px solid var(--ph3a-info); }
.stage-qualificacao .kanban-column-header { border-top: 3px solid #8b5cf6; }
.stage-proposta .kanban-column-header    { border-top: 3px solid var(--ph3a-warning); }
.stage-negociacao .kanban-column-header  { border-top: 3px solid var(--ph3a-accent); }
.stage-fechado .kanban-column-header     { border-top: 3px solid var(--ph3a-success); }
.stage-perdido .kanban-column-header     { border-top: 3px solid var(--ph3a-danger); }
/* Drop zone highlight */
.kanban-cards.drag-over { background: #f0f9ff; border: 2px dashed #7dd3fc; border-radius: 8px; }
/* Probabilidade bar */
.prob-bar { height: 3px; border-radius: 2px; background: #e2e8f0; margin-top: 6px; }
.prob-bar-fill { height: 100%; border-radius: 2px; transition: width .3s; }

/* ── PH3A Tables: colunas ordenáveis e arrastáveis ────────────── */
.ph3a-th-sortable {
  cursor: pointer;
  user-select: none;
}
.ph3a-th-sortable:hover {
  background: #f1f5f9;
}
.ph3a-sort-icon {
  display: inline-block;
  margin-left: 5px;
  color: #cbd5e1;
  font-size: 10px;
  vertical-align: middle;
  transition: color 0.15s;
}
.ph3a-sort-icon.active {
  color: var(--ph3a-accent);
}
.ph3a-th-sortable[draggable="true"] {
  cursor: grab;
}
.ph3a-th-sortable[draggable="true"]:active {
  cursor: grabbing;
}
.ph3a-th-dragging {
  opacity: 0.4;
}
.ph3a-th-dragover {
  background: #fff7ed !important;
  border-left: 2px solid var(--ph3a-accent) !important;
}

/* ============================================================
   BOOTSTRAP BUTTON OVERRIDES — Identidade Visual PH3A
   Substitui os cinzas genéricos do Bootstrap pelas cores
   oficiais PH3A (laranja #FF511B e navy #051F4E).
   ============================================================ */

/* ── btn-primary → Laranja PH3A ── */
.btn-primary {
  background-color: var(--ph3a-primary) !important;
  border-color:     var(--ph3a-primary) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
  background-color: var(--ph3a-primary-dark) !important;
  border-color:     var(--ph3a-primary-dark) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(255,81,27,.35) !important;
  transform: translateY(-1px);
}

/* ── btn-outline-primary → Outline laranja ── */
.btn-outline-primary {
  background-color: transparent !important;
  border-color: var(--ph3a-primary) !important;
  color: var(--ph3a-primary) !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--ph3a-primary) !important;
  border-color:     var(--ph3a-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(255,81,27,.3) !important;
  transform: translateY(-1px);
}

/* ── btn-secondary → Navy PH3A ── */
.btn-secondary {
  background-color: var(--ph3a-accent) !important;
  border-color:     var(--ph3a-accent) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-secondary.active {
  background-color: var(--ph3a-accent-light) !important;
  border-color:     var(--ph3a-accent-light) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(5,31,78,.3) !important;
  transform: translateY(-1px);
}

/* ── btn-outline-secondary → Outline navy ── */
.btn-outline-secondary {
  background-color: transparent !important;
  border-color: var(--ph3a-accent) !important;
  color: var(--ph3a-accent) !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background-color: var(--ph3a-accent) !important;
  border-color:     var(--ph3a-accent) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(5,31,78,.3) !important;
  transform: translateY(-1px);
}

/* ── btn-light → Branco com navy ── */
.btn-light {
  background-color: #fff !important;
  border-color: var(--ph3a-border, #e2e8f0) !important;
  color: var(--ph3a-accent) !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-light:hover,
.btn-light:focus,
.btn-light:active {
  background-color: #f1f5f9 !important;
  border-color: var(--ph3a-accent) !important;
  color: var(--ph3a-accent) !important;
  box-shadow: 0 2px 8px rgba(5,31,78,.15) !important;
}

/* ── btn-success → Verde (semântico) ── */
.btn-success {
  background-color: var(--ph3a-success, #10b981) !important;
  border-color:     var(--ph3a-success, #10b981) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active {
  background-color: #059669 !important;
  border-color:     #059669 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(16,185,129,.3) !important;
  transform: translateY(-1px);
}

/* ── btn-outline-success → Outline verde ── */
.btn-outline-success {
  background-color: transparent !important;
  border-color: var(--ph3a-success, #10b981) !important;
  color: var(--ph3a-success, #10b981) !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-outline-success:hover,
.btn-outline-success:focus {
  background-color: var(--ph3a-success, #10b981) !important;
  border-color:     var(--ph3a-success, #10b981) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(16,185,129,.3) !important;
  transform: translateY(-1px);
}

/* ── btn-danger → Vermelho (semântico) ── */
.btn-danger {
  background-color: var(--ph3a-danger, #ef4444) !important;
  border-color:     var(--ph3a-danger, #ef4444) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
  background-color: #dc2626 !important;
  border-color:     #dc2626 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(239,68,68,.3) !important;
  transform: translateY(-1px);
}

/* ── btn-outline-danger → Outline vermelho ── */
.btn-outline-danger {
  background-color: transparent !important;
  border-color: var(--ph3a-danger, #ef4444) !important;
  color: var(--ph3a-danger, #ef4444) !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background-color: var(--ph3a-danger, #ef4444) !important;
  border-color:     var(--ph3a-danger, #ef4444) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(239,68,68,.3) !important;
  transform: translateY(-1px);
}

/* ── btn-warning → Âmbar ── */
.btn-warning {
  background-color: var(--ph3a-warning, #f59e0b) !important;
  border-color:     var(--ph3a-warning, #f59e0b) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
  background-color: #d97706 !important;
  border-color:     #d97706 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(245,158,11,.3) !important;
  transform: translateY(-1px);
}

/* ── btn-info → Azul info ── */
.btn-info {
  background-color: var(--ph3a-info, #3b82f6) !important;
  border-color:     var(--ph3a-info, #3b82f6) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  transition: all .18s ease;
}
.btn-info:hover,
.btn-info:focus {
  background-color: #2563eb !important;
  border-color:     #2563eb !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(59,130,246,.3) !important;
  transform: translateY(-1px);
}

/* ── Tamanho btn-sm com border-radius menor ── */
.btn-sm {
  border-radius: 8px !important;
  font-size: 12px !important;
  padding: 5px 12px !important;
  font-weight: 600 !important;
}

/* ── Tamanho btn-lg ── */
.btn-lg {
  border-radius: 12px !important;
  font-size: 15px !important;
  padding: 12px 28px !important;
  font-weight: 700 !important;
}

/* ── btn-link (mantém semântica) ── */
.btn-link {
  color: var(--ph3a-primary) !important;
  font-weight: 600;
  text-decoration: none;
}
.btn-link:hover {
  color: var(--ph3a-primary-dark) !important;
  text-decoration: underline;
}

/* ── Focus ring PH3A ── */
.btn:focus-visible {
  outline: 2px solid var(--ph3a-primary) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

/* ── btn-outline: alias para btn-outline-ph3a (navy com borda) ── */
.btn-outline {
  background: transparent;
  color: var(--ph3a-accent);
  border: 1.5px solid var(--ph3a-accent);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-outline:hover {
  background: var(--ph3a-accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(5,31,78,.25);
}

/* ── Links "Voltar" texto (breadcrumb-style) → btn estilizado ── */
a.back-link,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ph3a-accent);
  background: transparent;
  border: 1.5px solid var(--ph3a-border, #e2e8f0);
  border-radius: 8px;
  padding: 6px 14px;
  text-decoration: none;
  transition: all .18s ease;
}
.back-link:hover {
  border-color: var(--ph3a-accent);
  color: var(--ph3a-accent);
  background: #f0f4ff;
  text-decoration: none;
}

/* ============================================================
   FORCE MOBILE VIEW — Phone Frame Preview
   Exibe um frame de celular centralizado na tela desktop.
   O trick: transform no ph3a-wrapper faz com que os filhos
   position:fixed sejam contidos dentro do frame.
   ============================================================ */

/* Fundo escuro atrás do frame */
body.ph3a-force-mobile {
  background: #0a1628 !important;
  overflow: hidden;
}

/* Label acima do frame */
body.ph3a-force-mobile #ph3aPhoneLabel {
  position: fixed;
  top: calc(50% - min(426px, 43vh) - 28px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

/* Wrapper vira o frame do celular */
body.ph3a-force-mobile .ph3a-wrapper {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  /* transform cria novo stacking context — fixed children ficam contidos aqui */
  transform: translate(-50%, -50%) !important;
  width: 393px !important;
  height: min(852px, 88vh) !important;
  min-height: unset !important;
  border-radius: 44px !important;
  overflow: hidden !important;
  /* Bezel: camadas de sombra simulam a moldura do celular */
  box-shadow:
    0 0 0 2px #1e2d4a,
    0 0 0 10px #162038,
    0 0 0 12px #1e2d4a,
    0 0 0 13px #253560,
    0 60px 130px rgba(0,0,0,0.9),
    inset 0 0 0 1px rgba(255,255,255,0.06) !important;
  z-index: 9000 !important;
}

/* Notch decoration */
body.ph3a-force-mobile .ph3a-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #0a1628;
  border-radius: 0 0 20px 20px;
  z-index: 9999;
  pointer-events: none;
}

/* Barra home (bottom) */
body.ph3a-force-mobile .ph3a-wrapper::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  z-index: 9999;
  pointer-events: none;
}

/* Sidebar: position:fixed fica relativo ao wrapper transformado */
body.ph3a-force-mobile .ph3a-sidebar {
  top: 0 !important;
  left: 0 !important;
  height: 100% !important;
  width: var(--sidebar-width) !important;
  transform: translateX(-100%);
  z-index: 1050;
}
body.ph3a-force-mobile .ph3a-sidebar.open {
  transform: translateX(0);
}

/* Main: sem margem da sidebar */
body.ph3a-force-mobile .ph3a-main {
  margin-left: 0 !important;
  min-height: unset !important;
  height: 100% !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Topbar: position:fixed fica relativo ao wrapper */
body.ph3a-force-mobile .ph3a-topbar {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  padding: 0 16px !important;
}

/* Conteúdo com scroll interno */
body.ph3a-force-mobile .ph3a-content {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 12px 32px !important;
  height: calc(100% - var(--topbar-height));
  margin-top: 0;
}

/* Topbar: esconde título, mostra toggle e ações */
body.ph3a-force-mobile .sidebar-toggle { display: flex !important; }
body.ph3a-force-mobile .topbar-title   { display: none !important; }
body.ph3a-force-mobile .topbar-actions { margin-left: auto !important; }

/* Page header empilhado */
body.ph3a-force-mobile .page-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* Cards com padding reduzido */
body.ph3a-force-mobile .metric-card { padding: 14px !important; }

/* Kanban com scroll horizontal */
body.ph3a-force-mobile .kanban-board {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  flex-wrap: nowrap !important;
}
body.ph3a-force-mobile .kanban-column {
  min-width: 260px !important;
  width: 260px !important;
  scroll-snap-align: start;
  max-height: none !important;
  flex-shrink: 0 !important;
}

/* Tabelas com scroll horizontal */
body.ph3a-force-mobile .ph3a-table-card > table,
body.ph3a-force-mobile .ph3a-table-card .table-responsive,
body.ph3a-force-mobile .ph3a-table-card > .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  width: 100%;
}
body.ph3a-force-mobile .ph3a-table    { font-size: 12px; }
body.ph3a-force-mobile .ph3a-table td,
body.ph3a-force-mobile .ph3a-table th { padding: 10px !important; }

/* Colunas Bootstrap colapsam para 100% */
body.ph3a-force-mobile .row > [class*="col-md-"],
body.ph3a-force-mobile .row > [class*="col-lg-"] {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}

/* Inputs sem zoom iOS */
body.ph3a-force-mobile input,
body.ph3a-force-mobile select,
body.ph3a-force-mobile textarea {
  font-size: 16px !important;
}


/* ============================================================
   HUBSPOT-INSPIRED REDESIGN v2  —  PH3A CRM
   Aplicado sobre o design system existente para elevar
   a UX/UI ao nível do HubSpot.
   ============================================================ */

/* ── 1. TOKENS REFINADOS ───────────────────────────────────── */
:root {
  --ph3a-bg:         #F5F8FA;   /* azul-cinza do HubSpot */
  --ph3a-text:       #2D3748;   /* texto mais escuro e legível */
  --ph3a-text-light: #718096;
  --ph3a-border:     #E2E8F0;   /* borda mais suave */
  --ph3a-shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --ph3a-shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --ph3a-shadow-lg:  0 10px 30px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.05);
  --ph3a-radius:     10px;
  --ph3a-radius-lg:  14px;
  --ph3a-radius-xl:  18px;
  --sidebar-width:   240px;  /* 20px mais estreito → mais conteúdo */
  --topbar-height:   56px;   /* 8px mais baixo → HubSpot pattern */
}

/* ── 2. TIPOGRAFIA BASE ─────────────────────────────────────── */
body {
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.025em;
}

/* ── 3. SIDEBAR — HubSpot Active State ─────────────────────── */
/* Active: barra laranja à esquerda + fundo levemente mais claro */
.nav-item-link.active {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
  font-weight: 700;
}
.nav-item-link.active::before {
  width: 3px;
  background: var(--ph3a-primary);
  border-radius: 0 3px 3px 0;
}
.nav-item-link:hover {
  background: rgba(255,255,255,0.05);
  color: #ffffff;
}
/* Nav section labels mais discretos */
.nav-section-label {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 18px 20px 4px;
}
/* Sidebar: itens mais compactos */
.nav-item-link {
  padding: 9px 20px;
  font-size: 13.5px;
}
.nav-icon { font-size: 14px; }

/* Botão colapsar sidebar (novo) */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: 11px;
  transition: all .2s;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 15px;
  min-height: var(--topbar-height);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Sidebar colapsada (ícones apenas) */
.ph3a-sidebar.collapsed {
  width: 60px;
}
.ph3a-sidebar.collapsed .nav-item-link span:not(.nav-icon),
.ph3a-sidebar.collapsed .nav-item-link .nav-chevron,
.ph3a-sidebar.collapsed .nav-section-label,
.ph3a-sidebar.collapsed .nav-group-toggle span:not(.nav-icon):not(.nav-chevron),
.ph3a-sidebar.collapsed .sidebar-logo-text,
.ph3a-sidebar.collapsed .sidebar-user-info,
.ph3a-sidebar.collapsed .nav-sub-items,
.ph3a-sidebar.collapsed .nav-dropdown-menu,
.ph3a-sidebar.collapsed #btnViewMode span,
.ph3a-sidebar.collapsed .sidebar-user .user-name,
.ph3a-sidebar.collapsed .sidebar-user .user-role {
  display: none;
}
.ph3a-sidebar.collapsed {
  overflow-x: hidden;
}
/* Esconde text nodes (ex.: "Dashboard" direto no <a>) e centraliza o ícone. */
.ph3a-sidebar.collapsed .nav-item-link,
.ph3a-sidebar.collapsed .nav-group-toggle {
  padding: 11px 0;
  gap: 0;
  justify-content: center;
  font-size: 0;
  white-space: nowrap;
}
/* Chevron do grupo também precisa sumir no colapsado. */
.ph3a-sidebar.collapsed .nav-chevron { display: none !important; }
.ph3a-sidebar.collapsed .nav-icon {
  width: auto;
  height: auto;
  font-size: 16px;
  margin: 0;
}
.ph3a-sidebar.collapsed .nav-item-link .nav-badge { display: none; }
/* Ícones extras nos links (ex.: "abrir em nova aba" do GitHub) também somem. */
.ph3a-sidebar.collapsed .nav-item-link > i:not(.nav-icon i):not(.nav-chevron) { display: none; }
/* Rodapé: centraliza avatar e esconde nome/perfil/botão sair/toggle view. */
.ph3a-sidebar.collapsed .sidebar-user { gap: 0; justify-content: center; }
.ph3a-sidebar.collapsed .sidebar-user > a,
.ph3a-sidebar.collapsed #btnViewMode { display: none; }
.ph3a-sidebar.collapsed .sidebar-user {
  justify-content: center;
}
.ph3a-sidebar.collapsed .sidebar-footer {
  padding: 12px 8px;
}
.ph3a-main.sidebar-collapsed {
  margin-left: 60px;
}
.ph3a-topbar.sidebar-collapsed {
  left: 60px;
}

/* ── 4. TOPBAR — Busca Global ────────────────────────────────── */
.ph3a-topbar {
  height: var(--topbar-height);
  padding: 0 24px;
  box-shadow: var(--ph3a-shadow-sm);
  border-bottom: 1px solid var(--ph3a-border);
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
}

/* Barra de busca global */
.topbar-search {
  flex: 1;
  max-width: 420px;
  margin: 0 24px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 38px;
  border: 1.5px solid var(--ph3a-border);
  border-radius: 8px;
  font-size: 13.5px;
  background: var(--ph3a-bg);
  color: var(--ph3a-text);
  transition: all .2s;
  outline: none;
}
.topbar-search input:focus {
  border-color: var(--ph3a-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,81,27,.10);
}
.topbar-search input::placeholder { color: #a0aec0; font-size: 13px; }
.topbar-search .ts-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  font-size: 13px;
  pointer-events: none;
}
.topbar-search .ts-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #a0aec0;
  background: var(--ph3a-border);
  border-radius: 4px;
  padding: 1px 5px;
}
.topbar-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 14px;
}

/* Resultados de busca global */
#globalSearchResults {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--ph3a-border);
  border-radius: 12px;
  box-shadow: var(--ph3a-shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
}
#globalSearchResults.visible { display: block; }
.gsr-section {
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ph3a-text-light);
  border-top: 1px solid var(--ph3a-border);
}
.gsr-section:first-child { border-top: none; }
.gsr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  color: var(--ph3a-text);
}
.gsr-item:hover { background: var(--ph3a-bg); }
.gsr-item .gsr-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.gsr-item .gsr-name { font-size: 13.5px; font-weight: 600; }
.gsr-item .gsr-sub  { font-size: 11.5px; color: var(--ph3a-text-light); }
.gsr-empty {
  padding: 20px;
  text-align: center;
  color: var(--ph3a-text-light);
  font-size: 13px;
}

/* ── 5. CARDS — Sombra Suave HubSpot ────────────────────────── */
.ph3a-form-card,
.ph3a-table-card,
.chart-card,
.detail-section,
.metric-card {
  border: 1px solid var(--ph3a-border);
  box-shadow: var(--ph3a-shadow-sm);
  border-radius: var(--ph3a-radius-lg);
}
.ph3a-form-card { padding: 24px; }
.metric-card:hover {
  box-shadow: var(--ph3a-shadow-md);
  transform: translateY(-2px);
}

/* ── 6. TABELA — Ações Inline no Hover ──────────────────────── */
.ph3a-table tbody tr {
  position: relative;
}
.ph3a-table tbody tr:hover { background: #F7FAFC; }

/* Container de ações inline */
.tr-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
}
.ph3a-table tbody tr:hover .tr-actions { opacity: 1; }

.tr-action-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--ph3a-border);
  background: #fff;
  color: var(--ph3a-text-light);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.tr-action-btn:hover {
  background: var(--ph3a-primary);
  border-color: var(--ph3a-primary);
  color: #fff;
}
.tr-action-btn.danger:hover {
  background: var(--ph3a-danger);
  border-color: var(--ph3a-danger);
  color: #fff;
}
.tr-action-btn.success:hover {
  background: var(--ph3a-success);
  border-color: var(--ph3a-success);
  color: #fff;
}

/* Header de tabela levemente mais refinado */
.ph3a-table thead th {
  font-size: 11px;
  letter-spacing: 0.6px;
  background: #FAFBFC;
  color: #718096;
  padding: 10px 16px;
}

/* ── 7. BADGES — Estilo HubSpot ─────────────────────────────── */
.ph3a-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0;
  text-transform: none;
}
/* Estágios do funil como pills coloridas */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.stage-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

/* ── 8. BOTÕES — Variante Ghost ─────────────────────────────── */
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--ph3a-border);
  color: var(--ph3a-text);
  border-radius: var(--ph3a-radius);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .18s;
}
.btn-ghost:hover {
  border-color: var(--ph3a-primary);
  color: var(--ph3a-primary);
  background: rgba(255,81,27,.04);
}
.btn-ghost-navy {
  background: transparent;
  border: 1.5px solid var(--ph3a-border);
  color: var(--ph3a-text-light);
  border-radius: var(--ph3a-radius);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .18s;
  text-decoration: none;
}
.btn-ghost-navy:hover {
  border-color: var(--ph3a-accent);
  color: var(--ph3a-accent);
  background: rgba(5,31,78,.04);
  text-decoration: none;
}

/* Botão primário mais refinado */
.btn-ph3a, .btn-accent {
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
.btn-ph3a:hover { transform: none; box-shadow: 0 4px 12px rgba(255,81,27,.30); }
.btn-accent:hover { transform: none; box-shadow: 0 4px 12px rgba(5,31,78,.25); }
.btn-outline-ph3a { border-radius: 8px; padding: 8px 16px; font-size: 13.5px; }

/* ── 9. PAGE HEADER — Estilo HubSpot ─────────────────────────── */
.page-header {
  margin-bottom: 22px;
}
.page-header h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1A202C;
}
/* Breadcrumb no topbar */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ph3a-text-light);
}
.topbar-breadcrumb a {
  color: var(--ph3a-text-light);
  text-decoration: none;
  transition: color .15s;
}
.topbar-breadcrumb a:hover { color: var(--ph3a-primary); }
.topbar-breadcrumb .bc-sep {
  font-size: 11px;
  color: #CBD5E0;
}
.topbar-breadcrumb .bc-current {
  color: var(--ph3a-text);
  font-weight: 600;
}

/* ── 10. TOAST SYSTEM — Bottom-right ─────────────────────────── */
.ph3a-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.ph3a-toast {
  pointer-events: all;
  background: #fff;
  border: 1px solid var(--ph3a-border);
  border-radius: 12px;
  box-shadow: var(--ph3a-shadow-lg);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  transform: translateX(120%);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.ph3a-toast.show { transform: translateX(0); }
.ph3a-toast.hiding { transform: translateX(120%); transition: transform .25s ease-in; }
.ph3a-toast .toast-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.ph3a-toast.success .toast-icon { background: #F0FDF4; color: #16A34A; }
.ph3a-toast.error   .toast-icon { background: #FEF2F2; color: #DC2626; }
.ph3a-toast.warning .toast-icon { background: #FFFBEB; color: #D97706; }
.ph3a-toast.info    .toast-icon { background: #EFF6FF; color: #2563EB; }
.ph3a-toast .toast-body { flex: 1; }
.ph3a-toast .toast-title {
  font-size: 13.5px; font-weight: 700; color: var(--ph3a-text); line-height: 1.2;
}
.ph3a-toast .toast-msg {
  font-size: 12.5px; color: var(--ph3a-text-light); margin-top: 2px; line-height: 1.4;
}
.ph3a-toast .toast-close {
  background: none; border: none; color: #CBD5E0; cursor: pointer;
  font-size: 14px; padding: 0; line-height: 1; margin-top: 1px; flex-shrink: 0;
  transition: color .15s;
}
.ph3a-toast .toast-close:hover { color: var(--ph3a-text); }

/* ── 11. FLASH MESSAGES — Converte para toasts ────────────────── */
.flash-container { display: none; } /* Oculta alerts nativos — usamos toasts */

/* ── 12. DASHBOARD — KPI Cards Estilo HubSpot ─────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card-v2 {
  background: #fff;
  border: 1px solid var(--ph3a-border);
  border-radius: var(--ph3a-radius-lg);
  padding: 18px 20px;
  box-shadow: var(--ph3a-shadow-sm);
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.kpi-card-v2:hover {
  box-shadow: var(--ph3a-shadow-md);
  transform: translateY(-2px);
}
.kpi-card-v2 .kpi-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}
.kpi-card-v2 .kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #1A202C;
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-card-v2 .kpi-label {
  font-size: 12.5px;
  color: var(--ph3a-text-light);
  font-weight: 500;
}
.kpi-card-v2 .kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 8px;
  padding: 2px 7px;
  border-radius: 20px;
}
.kpi-trend-up   { background: #F0FDF4; color: #16A34A; }
.kpi-trend-down { background: #FEF2F2; color: #DC2626; }
.kpi-trend-neutral { background: #F8FAFC; color: #718096; }
/* Barra colorida topo */
.kpi-card-v2::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--ph3a-primary));
  border-radius: var(--ph3a-radius-lg) var(--ph3a-radius-lg) 0 0;
}

/* ── 13. ACTIVITY TIMELINE — Estilo HubSpot ──────────────────── */
.hs-timeline {
  position: relative;
  padding-left: 32px;
}
.hs-timeline::before {
  content: '';
  position: absolute;
  left: 11px; top: 6px; bottom: 0;
  width: 2px;
  background: var(--ph3a-border);
}
.hs-timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.hs-timeline-item .tl-dot {
  position: absolute;
  left: -32px; top: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--ph3a-border);
}
.hs-timeline-item .tl-card {
  background: #fff;
  border: 1px solid var(--ph3a-border);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--ph3a-shadow-sm);
  transition: box-shadow .15s;
}
.hs-timeline-item .tl-card:hover { box-shadow: var(--ph3a-shadow-md); }
.hs-timeline-item .tl-time {
  font-size: 11px;
  color: var(--ph3a-text-light);
  margin-bottom: 4px;
}
.hs-timeline-item .tl-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ph3a-text);
  margin-bottom: 3px;
}
.hs-timeline-item .tl-body {
  font-size: 13px;
  color: var(--ph3a-text-light);
  line-height: 1.4;
}

/* ── 14. KANBAN — Cards Mais Ricos ──────────────────────────── */
.kanban-card {
  border-radius: var(--ph3a-radius);
  border: 1px solid var(--ph3a-border);
  box-shadow: var(--ph3a-shadow-sm);
}
.kanban-card:hover {
  box-shadow: var(--ph3a-shadow-md);
  transform: translateY(-2px);
}
.kanban-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.kanban-card-prob {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(16,185,129,.1);
  color: #059669;
}

/* ── 15. CONTACT INFO CARD — Deal Page ──────────────────────── */
.contact-info-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--ph3a-border);
  border-radius: var(--ph3a-radius-lg);
  box-shadow: var(--ph3a-shadow-sm);
  flex-wrap: wrap;
}
.contact-info-bar .cib-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--ph3a-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.contact-info-bar .cib-name {
  font-size: 14px; font-weight: 700; color: #1A202C;
}
.contact-info-bar .cib-detail {
  font-size: 12px; color: var(--ph3a-text-light); margin-top: 1px;
}
.contact-info-bar .cib-actions {
  margin-left: auto;
  display: flex; gap: 8px; align-items: center;
}
.cib-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1.5px solid var(--ph3a-border);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ph3a-text);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.cib-action-btn:hover {
  border-color: var(--ph3a-primary);
  color: var(--ph3a-primary);
  text-decoration: none;
}
.cib-action-btn.email:hover { border-color: #2563EB; color: #2563EB; }
.cib-action-btn.whatsapp:hover { border-color: #16A34A; color: #16A34A; }

/* ── 16. SEARCH & FILTER BAR — Refinada ──────────────────────── */
.filter-bar {
  background: #fff;
  border: 1px solid var(--ph3a-border);
  border-radius: var(--ph3a-radius-lg);
  padding: 16px 20px;
  box-shadow: var(--ph3a-shadow-sm);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-control,
.filter-bar .form-select {
  height: 36px;
  padding: 0 12px;
  font-size: 13.5px;
  border-radius: 8px;
  border-width: 1.5px;
}
.filter-bar .form-control.search-input {
  padding-left: 36px;
  min-width: 200px;
}
.filter-bar .search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.filter-bar .search-wrap .si {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #a0aec0; font-size: 13px; pointer-events: none;
}

/* ── 17. EMPTY STATE — Estilo HubSpot ─────────────────────────── */
.empty-state-v2 {
  text-align: center;
  padding: 56px 20px;
}
.empty-state-v2 .es-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--ph3a-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  color: #CBD5E0;
  margin: 0 auto 18px;
}
.empty-state-v2 .es-title {
  font-size: 17px; font-weight: 700; color: #2D3748; margin-bottom: 6px;
}
.empty-state-v2 .es-text {
  font-size: 14px; color: var(--ph3a-text-light); margin-bottom: 20px;
  max-width: 320px; margin-left: auto; margin-right: auto; line-height: 1.5;
}

/* ── 18. PIPELINE FUNIL — Mais Visual ────────────────────────── */
.pipeline-funil {
  gap: 4px;
}
.pf-step {
  border-radius: 8px;
  transition: all .18s;
}
.pf-step:hover {
  transform: none;
  filter: brightness(1.05);
}

/* ── 19. FORMS — Inputs Refinados ────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border-width: 1.5px;
  font-size: 13.5px;
  padding: 9px 13px;
  transition: border-color .18s, box-shadow .18s;
}
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 3px rgba(255,81,27,.10);
  border-color: var(--ph3a-primary);
}
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: #4A5568;
  margin-bottom: 5px;
}
.form-section-title {
  font-size: 13px;
  color: var(--ph3a-text-light);
  font-weight: 700;
  border-bottom: 1.5px solid var(--ph3a-border);
  padding-bottom: 10px;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-section-title i { color: var(--ph3a-primary); }

/* ── 20. RESPONSIVO — Ajustes ─────────────────────────────────── */
@media (max-width: 1100px) {
  .topbar-search { max-width: 280px; margin: 0 12px; }
}
@media (max-width: 900px) {
  .topbar-search { display: none; }
}
