/* =========================================================
   KasaCRM — shared primitives (Pipedrive-inspired clean UI)
   Mirrors the accounting .acc-* system; scoped with .crm-*
   ========================================================= */

:root {
    --crm-border: #e5e7eb;
    --crm-border-light: #f1f5f9;
    --crm-text: #0f172a;
    --crm-text-muted: #64748b;
    --crm-text-dim: #94a3b8;
    --crm-primary: #4f46e5;
    --crm-primary-dark: #4338ca;
    --crm-bg-subtle: #f8fafc;
    --crm-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    --crm-shadow-hover: 0 6px 18px rgba(15, 23, 42, 0.08);
}

/* ── Page head ────────────────────────────────────────── */
.crm-page-head {
    background: #fff;
    border-bottom: 1px solid var(--crm-border);
    padding: 16px 22px;
    margin: -15px -15px 18px -15px;
}
.crm-page-head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.crm-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--crm-text);
    line-height: 1.2;
}
.crm-page-icon { font-size: 22px; line-height: 1; }
.crm-page-subtitle {
    margin: 3px 0 0 32px;
    font-size: 12px;
    color: var(--crm-text-muted);
    font-weight: 400;
}
.crm-page-head-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────── */
.crm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
    line-height: 1;
    white-space: nowrap;
}
.crm-btn-primary {
    background: var(--crm-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
}
.crm-btn-primary:hover { background: var(--crm-primary-dark); color: #fff; text-decoration: none; }
.crm-btn-ghost {
    background: #fff;
    color: var(--crm-text-muted);
    border-color: var(--crm-border);
}
.crm-btn-ghost:hover { background: var(--crm-bg-subtle); color: var(--crm-text); text-decoration: none; }
.crm-btn-neutral {
    background: var(--crm-bg-subtle);
    color: var(--crm-text-muted);
    border-color: var(--crm-border);
}
.crm-btn-neutral:hover { background: #eef2ff; color: var(--crm-text); text-decoration: none; }
.crm-btn-success {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.22);
}
.crm-btn-success:hover { background: #15803d; color: #fff; text-decoration: none; }
.crm-btn-danger {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.22);
}
.crm-btn-danger:hover { background: #dc2626; color: #fff; text-decoration: none; }
.crm-btn-sm { padding: 6px 10px; font-size: 11px; }

/* ── Cards ────────────────────────────────────────────── */
.crm-card {
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    box-shadow: var(--crm-shadow);
    margin-bottom: 16px;
    overflow: hidden;
}
.crm-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--crm-border);
    background: #fff;
}
.crm-card-head > span:first-child,
.crm-card-head > strong:first-child {
    font-size: 13px;
    font-weight: 700;
    color: var(--crm-text);
}
.crm-card-body { padding: 16px 18px; }
.crm-card-body-flush { padding: 0; }

/* ── Money bar (stat row) ─────────────────────────────── */
.crm-money-bar {
    display: flex;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    box-shadow: var(--crm-shadow);
    overflow: hidden;
    margin-bottom: 16px;
}
.crm-money-seg {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border-right: 1px solid var(--crm-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    display: block;
}
.crm-money-seg:last-child { border-right: none; }
.crm-money-seg:hover { background: var(--crm-bg-subtle); text-decoration: none; color: inherit; }
.crm-money-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--crm-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.crm-money-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--crm-text);
    line-height: 1.2;
}
.crm-money-sub {
    font-size: 11px;
    color: var(--crm-text-dim);
    margin-top: 2px;
}
@media (max-width: 1100px) {
    .crm-money-bar { flex-wrap: wrap; }
    .crm-money-seg { flex: 1 1 50%; border-bottom: 1px solid var(--crm-border); }
    .crm-money-seg:nth-child(2n) { border-right: none; }
}
@media (max-width: 640px) {
    .crm-money-seg { flex: 1 1 100%; border-right: none; }
}

