/* ============================================================
   Évora Pipe CRM — style.css
   Fonte: Inter (Google Fonts)
   Paleta: #2563EB | #F8FAFC | #111827 | #4B5563
   ============================================================ */

/* ── Google Font ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --primary:        #2563EB;
  --primary-dark:   #1D4ED8;
  --primary-light:  #EFF6FF;
  --white:          #FFFFFF;
  --bg:             #F8FAFC;
  --text:           #111827;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;
  --success:        #22C55E;
  --success-light:  #F0FDF4;
  --warning:        #F59E0B;
  --warning-light:  #FFFBEB;
  --danger:         #EF4444;
  --danger-light:   #FEF2F2;
  --border:         #E5E7EB;
  --border-light:   #F3F4F6;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-md:      0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg:      0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);
  --radius-sm:      6px;
  --radius:         10px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --transition:     .2s ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   AUTH PAGES (login / cadastro / recuperar senha)
   ============================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 60%, #EFF6FF 100%);
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  animation: fadeInUp .4s ease both;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 42px; height: 42px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
}

.auth-logo .logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
}

.auth-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; text-align: center; }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); text-align: center; margin-bottom: 28px; }

/* ── Form Controls ────────────────────────────────────────── */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.invalid-feedback { font-size: 12px; color: var(--danger); margin-top: 4px; }

textarea.form-control { resize: vertical; min-height: 90px; }

.input-group { position: relative; }
.input-group .form-control { padding-left: 40px; }
.input-group .input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px; pointer-events: none;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap; user-select: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
  background: transparent; color: var(--primary); border-color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary-light); color: var(--primary); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(.9); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(.9); color: #fff; }

.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-light); color: var(--danger); }

.btn-light { background: var(--border-light); color: var(--text); border-color: var(--border); }
.btn-light:hover { background: var(--border); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--primary-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Auth Divider ─────────────────────────────────────────── */
.auth-divider { text-align: center; position: relative; margin: 20px 0; }
.auth-divider span {
  background: var(--white); padding: 0 12px;
  font-size: 12px; color: var(--text-muted);
  position: relative; z-index: 1;
}
.auth-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}

/* ============================================================
   LAYOUT — Sidebar + Main
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 16px; font-weight: 800;
  color: var(--text); letter-spacing: -.4px;
}

.sidebar-nav { padding: 12px 12px; flex: 1; }

.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-item { margin-bottom: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-link i { font-size: 17px; flex-shrink: 0; width: 20px; text-align: center; }

.nav-link:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-link .badge-count {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.4;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
}
.user-card:hover { background: var(--bg); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}

.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.user-info .user-role { font-size: 11px; color: var(--text-muted); }

/* ── Topbar ───────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
}

.topbar-toggle {
  display: none;
  background: none; border: none;
  font-size: 20px; color: var(--text-secondary);
  cursor: pointer; padding: 4px;
}

.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }

.topbar-search {
  flex: 1; max-width: 380px; margin-left: auto;
  position: relative;
}
.topbar-search .form-control { padding-left: 38px; background: var(--bg); border-color: var(--bg); }
.topbar-search .form-control:focus { background: var(--white); border-color: var(--primary); }
.topbar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: none; border: none;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px;
  transition: all var(--transition); position: relative;
}
.topbar-btn:hover { background: var(--bg); color: var(--primary); }
.topbar-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; background: var(--danger); border-radius: 50%;
  border: 1.5px solid var(--white);
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header-left .page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-header-left .page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ============================================================
   CARDS & WIDGETS
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body  { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border-light); background: var(--bg); }

/* Stat card */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex; align-items: flex-start; justify-content: space-between;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: var(--success-light);  color: var(--success); }
.stat-icon.yellow { background: var(--warning-light);  color: var(--warning); }
.stat-icon.red    { background: var(--danger-light);   color: var(--danger); }

