:root {
  --bp-primary: #4f46e5;
  --bp-primary-dark: #4338ca;
  --bp-primary-light: #eef2ff;
  --bp-success: #10b981;
  --bp-warning: #f59e0b;
  --bp-danger: #ef4444;
  --bp-info: #0ea5e9;
  --bp-bg: #f1f5f9;
  --bp-surface: #ffffff;
  --bp-surface-2: #f8fafc;
  --bp-border: #e2e8f0;
  --bp-text: #0f172a;
  --bp-text-muted: #64748b;
  --bp-radius: 0.75rem;
  --bp-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --bp-shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
  --bp-sidebar: #111827;
  --bp-sidebar-text: #9ca3af;
}

[data-theme="dark"] {
  --bp-primary: #818cf8;
  --bp-primary-dark: #6366f1;
  --bp-primary-light: #312e81;
  --bp-bg: #0f172a;
  --bp-surface: #1e293b;
  --bp-surface-2: #273449;
  --bp-border: #334155;
  --bp-text: #f1f5f9;
  --bp-text-muted: #94a3b8;
  --bp-sidebar: #0b1120;
  --bp-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --bp-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bp-bg);
  color: var(--bp-text);
  font-size: 14px;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--bp-primary); text-decoration: none; }
a:hover { color: var(--bp-primary-dark); }

/* Layout */
.bp-app { display: flex; min-height: 100vh; }
.bp-main { flex: 1; margin-left: 260px; display: flex; flex-direction: column; min-height: 100vh; }
.bp-content { padding: 1.5rem; flex: 1; }