/* ── Pills ────────────────────────────────────────────── */
.crm-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #e5e7eb;
    color: var(--crm-text-muted);
    white-space: nowrap;
}
.crm-pill-new          { background: #e0e7ff; color: #4338ca; }
.crm-pill-contacted    { background: #dbeafe; color: #1d4ed8; }
.crm-pill-qualified    { background: #ccfbf1; color: #0f766e; }
.crm-pill-unqualified  { background: #f1f5f9; color: #64748b; }
.crm-pill-won          { background: #dcfce7; color: #15803d; }
.crm-pill-lost         { background: #fee2e2; color: #b91c1c; }
.crm-pill-open         { background: #dbeafe; color: #1d4ed8; }
.crm-pill-draft        { background: #f1f5f9; color: #64748b; }
.crm-pill-pending      { background: #fef3c7; color: #b45309; }
.crm-pill-overdue      { background: #fee2e2; color: #b91c1c; }
.crm-pill-done         { background: #dcfce7; color: #15803d; }
.crm-pill-hot          { background: #fed7aa; color: #c2410c; }
.crm-pill-cold         { background: #cffafe; color: #0e7490; }

/* ── Data table ──────────────────────────────────────── */
.crm-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.crm-data-table thead th {
    background: var(--crm-bg-subtle);
    padding: 10px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-text-dim);
    text-align: left;
    border-bottom: 1px solid var(--crm-border);
}
.crm-data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--crm-border-light);
    color: var(--crm-text);
    vertical-align: middle;
}
.crm-data-table tbody tr:last-child td { border-bottom: none; }
.crm-data-table tbody tr:hover td { background: #fafbff; }
.crm-data-table .crm-num { text-align: right; font-variant-numeric: tabular-nums; }
.crm-data-table a.crm-link { color: var(--crm-text); text-decoration: none; font-weight: 600; }
.crm-data-table a.crm-link:hover { color: var(--crm-primary); }

.crm-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--crm-text-dim);
    font-size: 13px;
}
.crm-empty-icon { font-size: 36px; display: block; margin-bottom: 10px; }
.crm-muted { color: var(--crm-text-muted); font-size: 12px; }

/* ── Toolbar / filter row ─────────────────────────────── */
.crm-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.crm-toolbar .form-control {
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--crm-border);
    font-size: 13px;
}
.crm-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--crm-text-muted);
    background: var(--crm-bg-subtle);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.crm-tab:hover { background: #eef2ff; color: var(--crm-text); text-decoration: none; }
.crm-tab.active {
    background: var(--crm-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
}

/* ── Kanban board ─────────────────────────────────────── */
.crm-kanban-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}
.crm-kanban-wrap::-webkit-scrollbar { height: 8px; }
.crm-kanban-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.crm-kanban {
    display: inline-flex;
    gap: 14px;
    min-width: max-content;
    padding: 4px 0 12px;
}
.crm-kanban-col {
    background: var(--crm-bg-subtle);
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 260px);
    position: relative;
    transition: flex-basis 0.2s, min-width 0.2s, max-width 0.2s, width 0.2s;
}
.crm-kanban-collapse-btn {
    background: transparent;
    border: 1px solid var(--crm-border);
    border-radius: 6px;
    width: 24px;
    height: 24px;
    padding: 0;
    color: var(--crm-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.crm-kanban-collapse-btn:hover {
    background: var(--crm-bg-subtle);
    color: var(--crm-primary);
}
.crm-kanban-col-value {
    font-size: 11px;
    font-weight: 600;
}
.crm-kanban-col-collapsed-label { display: none; }

/* Collapsed state — 48px vertical strip */
.crm-kanban-col.collapsed {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    flex: 0 0 48px;
    cursor: pointer;
    background: #fff;
}
.crm-kanban-col.collapsed .crm-kanban-col-head,
.crm-kanban-col.collapsed .crm-kanban-col-body {
    display: none;
}
.crm-kanban-col.collapsed .crm-kanban-col-collapsed-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    height: 100%;
    min-height: 260px;
}
.crm-kanban-col.collapsed .crm-kanban-col-collapsed-label .crm-kanban-col-dot {
    margin-top: 2px;
}
.crm-kanban-col.collapsed .crm-kanban-col-vname {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-text);
    white-space: nowrap;
}
.crm-kanban-col.collapsed .crm-kanban-col-vcount {
    font-size: 11px;
    font-weight: 700;
    color: var(--crm-text-muted);
    background: var(--crm-bg-subtle);
    border-radius: 10px;
    padding: 2px 8px;
    margin-top: auto;
}
.crm-kanban-col.collapsed:hover {
    background: var(--crm-bg-subtle);
}
.crm-kanban-col-head {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--crm-border);
    background: #fff;
    border-radius: 12px 12px 0 0;
}
.crm-kanban-col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--crm-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.crm-kanban-col-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.crm-kanban-col-total {
    font-size: 11px;
    color: var(--crm-text-muted);
    font-weight: 600;
}
.crm-kanban-col-body {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 80px;
    transition: background 0.15s;
}
.crm-kanban-col-body.drag-over {
    background: #eef2ff;
    outline: 2px dashed var(--crm-primary);
    outline-offset: -6px;
    border-radius: 0 0 12px 12px;
}
.crm-kanban-card {
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    border-left: 3px solid var(--crm-primary);
}
.crm-kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--crm-shadow-hover);
}
.crm-kanban-card.dragging { opacity: 0.4; transform: rotate(2deg); }
.crm-kanban-card.won { border-left-color: #22c55e; }
.crm-kanban-card.lost { border-left-color: #ef4444; opacity: 0.7; }
.crm-kanban-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--crm-text);
    margin-bottom: 6px;
    line-height: 1.3;
}
.crm-kanban-card-title a { color: inherit; text-decoration: none; }
.crm-kanban-card-title a:hover { color: var(--crm-primary); }
.crm-kanban-card-value {
    font-size: 14px;
    font-weight: 700;
    color: #16a34a;
    margin-bottom: 6px;
}
.crm-kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--crm-text-dim);
    flex-wrap: wrap;
}
.crm-kanban-card-meta .meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--crm-bg-subtle);
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--crm-text-muted);
    font-weight: 500;
}