.stat-info .stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
.stat-info .stat-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-info .stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.stat-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 99px;
}
.stat-badge.up   { background: var(--success-light); color: #166534; }
.stat-badge.down { background: var(--danger-light);  color: #991b1b; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-secondary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:hover td { background: var(--bg); }
.table tbody tr:last-child td { border-bottom: none; }

.table-actions { display: flex; gap: 4px; align-items: center; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: #166534; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger  { background: var(--danger-light);  color: #991b1b; }
.badge-gray    { background: var(--border-light);  color: var(--text-secondary); }

/* ── Stage badges ─────────────────────────────────────────── */
.stage-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.stage-novo_lead        { background: #F0F9FF; color: #0369A1; }
.stage-primeiro_contato { background: #EDE9FE; color: #6D28D9; }
.stage-qualificacao     { background: #FFF7ED; color: #C2410C; }
.stage-proposta_enviada { background: var(--warning-light); color: #92400e; }
.stage-negociacao       { background: #FDF4FF; color: #86198F; }
.stage-fechado_ganho    { background: var(--success-light); color: #166534; }
.stage-fechado_perdido  { background: var(--danger-light);  color: #991b1b; }

/* ============================================================
   KANBAN PIPELINE
   ============================================================ */
.pipeline-wrapper {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}

.kanban-col {
  flex-shrink: 0;
  width: 270px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 180px);
}

.kanban-col-header {
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky; top: 0;
  background: var(--bg);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.kanban-col-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.kanban-col-count {
  font-size: 11px; font-weight: 700;
  background: var(--white);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 1px 8px; border-radius: 99px;
}

.kanban-list {
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

.kanban-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  cursor: grab;
  transition: box-shadow var(--transition), transform var(--transition);
  user-select: none;
}
.kanban-card:hover   { box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .5; cursor: grabbing; }
.kanban-card.drag-over { border: 2px dashed var(--primary); background: var(--primary-light); }

.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.kanban-card-client { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; }
.kanban-card-value { font-size: 13px; font-weight: 700; color: var(--primary); }
.kanban-card-prob  { font-size: 11px; color: var(--text-muted); }
.kanban-card-date  { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; margin-top: 6px; }

.kanban-drop-placeholder {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  height: 56px;
  background: var(--primary-light);
}

/* ── Column accent colors ─────────────────────────────────── */
.col-novo_lead        .kanban-col-title { color: #0369A1; }
.col-primeiro_contato .kanban-col-title { color: #6D28D9; }
.col-qualificacao     .kanban-col-title { color: #C2410C; }
.col-proposta_enviada .kanban-col-title { color: #92400e; }
.col-negociacao       .kanban-col-title { color: #86198F; }
.col-fechado_ganho    .kanban-col-title { color: #166534; }
.col-fechado_perdido  .kanban-col-title { color: #991b1b; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17,24,39,.45);
  z-index: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn .2s ease;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: fadeInUp .25s ease both;
  overflow: hidden;
}
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; font-size: 20px;
  color: var(--text-muted); cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body   { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }

/* ============================================================
   FILTERS & SEARCH BAR
   ============================================================ */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.filter-bar .form-control,
.filter-bar .form-select { max-width: 200px; }
.filter-bar .form-control.search-wide { max-width: 300px; }

/* ============================================================
   ACTIVITIES LIST
   ============================================================ */
.activity-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.act-ligacao   { background: #EFF6FF; color: var(--primary); }
.act-reuniao   { background: var(--success-light); color: var(--success); }
.act-whatsapp  { background: #F0FDF4; color: #16A34A; }
.act-email     { background: var(--warning-light); color: var(--warning); }
.act-follow_up { background: #FDF4FF; color: #9333EA; }
.act-outro     { background: var(--border-light); color: var(--text-secondary); }

.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; font-weight: 600; color: var(--text); }
.activity-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.activity-status { flex-shrink: 0; }

/* ============================================================
   HISTORY TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute;
  left: 9px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -26px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-dot.green  { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.red    { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger); }
.timeline-dot.yellow { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }

.timeline-content { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.timeline-action { font-size: 13px; font-weight: 600; color: var(--text); }
.timeline-desc   { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.timeline-date   { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; }

/* ============================================================
   SEARCH RESULTS DROPDOWN
   ============================================================ */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 500;
  overflow: hidden;
  display: none;
}
.search-dropdown.show { display: block; }

.search-result-group { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.search-result-group:last-child { border-bottom: none; }
.search-result-label { padding: 4px 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.search-result-item {
  padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg); }
.search-result-item i { color: var(--text-muted); font-size: 14px; width: 16px; text-align: center; }
.search-result-item .name { font-weight: 500; color: var(--text); }
.search-result-item .sub  { font-size: 11px; color: var(--text-muted); margin-left: auto; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.empty-state i { font-size: 48px; color: var(--border); margin-bottom: 16px; display: block; }
.empty-state h5 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-wrap { background: var(--border-light); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .6s ease; }
.progress-bar-fill.green  { background: var(--success); }
.progress-bar-fill.yellow { background: var(--warning); }
.progress-bar-fill.red    { background: var(--danger); }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger)  !important; }
.text-warning   { color: var(--warning) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fs-12  { font-size: 12px !important; }
.fs-13  { font-size: 13px !important; }
.gap-6  { gap: 6px !important; }

.divider { height: 1px; background: var(--border-light); margin: 16px 0; }

.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(17,24,39,.4);
  z-index: 190;
}

/* Tooltip simple */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff;
  font-size: 11px; white-space: nowrap;
  padding: 4px 9px; border-radius: var(--radius-sm);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
  z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin      { to { transform: rotate(360deg); } }

.spin { animation: spin .8s linear infinite; }
.fade-in { animation: fadeIn .3s ease both; }

/* ============================================================
   RESPONSIVE — Tablet (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }

  .kanban-col { width: 240px; }

  .filter-bar .form-control,
  .filter-bar .form-select { max-width: 160px; }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay { display: none; }
  .sidebar-overlay.show { display: block; }

  .main-content { margin-left: 0; }

  .topbar { padding: 0 16px; }
  .topbar-toggle { display: flex; align-items: center; justify-content: center; }
  .topbar-search { max-width: none; }

  .page-content { padding: 16px; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .filter-bar { flex-wrap: wrap; }
  .filter-bar .form-control,
  .filter-bar .form-select { max-width: 100%; flex: 1 1 140px; }

  .stat-card { flex-direction: row; }

  .auth-card { padding: 32px 24px; }

  .pipeline-wrapper { flex-direction: column; overflow-x: visible; }
  .kanban-col { width: 100%; max-height: none; }

  .modal { max-width: 100%; max-height: 95vh; border-radius: var(--radius-md) var(--radius-md) 0 0; align-self: flex-end; }
  .modal-backdrop { align-items: flex-end; padding: 0; }

  .table th, .table td { padding: 10px 12px; }
}

/* ============================================================
   RESPONSIVE — Small Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .btn-lg { padding: 11px 20px; font-size: 14px; }
  .stat-info .stat-value { font-size: 20px; }
  .topbar-search { display: none; }
  .topbar-search.show { display: flex; position: absolute; left: 16px; right: 16px; top: 12px; z-index: 10; }
}