:root {
  --crm-primary: #4f46e5;
  --crm-sidebar: #111827;
  --crm-sidebar-w: 248px;
  --crm-bg: #f4f6fb;
}
body { background: var(--crm-bg); font-size: .925rem; }
.btn-primary { --bs-btn-bg: var(--crm-primary); --bs-btn-border-color: var(--crm-primary); --bs-btn-hover-bg: color-mix(in srgb, var(--crm-primary) 85%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--crm-primary) 85%, #000); --bs-btn-active-bg: color-mix(in srgb, var(--crm-primary) 75%, #000); }
.text-primary { color: var(--crm-primary) !important; }
a { color: var(--crm-primary); }

.crm-shell { display: flex; min-height: 100vh; }
.crm-sidebar { width: var(--crm-sidebar-w); background: var(--crm-sidebar); color: #cbd5e1; flex-shrink: 0; }
.crm-shell .crm-sidebar.offcanvas-lg { background-color: var(--crm-sidebar) !important; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem; }
.min-w-0 { min-width: 0; }
@media (min-width: 992px) { .crm-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
@media (max-width: 991.98px) { .crm-sidebar.offcanvas-lg { background: var(--crm-sidebar); } }
.crm-brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; color: #fff; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.08); }
.crm-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }
.crm-nav { padding: .6rem; display: flex; flex-direction: column; gap: 2px; }
.crm-nav a { display: flex; align-items: center; gap: .7rem; color: #cbd5e1; text-decoration: none; padding: .55rem .8rem; border-radius: .5rem; }
.crm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.crm-nav a.active { background: var(--crm-primary); color: #fff; }
.crm-nav i { font-size: 1.05rem; }

.crm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.crm-topbar { display: flex; align-items: center; gap: .75rem; background: #fff; padding: .7rem 1.25rem; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1020; }
.crm-content { padding: 1.25rem; flex: 1; }
.crm-footer { padding: .75rem 1.25rem; color: #94a3b8; font-size: .8rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--crm-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; }

.card { border: 1px solid #e8eaf0; border-radius: .75rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; }
.stat-card { padding: 1rem 1.1rem; display: flex; flex-direction: row; align-items: center; gap: .9rem; height: 100%; }
.stat-card .icon { width: 44px; height: 44px; border-radius: .7rem; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-card .value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-card .label { color: #64748b; font-size: .8rem; }
a.stat-link { text-decoration: none; color: inherit; }
a.stat-link .card:hover { border-color: var(--crm-primary); }

.table > :not(caption) > * > * { padding: .55rem .65rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #64748b; background: #f8fafc; white-space: nowrap; }
.table td { vertical-align: middle; }
.filter-bar .form-control, .filter-bar .form-select { font-size: .85rem; }
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid #e5e7eb; margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--crm-primary); }
.timeline li:last-child { border-left-color: transparent; }
.timeline .meta { font-size: .75rem; color: #64748b; }
audio { height: 34px; max-width: 260px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef2ff, #f8fafc); }
.login-card { width: 100%; max-width: 400px; }
.chart-box { position: relative; height: 280px; }
.badge.text-bg-light { border: 1px solid #e2e8f0; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #eee; padding: .6rem; z-index: 5; }

.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