/* ── Deal detail layout ──────────────────────────────── */
.crm-detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
    align-items: start;
}
@media (max-width: 900px) {
    .crm-detail-layout { grid-template-columns: 1fr; }
}
.crm-stage-progress {
    display: flex;
    gap: 3px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 10px;
    padding: 6px;
}
.crm-stage-step {
    flex: 1;
    padding: 9px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    border-radius: 7px;
    color: #fff;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.15s;
    cursor: pointer;
    border: none;
}
.crm-stage-step:hover { opacity: 0.9; transform: translateY(-1px); }
.crm-stage-step.active { opacity: 1; box-shadow: 0 2px 6px rgba(0,0,0,0.18); }
.crm-stage-step.past { opacity: 0.75; }

.crm-status-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}
.crm-status-banner.won  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.crm-status-banner.lost { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.crm-status-banner.open { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

.crm-sidebar-value {
    font-size: 28px;
    font-weight: 800;
    color: #16a34a;
    line-height: 1;
}
.crm-sidebar-value-sub {
    font-size: 11px;
    color: var(--crm-text-dim);
    margin: 4px 0 12px;
}
.crm-sidebar-info > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--crm-border-light);
    font-size: 12px;
}
.crm-sidebar-info > div:last-child { border-bottom: none; }
.crm-sidebar-info .crm-info-label { color: var(--crm-text-dim); font-weight: 500; }
.crm-sidebar-info .crm-info-value { color: var(--crm-text); font-weight: 600; text-align: right; }