/* Sidebar */
.bp-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 260px;
  background: var(--bp-sidebar); color: var(--bp-sidebar-text);
  overflow-y: auto; z-index: 100; transition: transform 0.25s ease;
}
.bp-sidebar .brand { display: flex; align-items: center; gap: 0.6rem; padding: 1.1rem 1.25rem; color: #fff; font-weight: 700; font-size: 1.15rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.bp-sidebar .brand i { color: #a5b4fc; }
.bp-sidebar .section { padding: 0.85rem 1.25rem 0.35rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: #6b7280; }
.bp-sidebar nav a {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1.25rem; color: var(--bp-sidebar-text);
  border-left: 3px solid transparent; transition: all 0.15s ease; font-size: 0.875rem;
}
.bp-sidebar nav a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.bp-sidebar nav a.active { color: #fff; background: rgba(79,70,229,0.25); border-left-color: var(--bp-primary); }
.bp-sidebar nav a i { width: 18px; text-align: center; }

/* Topbar */
.bp-topbar {
  background: var(--bp-surface); border-bottom: 1px solid var(--bp-border);
  padding: 0 1.5rem; height: 60px; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 50;
}
.bp-topbar .toggle-sidebar { background: none; border: none; color: var(--bp-text-muted); font-size: 1.25rem; cursor: pointer; display: none; }
.bp-topbar .spacer { flex: 1; }

/* Cards */
.bp-card { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: var(--bp-radius); box-shadow: var(--bp-shadow); }
.bp-card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--bp-border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bp-card-body { padding: 1.25rem; }
.bp-card-title { margin: 0; font-size: 1rem; font-weight: 600; }

/* KPI stats */
.bp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.bp-stat { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: var(--bp-radius); padding: 1.1rem 1.25rem; box-shadow: var(--bp-shadow); min-width: 0; height: 100%; }
.bp-stat-icon { width: 42px; height: 42px; border-radius: 0.65rem; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; margin-bottom: 0.7rem; }
.bp-stat-icon.blue { background: #dbeafe; color: #1d4ed8; }
.bp-stat-icon.green { background: #d1fae5; color: #047857; }
.bp-stat-icon.orange { background: #fef3c7; color: #b45309; }
.bp-stat-icon.purple { background: #ede9fe; color: #6d28d9; }
.bp-stat-icon.red { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .bp-stat-icon.blue { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .bp-stat-icon.green { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .bp-stat-icon.orange { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .bp-stat-icon.purple { background: #4c1d95; color: #c4b5fd; }
[data-theme="dark"] .bp-stat-icon.red { background: #7f1d1d; color: #fca5a5; }
.bp-stat .value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.bp-stat .label { color: var(--bp-text-muted); font-size: 0.8rem; }
.bp-stat .fs-4, .bp-stat .fs-5, .bp-stat .fs-6 { overflow-wrap: anywhere; word-break: break-word; line-height: 1.25; }
.bp-stat .small { line-height: 1.3; }

/* Tables */
.bp-table-wrap { overflow-x: auto; }
table.bp-table { width: 100%; border-collapse: collapse; }
.bp-table thead th { text-align: left; padding: 0.7rem 1rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bp-text-muted); border-bottom: 1px solid var(--bp-border); white-space: nowrap; }
.bp-table tbody td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--bp-border); vertical-align: middle; }
.bp-table tbody tr:hover { background: var(--bp-surface-2); }
.bp-table .actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

/* Badges */
.bp-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.bp-badge.green { background: #d1fae5; color: #065f46; }
.bp-badge.blue { background: #dbeafe; color: #1e40af; }
.bp-badge.yellow { background: #fef3c7; color: #92400e; }
.bp-badge.red { background: #fee2e2; color: #991b1b; }
.bp-badge.gray { background: #f1f5f9; color: #475569; }
[data-theme="dark"] .bp-badge.green { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .bp-badge.blue { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .bp-badge.yellow { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .bp-badge.red { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .bp-badge.gray { background: #334155; color: #cbd5e1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.9rem; border-radius: 0.5rem; border: 1px solid transparent; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.15s ease; text-decoration: none; }
.btn-primary { background: var(--bp-primary); color: #fff; }
.btn-primary:hover { background: var(--bp-primary-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--bp-border); color: var(--bp-text); }
.btn-outline:hover { border-color: var(--bp-primary); color: var(--bp-primary); }
.btn-success { background: var(--bp-success); color: #fff; }
.btn-danger { background: var(--bp-danger); color: #fff; }
.btn-warning { background: var(--bp-warning); color: #fff; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.btn-lg { padding: 0.7rem 1.3rem; font-size: 1rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Forms */
.bp-form-control, .form-control, select.form-control, textarea.form-control {
  width: 100%; padding: 0.55rem 0.8rem; border: 1px solid var(--bp-border); border-radius: 0.5rem;
  background: var(--bp-surface); color: var(--bp-text); font-size: 0.875rem; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bp-form-control:focus { outline: none; border-color: var(--bp-primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }
.bp-form-label { display: block; margin-bottom: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--bp-text); }
.bp-form-group { margin-bottom: 1rem; }
.form-text { font-size: 0.75rem; color: var(--bp-text-muted); }
.invalid-feedback { color: var(--bp-danger); font-size: 0.78rem; margin-top: 0.25rem; display: block; }

/* Alerts / flash */
.bp-alert { padding: 0.8rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.875rem; border: 1px solid transparent; }
.bp-alert.success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.bp-alert.danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.bp-alert.warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.bp-alert.info { background: #e0f2fe; color: #0c4a6e; border-color: #bae6fd; }
[data-theme="dark"] .bp-alert.success { background: #064e3b; color: #a7f3d0; }
[data-theme="dark"] .bp-alert.danger { background: #7f1d1d; color: #fecaca; }
[data-theme="dark"] .bp-alert.warning { background: #78350f; color: #fde68a; }
[data-theme="dark"] .bp-alert.info { background: #0c4a6e; color: #bae6fd; }

/* Pagination */
.bp-pagination { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.bp-pagination a, .bp-pagination span { padding: 0.4rem 0.75rem; border: 1px solid var(--bp-border); border-radius: 0.45rem; font-size: 0.8rem; color: var(--bp-text); background: var(--bp-surface); }
.bp-pagination a:hover { border-color: var(--bp-primary); color: var(--bp-primary); }
.bp-pagination .current { background: var(--bp-primary); border-color: var(--bp-primary); color: #fff; }
.bp-pagination .disabled { opacity: 0.5; pointer-events: none; }

/* Modal */
.bp-modal { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; padding: 1rem; }
.bp-modal.show { display: flex; }
.bp-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.5); }
.bp-modal-content { position: relative; background: var(--bp-surface); border-radius: var(--bp-radius); box-shadow: var(--bp-shadow-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.bp-modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--bp-border); display: flex; align-items: center; justify-content: space-between; }
.bp-modal-body { padding: 1.25rem; }
.bp-modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--bp-border); display: flex; justify-content: flex-end; gap: 0.5rem; }

/* Utilities */
.text-muted { color: var(--bp-text-muted); }
.text-success { color: var(--bp-success); }
.text-danger { color: var(--bp-danger); }
.text-warning { color: var(--bp-warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Avatar */
.bp-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bp-primary-light); color: var(--bp-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }

/* Landing */
.bp-landing { background: #f5f7f2; color: #17221d; }
.bp-landing .navbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); border-bottom: 1px solid #e2e8f0; }
.bp-hero { background: radial-gradient(circle at 85% 15%, rgba(244,177,105,.28), transparent 28%), linear-gradient(135deg, #edf5ed 0%, #f7f4e8 54%, #f6e8d9 100%); padding: 4rem 0 4.5rem; }
.bp-hero h1 { font-size: 3rem; font-weight: 800; line-height: 1.1; }
.bp-hero .lead { font-size: 1.2rem; color: #475569; }
.bp-section { padding: 4rem 0; }
.bp-section-heading { max-width: 680px; margin-bottom: 2rem; }
.bp-eyebrow { display: inline-block; color: #17795d; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .65rem; }
.bp-section-title { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.bp-section-sub { color: #64748b; margin-bottom: 2.5rem; }
.bp-feature-card { border: 1px solid #dce7dd; border-radius: .5rem; padding: 1.5rem; background: #fff; height: 100%; }
.bp-feature-card h3, .bp-step h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 .55rem; }
.bp-feature-card p, .bp-step p { color: #64756b; font-size: .9rem; margin: 0; }
.bp-feature-icon { width: 42px; height: 42px; border-radius: .5rem; background: #e5f2e9; color: #17795d; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: 1rem; }
.bp-landing-preview { background: #fff; border: 1px solid #d8e2d8; border-radius: .75rem; padding: 1.25rem; box-shadow: 0 24px 60px rgba(72, 73, 45, .14); transform: rotate(1deg); }
.bp-preview-kicker, .bp-preview-stat span { display: block; color: #738179; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.bp-preview-stat { border: 1px solid #e3ebe2; border-radius: .5rem; padding: .85rem; }
.bp-preview-stat strong { display: block; font-size: 1.25rem; margin: .35rem 0; }
.bp-preview-stat small { color: #17795d; font-size: .72rem; }
.bp-preview-panel { background: #f5f8f3; border-radius: .5rem; padding: 1rem; }
.bp-preview-bars { height: 130px; display: flex; align-items: end; gap: .55rem; border-bottom: 1px solid #d8e2d8; }
.bp-preview-bars span { flex: 1; min-height: 12%; border-radius: .25rem .25rem 0 0; background: #77b894; }
.bp-preview-bars span:nth-child(2n) { background: #e5a366; }
.bp-workflow { background: #eaf1e8; }
.bp-step { border-top: 2px solid #17795d; padding: 1.1rem 0; }
.bp-step > span { color: #17795d; font-weight: 800; font-size: .8rem; display: block; margin-bottom: .8rem; }
.bp-price-card { border: 1px solid #e2e8f0; border-radius: 1.25rem; padding: 2rem; position: relative; height: 100%; }
.bp-price-card.featured { border-color: var(--bp-primary); box-shadow: 0 20px 50px rgba(79,70,229,0.2); }
.bp-price-card .price { font-size: 2.75rem; font-weight: 800; }
.bp-price { margin: 1.25rem 0; }
.bp-price strong { font-size: 2rem; }
.bp-price span { color: #738179; }
.bp-price-card ul { list-style: none; padding: 0; min-height: 7.5rem; }
.bp-price-card li { padding: .35rem 0; color: #5c6d62; font-size: .88rem; }
.bp-price-card li i { color: #17795d; margin-right: .5rem; }
.bp-cta { background: #1e4d3d; color: #fff; border-radius: .75rem; padding: 2.5rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.bp-cta h2 { font-size: 2rem; margin: 0 0 .5rem; }
.bp-cta p { color: #d3e6d8; margin: 0; }
.bp-cta .bp-eyebrow { color: #f2bd7d; }

/* Responsive */
@media (max-width: 991px) {
  .bp-sidebar { transform: translateX(-100%); }
  .bp-sidebar.open { transform: translateX(0); }
  .bp-main { margin-left: 0; }
  .bp-topbar .toggle-sidebar { display: inline-flex; }
  .bp-hero h1 { font-size: 2.25rem; }
  .bp-landing-preview { transform: none; }
}
@media (max-width: 767px) {
  .bp-topbar { padding: 0 0.9rem; }
  .bp-topbar .btn-sm { padding: 0.3rem 0.5rem; font-size: 0.72rem; }
  .bp-content { padding: 1rem; }
  .bp-stat { padding: 0.9rem 1rem; }
  .bp-stat .fs-4 { font-size: 1.15rem; }
}
@media (max-width: 575px) {
  .bp-content { padding: 0.75rem; }
  .bp-cta { display: block; padding: 2rem; }
  .bp-cta .btn { margin-top: 1.5rem; }
  .bp-stats { grid-template-columns: 1fr; }
  .bp-topbar a.btn-outline { display: none; }
  .bp-stat .fs-4 { font-size: 1.05rem; }
  .bp-stat .fs-5 { font-size: 0.95rem; }
  .bp-stat-icon { width: 36px; height: 36px; font-size: 0.95rem; }
}
