/* ==========================================================================
   LeadFlow CRM — Design System
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef1fd;
  --text: #0f172a;
  --muted: #64748b;
  --surface: #ffffff;
  --background: #f6f7fb;
  --border: #e6e8f0;
  --success: #16a34a;
  --success-soft: #eafbef;
  --warning: #d97706;
  --warning-soft: #fef6e7;
  --danger: #dc2626;
  --danger-soft: #fdeced;
  --info: #0891b2;
  --info-soft: #e7f8fb;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 6px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .10);
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 84px;
  --topbar-h: 72px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--background);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { text-decoration: none; }

.muted { color: var(--muted); }
.text-primary-accent { color: var(--primary) !important; }
.fw-800 { font-weight: 800; }

/* ==========================================================================
   Scrollbar
   ========================================================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d7dbe6; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #c2c7d6; }

/* ==========================================================================
   App Shell
   ========================================================================== */
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1030;
  transition: width .22s var(--ease), transform .22s var(--ease);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-brand .mark {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: 11px;
  background: linear-gradient(155deg, var(--primary), var(--primary-dark));
  display: grid; place-items: center;
  color: #fff; font-size: 18px;
  box-shadow: 0 6px 14px rgba(79, 70, 229, .28);
}

.sidebar-brand .name { font-weight: 800; font-size: 17px; letter-spacing: -.2px; color: var(--text); transition: opacity .15s var(--ease); }
.sidebar-brand .name small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 14px 20px; }

.nav-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #a3a9ba;
  font-weight: 700;
  padding: 14px 12px 6px;
  white-space: nowrap;
}
.nav-group-label:first-child { padding-top: 4px; }

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4b5265;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 2px 0;
  font-weight: 600;
  font-size: 13.8px;
  position: relative;
  transition: background .15s var(--ease), color .15s var(--ease);
  white-space: nowrap;
}
.side-link i { font-size: 17px; min-width: 20px; text-align: center; color: #8791a8; transition: color .15s var(--ease), transform .15s var(--ease); }
.side-link:hover { background: #f4f5fb; color: var(--text); }
.side-link:hover i { color: var(--primary); transform: translateX(1px); }
.side-link.active { background: var(--primary-soft); color: var(--primary-dark); }
.side-link.active i { color: var(--primary); }
.side-link.active::before {
  content: '';
  position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; border-radius: 0 6px 6px 0;
  background: var(--primary);
}
.side-link .label { transition: opacity .12s var(--ease); }

.sidebar-foot { padding: 12px 14px 18px; border-top: 1px solid var(--border); }

/* Collapsed desktop state */
.app-shell.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app-shell.collapsed .sidebar-brand .name,
.app-shell.collapsed .nav-group-label,
.app-shell.collapsed .side-link .label { display: none; }
.app-shell.collapsed .side-link { justify-content: center; }
.app-shell.collapsed .side-link.active::before { left: -14px; }
.app-shell.collapsed .main { margin-left: var(--sidebar-w-collapsed); }
.app-shell.collapsed .sidebar-brand { justify-content: center; padding: 22px 10px; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left .22s var(--ease); }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(15, 23, 42, .35);
  z-index: 1025; opacity: 0; transition: opacity .2s var(--ease);
}
.app-shell.mobile-open .sidebar-backdrop { display: block; opacity: 1; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app-shell.mobile-open .sidebar { transform: translateX(0); }
  .main, .app-shell.collapsed .main { margin-left: 0; }
}

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 1010;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 14px;
}

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: #545c70;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
  position: relative;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary-dark); border-color: #dfe2fb; }
.icon-btn:active { transform: scale(.94); }

