/* ===== CRM Custom Styles ===== */
:root {
    --crm-primary: #4e73df;
    --crm-success: #1cc88a;
    --crm-warning: #f6c23e;
    --crm-danger:  #e74a3b;
}

/* Sidebar */
.sidebar .nav-item .nav-link { padding: .75rem 1rem; font-size: .85rem; }
.sidebar .nav-item .nav-link i { margin-right: .5rem; font-size: 1rem; width: 1.2rem; text-align: center; }
.sidebar-brand { padding: 1.5rem 1rem; }

/* Cards */
.card { border: none; border-radius: .5rem; }
.card.border-left-primary  { border-left: .25rem solid var(--crm-primary) !important; }
.card.border-left-success  { border-left: .25rem solid var(--crm-success) !important; }
.card.border-left-warning  { border-left: .25rem solid var(--crm-warning) !important; }
.card.border-left-danger   { border-left: .25rem solid var(--crm-danger) !important; }
.card.border-left-info     { border-left: .25rem solid #36b9cc !important; }
.card.border-left-secondary{ border-left: .25rem solid #858796 !important; }
.card-header { background: #fff; border-bottom: 1px solid #e3e6f0; font-weight: 600; }

/* Tables */
.table th { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #858796; }
.table td { vertical-align: middle; font-size: .875rem; }
.table-hover tbody tr:hover { background: #f8f9fc; }

/* Badges */
.badge { font-size: .72rem; font-weight: 600; padding: .3em .65em; border-radius: .35rem; }
.badge-pill { border-radius: 50rem; }

/* Buttons */
.btn-sm { font-size: .8rem; padding: .25rem .65rem; }
.btn-group-sm > .btn { font-size: .78rem; }

/* Progress bar */
.progress { border-radius: .5rem; background: #eaecf4; }
.progress-bar { border-radius: .5rem; }

/* Kanban */
.lead-card { cursor: grab; transition: transform .15s, box-shadow .15s; border-radius: .4rem; }
.lead-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12) !important; }
#kanban-board .card-body { overflow-y: auto; max-height: 60vh; }

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

/* Ticket reply bubbles */
.reply-bubble { border-radius: .5rem; padding: 1rem; margin-bottom: .75rem; }
.reply-bubble.staff  { background: #eef2ff; border-left: 3px solid var(--crm-primary); }
.reply-bubble.client { background: #f8f9fc; border-left: 3px solid var(--crm-success); }

/* Form labels */
label.font-weight-bold { font-size: .82rem; color: #495057; margin-bottom: .25rem; }

/* Topbar search */
.navbar-search .form-control { font-size: .85rem; }

/* Sticky footer */
.sticky-footer { padding: 1rem 0; flex-shrink: 0; }
.sticky-footer .copyright { color: #b7b9cc; font-size: .8rem; }

/* Responsive */
@media (max-width: 768px) {
    .container-fluid { padding: 0 .75rem; }
    .card-body { padding: .75rem; }
    #kanban-board > div { min-width: 280px; }
    #kanban-board { display: flex; overflow-x: auto; flex-wrap: nowrap; }
}

/* Print / PDF */
@media print {
    .sidebar, .topbar, .sticky-footer, .btn, .modal { display: none !important; }
    #content-wrapper { margin-left: 0 !important; }
}

/* Animate */
.animated--grow-in { animation: growIn .2s ease-in-out; }
@keyframes growIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Timeline for ticket replies */
.timeline-item { position: relative; padding-left: 3rem; margin-bottom: 1.5rem; }
.timeline-item::before { content: ''; position: absolute; left: 1rem; top: 0; bottom: -1.5rem; width: 2px; background: #e3e6f0; }
.timeline-icon { position: absolute; left: 0; width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