/* ── Timeline ─────────────────────────────────────────── */
.crm-timeline { position: relative; }
.crm-timeline-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--crm-border-light);
}
.crm-timeline-item:last-child { border-bottom: none; padding-bottom: 2px; }
.crm-timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--crm-bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.crm-timeline-icon.call     { background: #dbeafe; }
.crm-timeline-icon.email    { background: #e0e7ff; }
.crm-timeline-icon.meeting  { background: #fef3c7; }
.crm-timeline-icon.note     { background: #f1f5f9; }
.crm-timeline-icon.task     { background: #ccfbf1; }
.crm-timeline-body { flex: 1; }
.crm-timeline-subject {
    font-size: 13px;
    font-weight: 600;
    color: var(--crm-text);
}
.crm-timeline-subject.completed {
    text-decoration: line-through;
    color: var(--crm-text-dim);
}
.crm-timeline-desc {
    font-size: 12px;
    color: var(--crm-text-muted);
    margin-top: 2px;
    line-height: 1.5;
}
.crm-timeline-meta {
    font-size: 11px;
    color: var(--crm-text-dim);
    margin-top: 5px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.crm-timeline-meta a { color: var(--crm-primary); text-decoration: none; font-weight: 500; }
.crm-timeline-meta a:hover { text-decoration: underline; }

/* ── Forms ────────────────────────────────────────────── */
.crm-form .form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
    display: block;
}
.crm-form .form-control {
    border-radius: 8px;
    border: 1px solid var(--crm-border);
    font-size: 13px;
    padding: 8px 12px;
    height: auto;
    min-height: 38px;
    box-shadow: none;
}
.crm-form .form-control:focus {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.crm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.crm-form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .crm-form-grid { grid-template-columns: 1fr; } }

/* ── Avatar ───────────────────────────────────────────── */
.crm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}
.crm-avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.crm-avatar-lg { width: 48px; height: 48px; font-size: 16px; }

.crm-rating {
    display: inline-flex;
    gap: 2px;
    color: #fbbf24;
    font-size: 12px;
}
.crm-rating .star-empty { color: #e5e7eb; }

/* ── Modal override (cleaner than gradient) ───────────── */
.crm-modal .modal-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}
.crm-modal .modal-header {
    border-bottom: 1px solid var(--crm-border);
    padding: 14px 20px;
}
.crm-modal .modal-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--crm-text);
    margin: 0;
}
.crm-modal .modal-body { padding: 18px 20px; }
.crm-modal .modal-footer { border-top: 1px solid var(--crm-border); padding: 12px 20px; }

/* ── Sub-nav (persistent CRM tab bar) ─────────────────── */
.crm-subnav {
    display: flex;
    gap: 2px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--crm-border);
    flex-wrap: wrap;
    align-items: center;
}
.crm-subnav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--crm-text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.crm-subnav-item:hover { background: var(--crm-bg-subtle); color: var(--crm-text); text-decoration: none; }
.crm-subnav-item.active { background: #eef2ff; color: var(--crm-primary); }
.crm-subnav-item i { font-size: 12px; }

/* ── Global "+ New" dropdown ──────────────────────────── */
.crm-new-wrap { position: relative; }
.crm-new-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 260px;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
    padding: 8px;
    z-index: 1000;
    display: none;
}
.crm-new-menu.open { display: block; }
.crm-new-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--crm-text);
    transition: background 0.15s;
}
.crm-new-item:hover { background: var(--crm-bg-subtle); text-decoration: none; color: var(--crm-text); }
.crm-new-item strong { font-size: 13px; font-weight: 700; display: block; }
.crm-new-sub { font-size: 11px; color: var(--crm-text-dim); margin-top: 1px; }
.crm-new-ic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Empty state (hero) ───────────────────────────────── */
.crm-empty-hero {
    background: #fff;
    border: 2px dashed var(--crm-border);
    border-radius: 14px;
    padding: 56px 24px;
    text-align: center;
    margin-bottom: 18px;
}
.crm-empty-hero .hero-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}
.crm-empty-hero h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--crm-text);
}
.crm-empty-hero p {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--crm-text-muted);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Charts / Dashboard widgets ───────────────────────── */
.crm-widget-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.crm-widget-grid .span-8 { grid-column: span 8; }
.crm-widget-grid .span-6 { grid-column: span 6; }
.crm-widget-grid .span-4 { grid-column: span 4; }
.crm-widget-grid .span-12 { grid-column: span 12; }
@media (max-width: 1100px) {
    .crm-widget-grid .span-8,
    .crm-widget-grid .span-6,
    .crm-widget-grid .span-4 { grid-column: span 12; }
}
.crm-chart-wrap { position: relative; height: 260px; }

/* Mini activity feed items */
.crm-feed-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--crm-border-light);
    font-size: 12px;
}
.crm-feed-item:last-child { border-bottom: none; }
.crm-feed-item .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--crm-primary); margin-top: 6px; flex-shrink: 0;
}
.crm-feed-item .text { flex: 1; color: var(--crm-text); }
.crm-feed-item .when { color: var(--crm-text-dim); font-size: 11px; }

/* Funnel chart (pure CSS) */
.crm-funnel { padding: 6px 0; }
.crm-funnel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
}
.crm-funnel-label {
    width: 110px;
    font-weight: 600;
    color: var(--crm-text);
    text-transform: capitalize;
}
.crm-funnel-bar {
    flex: 1;
    height: 22px;
    background: var(--crm-bg-subtle);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}
.crm-funnel-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--crm-primary), #8b5cf6);
    border-radius: 6px;
}
.crm-funnel-count {
    min-width: 54px;
    text-align: right;
    font-weight: 700;
    color: var(--crm-text);
    font-variant-numeric: tabular-nums;
}

/* Kanban toolbar */
.crm-kanban-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.crm-kanban-toolbar .form-control { height: 36px; border-radius: 8px; font-size: 13px; }
.crm-kanban-col.filtered-empty .crm-kanban-col-body { opacity: 0.5; }

/* ── Print ────────────────────────────────────────────── */
@media print {
    .crm-kanban { flex-wrap: wrap; }
    .crm-kanban-col { min-width: 200px; page-break-inside: avoid; }
    .crm-btn, .crm-page-head-actions, .crm-subnav { display: none !important; }
}