.breadcrumb-mini { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.breadcrumb-mini .current { color: var(--text); }
.page-eyebrow { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
}

.global-search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 10px;
  background: var(--background); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 14px; color: var(--muted);
  cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.global-search:hover { border-color: #c9cde8; background: #fff; }
.global-search .kbd { margin-left: auto; font-size: 11px; font-weight: 700; color: #9aa0b4; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; background: #fff; }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 12px; padding: 6px 8px 6px 6px; transition: background .15s var(--ease); }
.user-chip:hover { background: var(--background); }
.user-chip .meta { line-height: 1.25; }
.user-chip .uname { font-weight: 700; font-size: 13.5px; color: var(--text); }
.user-chip .urole { font-size: 11.5px; color: var(--muted); }

.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 700; letter-spacing: -.02em;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 42px; height: 42px; font-size: 14px; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }

/* ==========================================================================
   Content / Page transitions
   ========================================================================== */
.content { padding: 26px; max-width: 1600px; }
@media (max-width: 767.98px) { .content { padding: 16px; } }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

.fade-up { animation: fadeUp .35s var(--ease) both; }
.fade-in { animation: fadeIn .3s var(--ease) both; }
.slide-in { animation: slideInRight .3s var(--ease) both; }
.stagger > * { animation: fadeUp .4s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }

@media (prefers-reduced-motion: reduce) {
  .fade-up, .fade-in, .slide-in, .stagger > * { animation: none !important; }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-hover { transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin: 0 0 3px; }
.page-header p { color: var(--muted); margin: 0; font-size: 13.5px; }

/* ==========================================================================
   Stat cards
   ========================================================================== */
.stat-card { padding: 20px; position: relative; overflow: hidden; }
.stat-card .icon-wrap { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; margin-bottom: 14px; }
.stat-card .label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.stat-card .num { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.stat-card .delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; margin-top: 10px; }
.stat-card .delta.up { color: var(--success); }
.stat-card .delta.down { color: var(--danger); }
.stat-card .delta .vs { color: var(--muted); font-weight: 500; margin-left: 2px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 13.6px; padding: 9px 16px; transition: transform .1s var(--ease), box-shadow .18s var(--ease), background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); border-width: 1px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 12px rgba(79,70,229,.22); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 6px 16px rgba(79,70,229,.3); }
.btn-light { background: #fff; border-color: var(--border); color: var(--text); }
.btn-light:hover { background: var(--background); border-color: #d7dbe8; color: var(--text); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--background); color: var(--text); }
.btn-outline-danger { border-color: #f3c9cc; color: var(--danger); background: #fff; }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 12.6px; border-radius: 9px; }

/* ==========================================================================
   Badges
   ========================================================================== */
.badge { font-weight: 700; font-size: 11.3px; padding: 5px 10px; border-radius: 999px; letter-spacing: .01em; }
.badge-soft { background: var(--primary-soft); color: var(--primary-dark); }
.badge-success { background: var(--success-soft); color: #15803d; }
.badge-warning { background: var(--warning-soft); color: #b45309; }
.badge-danger { background: var(--danger-soft); color: #b91c1c; }
.badge-info { background: var(--info-soft); color: #0e7490; }
.badge-neutral { background: #f1f2f6; color: #566; color: #4a5164; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; }
.badge-hot { background: #fff1ee; color: #c2410c; box-shadow: inset 0 0 0 1px #ffd9cc; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-modern { margin: 0; }
.table-modern thead th { background: #fafbfd; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; border-bottom: 1px solid var(--border); padding: 13px 16px; white-space: nowrap; }
.table-modern tbody td { padding: 15px 16px; border-bottom: 1px solid #f0f1f6; vertical-align: middle; }
.table-modern tbody tr { transition: background .12s var(--ease); }
.table-modern tbody tr:hover { background: #fafbff; }
.table-modern tbody tr:last-child td { border-bottom: none; }
.row-title { font-weight: 700; color: var(--text); }
.row-sub { font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-section { margin-bottom: 26px; }
.form-section-title { font-size: 13.5px; font-weight: 800; color: var(--text); margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.form-section-title i { color: var(--primary); }
.form-section-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.form-label { font-size: 12.8px; font-weight: 700; color: #3c4257; margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.form-control, .form-select {
  border: 1px solid var(--border); border-radius: 11px; padding: 10px 13px; font-size: 13.8px;
  background: #fcfcfe; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.form-control:focus, .form-select:focus {
  border-color: #b7bcf5; box-shadow: 0 0 0 4px var(--primary-soft); background: #fff;
}
.input-icon-group { position: relative; }
.input-icon-group i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9aa0b4; font-size: 14px; }
.input-icon-group .form-control { padding-left: 36px; }
.invalid-feedback { font-size: 12px; }
.is-invalid { border-color: var(--danger) !important; }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop.show { opacity: .5; backdrop-filter: blur(2px); }
.modal-content { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-header .modal-title { font-weight: 800; font-size: 16.5px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 22px; }
.modal.fade .modal-dialog { transform: scale(.96) translateY(6px); transition: transform .2s var(--ease), opacity .2s var(--ease); opacity: 0; }
.modal.show .modal-dialog { transform: scale(1) translateY(0); opacity: 1; }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast-item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; position: relative; overflow: hidden;
  animation: slideInRight .28s var(--ease) both;
}
.toast-item.leaving { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast-item .ic { width: 34px; height: 34px; min-width: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; }
.toast-item .msg { font-size: 13.3px; font-weight: 600; color: var(--text); padding-top: 4px; }
.toast-item .tclose { border: 0; background: none; color: var(--muted); margin-left: auto; cursor: pointer; }
.toast-item .tbar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary); animation: toastBar 4s linear forwards; }
@keyframes toastBar { from { width: 100%; } to { width: 0%; } }

/* ==========================================================================
   Empty states / skeletons
   ========================================================================== */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 28px; margin: 0 auto 18px; }
.empty-state h6 { font-weight: 800; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 13.3px; margin-bottom: 18px; }

.skeleton { position: relative; overflow: hidden; background: #eef0f5; border-radius: 8px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ==========================================================================
   Misc components
   ========================================================================== */
.quick-action { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--radius); border: 1px solid var(--border); transition: background .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease); color: var(--text); }
.quick-action:hover { background: var(--primary-soft); border-color: #dadeff; transform: translateX(2px); color: var(--text); }
.quick-action .qi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--background); color: var(--primary); font-size: 17px; transition: transform .15s var(--ease); }
.quick-action:hover .qi { transform: translateX(2px) scale(1.05); }

.kpi-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
@media (max-width: 1200px) { .kpi-strip { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
.kpi-mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: border-color .15s var(--ease), transform .12s var(--ease); }
.kpi-mini:hover { transform: translateY(-2px); border-color: #d6d9ee; }
.kpi-mini.active { border-color: var(--primary); background: var(--primary-soft); }
.kpi-mini .n { font-size: 20px; font-weight: 800; }
.kpi-mini .l { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search-input { position: relative; flex: 1; min-width: 220px; }
.search-input i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9aa0b4; }
.search-input input { padding-left: 36px; }

/* Lead / entity cards (mobile) */
.entity-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: box-shadow .15s var(--ease), transform .12s var(--ease); }
.entity-card:hover { box-shadow: var(--shadow); }
.entity-card .top { display: flex; gap: 12px; align-items: center; }
.entity-card .actions-row { display: flex; gap: 8px; margin-top: 12px; }
.entity-card .actions-row .btn { flex: 1; }

/* Timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 26px; opacity: 0; animation: fadeUp .4s var(--ease) forwards; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .dot { position: absolute; left: -30px; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 13px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.timeline-item .ttitle { font-weight: 700; font-size: 13.5px; }
.timeline-item .tdesc { font-size: 12.6px; color: var(--muted); margin-top: 2px; }
.timeline-item .tmeta { font-size: 11.3px; color: #9aa0b4; margin-top: 4px; }

/* Tabs */
.tab-underline { border-bottom: 1px solid var(--border); gap: 6px; }
.tab-underline .nav-link { border: none; color: var(--muted); font-weight: 700; font-size: 13.4px; padding: 12px 6px; margin-right: 18px; border-radius: 0; position: relative; }
.tab-underline .nav-link::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; transition: background .15s var(--ease); }
.tab-underline .nav-link.active { color: var(--primary); background: none; }
.tab-underline .nav-link.active::after { background: var(--primary); }

/* Kanban */
.kanban-wrap { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { flex: 0 0 280px; background: #f8f9fc; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 12.8px; margin-bottom: 10px; padding: 0 2px; }
.kanban-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; cursor: grab; transition: box-shadow .15s var(--ease), transform .1s var(--ease); }
.kanban-card:hover { box-shadow: var(--shadow); }
.kanban-card.dragging { opacity: .4; }
.kanban-col.drag-over { background: var(--primary-soft); border-color: #c9cdfa; }
.kanban-card .kname { font-weight: 700; font-size: 13.2px; }
.kanban-card .kmeta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* Subscription progress */
.sub-progress { height: 8px; border-radius: 6px; background: #eef0f5; overflow: hidden; position: relative; }
.sub-progress .bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); transition: width .4s var(--ease); }
.sub-progress.danger .bar { background: linear-gradient(90deg, #f59e0b, var(--danger)); }

/* Bulk action bar */
.bulk-bar { position: sticky; top: 82px; z-index: 30; background: #101728; color: #fff; border-radius: var(--radius); padding: 10px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; box-shadow: var(--shadow-lg); animation: fadeUp .2s var(--ease) both; }
.bulk-bar .btn-light { --bs-btn-padding-y: 5px; --bs-btn-padding-x: 12px; font-size: 12.6px; }
.bulk-checkbox { cursor: pointer; }

/* Filter drawer (mobile) */
.filter-drawer { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); z-index: 1090; transform: translateY(100%); transition: transform .25s var(--ease); max-height: 85vh; overflow-y: auto; padding: 18px; }
.filter-drawer.show { transform: translateY(0); }
.filter-drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 1085; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.filter-drawer-backdrop.show { opacity: 1; pointer-events: auto; }

/* Sticky mobile action bar */
.mobile-action-bar { display: none; }
@media (max-width: 767.98px) {
  .mobile-action-bar { display: flex; position: sticky; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px; z-index: 40; margin: 0 -16px -16px; }
  .mobile-action-bar .btn { flex: 1; font-size: 12px; padding: 10px 6px; }
}

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .side-link:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

/* Utility */
.no-overflow { overflow-x: hidden; }
.divider-v { width: 1px; background: var(--border); align-self: stretch; }
.search-result-row { transition: background .12s var(--ease); }
.search-result-row:hover { background: var(--background); }
