/* ============================================
   SALES AGENT AI — Dashboard Theme v2
   Modern SaaS dark UI with sidebar
   ============================================ */

/* --- CSS Variables (Design Tokens) --- */
:root {
    --ho-bg:          #0b0d14;
    --ho-surface:     #12151e;
    --ho-surface-2:   #1a1e2b;
    --ho-surface-3:   #222738;
    --ho-border:      #272d40;
    --ho-border-light:#353b50;
    --ho-text:        #e2e4ea;
    --ho-text-muted:  #8b90a0;
    --ho-text-dim:    #5c6178;
    --ho-accent:      #4f8ff7;
    --ho-accent-dim:  rgba(79, 143, 247, 0.12);
    --ho-accent-glow: rgba(79, 143, 247, 0.25);
    --ho-green:       #34d399;
    --ho-green-dim:   rgba(52, 211, 153, 0.12);
    --ho-yellow:      #fbbf24;
    --ho-yellow-dim:  rgba(251, 191, 36, 0.10);
    --ho-red:         #f87171;
    --ho-red-dim:     rgba(248, 113, 113, 0.10);
    --ho-cyan:        #22d3ee;
    --ho-cyan-dim:    rgba(34, 211, 238, 0.10);
    --ho-purple:      #a78bfa;
    --ho-purple-dim:  rgba(167, 139, 250, 0.10);
    --ho-radius:      12px;
    --ho-radius-sm:   8px;
    --ho-radius-xs:   5px;
    --ho-shadow:      0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.15);
    --ho-shadow-lg:   0 4px 24px rgba(0,0,0,0.35);
    --ho-transition:  0.2s ease;
    --sidebar-w:      240px;
    --sidebar-collapsed-w: 60px;
    --topbar-h:       56px;
    --bottomnav-h:    64px;
}

/* --- Global --- */
*,
*::before,
*::after { box-sizing: border-box; }

body {
    background: var(--ho-bg);
    color: var(--ho-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===================================
   LAYOUT: Sidebar + Main
   =================================== */

/* --- Sidebar (Desktop) --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--ho-surface);
    border-right: 1px solid var(--ho-border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.3s ease;
}
.sidebar-brand {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid var(--ho-border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}
.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    color: var(--ho-text);
    line-height: 1.2;
}
.sidebar-brand-text small {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--ho-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.8rem 0.6rem;
    overflow-y: auto;
}
.sidebar-nav-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ho-text-dim);
    padding: 0.8rem 0.7rem 0.3rem;
    margin-top: 0.3rem;
}
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    margin: 1px 0;
    border-radius: var(--ho-radius-sm);
    color: var(--ho-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.82rem;
    transition: all var(--ho-transition);
    position: relative;
}
.sidebar-nav-item i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-nav-item:hover {
    background: var(--ho-surface-2);
    color: var(--ho-text);
}
.sidebar-nav-item.active {
    background: var(--ho-accent-dim);
    color: var(--ho-accent);
    font-weight: 600;
}
.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ho-accent);
}
.sidebar-nav-badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15em 0.5em;
    border-radius: 10px;
    background: var(--ho-accent-dim);
    color: var(--ho-accent);
}
.sidebar-nav-badge.hot {
    background: var(--ho-red-dim);
    color: var(--ho-red);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.8rem;
    border-top: 1px solid var(--ho-border);
}

/* --- Main content area --- */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

/* --- Top bar (inside main) --- */
.topbar {
    height: var(--topbar-h);
    background: var(--ho-surface);
    border-bottom: 1px solid var(--ho-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(16px);
    background: rgba(18, 21, 30, 0.85);
}
.topbar-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ho-text);
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Page content --- */
.page-content {
    padding: 1.5rem 2rem;
    max-width: 1800px;
}

/* --- Mobile hamburger --- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--ho-text);
    font-size: 1.3rem;
    padding: 0.3rem;
    cursor: pointer;
}

/* --- Mobile Bottom Nav --- */
.bottom-nav {
    display: none;
}

/* ===================================
   MOBILE RESPONSIVE
   =================================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--ho-shadow-lg);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 1035;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottomnav-h) + 1rem);
    }
    .sidebar-toggle {
        display: block;
    }

    /* Bottom Navigation */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottomnav-h);
        background: var(--ho-surface);
        border-top: 1px solid var(--ho-border);
        z-index: 1040;
        justify-content: space-around;
        align-items: center;
        padding: 0 0.25rem;
        padding-bottom: env(safe-area-inset-bottom, 0);
        backdrop-filter: blur(16px);
        background: rgba(18, 21, 30, 0.92);
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        padding: 0.3rem 0.6rem;
        border-radius: var(--ho-radius-sm);
        color: var(--ho-text-dim);
        text-decoration: none;
        font-size: 0.6rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        transition: all var(--ho-transition);
        min-width: 52px;
    }
    .bottom-nav-item i {
        font-size: 1.15rem;
    }
    .bottom-nav-item:hover,
    .bottom-nav-item.active {
        color: var(--ho-accent);
    }
    .bottom-nav-item.active {
        background: var(--ho-accent-dim);
    }

    .page-content {
        padding: 1rem;
    }
    .topbar {
        padding: 0 1rem;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 0.75rem;
    }
    .topbar {
        padding: 0 0.75rem;
    }
}


/* ===================================
   CARDS
   =================================== */
.card {
    background: var(--ho-surface);
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius);
    box-shadow: var(--ho-shadow);
    transition: border-color var(--ho-transition), box-shadow var(--ho-transition);
}
.card:hover {
    border-color: var(--ho-border-light);
}
.card-header {
    background: var(--ho-surface-2);
    border-bottom: 1px solid var(--ho-border);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ho-text-muted);
    padding: 0.65rem 1rem;
    border-radius: var(--ho-radius) var(--ho-radius) 0 0;
}
.card-body {
    padding: 1rem;
}

/* --- Stat Cards --- */
.stat-card {
    border: 1px solid var(--ho-border) !important;
    position: relative;
    overflow: hidden;
    border-radius: var(--ho-radius) !important;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.stat-card.border-primary::before  { background: linear-gradient(90deg, var(--ho-accent), #7c3aed); }
.stat-card.border-success::before  { background: linear-gradient(90deg, var(--ho-green), #06b6d4); }
.stat-card.border-info::before     { background: linear-gradient(90deg, var(--ho-cyan), var(--ho-accent)); }
.stat-card.border-warning::before  { background: linear-gradient(90deg, var(--ho-yellow), #f97316); }
.stat-card.border-danger::before   { background: linear-gradient(90deg, var(--ho-red), #ec4899); }

/* Also handle .card.text-center for stat card compatibility */
.card.text-center {
    border: 1px solid var(--ho-border) !important;
    position: relative;
    overflow: hidden;
}
.card.text-center::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--ho-radius) var(--ho-radius) 0 0;
}
.card.text-center.border-primary::before  { background: linear-gradient(90deg, var(--ho-accent), #7c3aed); }
.card.text-center.border-success::before  { background: linear-gradient(90deg, var(--ho-green), #06b6d4); }
.card.text-center.border-info::before     { background: linear-gradient(90deg, var(--ho-cyan), var(--ho-accent)); }
.card.text-center.border-warning::before  { background: linear-gradient(90deg, var(--ho-yellow), #f97316); }
.card.text-center h2 {
    font-weight: 700;
    font-size: 1.75rem;
    letter-spacing: -0.03em;
}
.card.text-center small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ho-text-muted);
}


/* ===================================
   TABLES
   =================================== */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--ho-surface-2);
    color: var(--ho-text);
    margin-bottom: 0;
}
.table thead th {
    background: var(--ho-surface-2);
    border-bottom: 1px solid var(--ho-border);
    color: var(--ho-text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
}
.table tbody td {
    border-bottom: 1px solid var(--ho-border);
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
    font-size: 0.82rem;
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.table tbody tr:hover {
    background: var(--ho-surface-2) !important;
}
.table-sm td, .table-sm th {
    padding: 0.45rem 0.65rem;
}
/* Responsive table wrapper */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}


/* ===================================
   BADGES
   =================================== */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    padding: 0.3em 0.6em;
    border-radius: var(--ho-radius-xs);
}
.badge.bg-secondary { background: var(--ho-surface-3) !important; color: var(--ho-text-muted); }
.badge.bg-primary   { background: var(--ho-accent-dim) !important; color: var(--ho-accent); }
.badge.bg-success   { background: var(--ho-green-dim) !important; color: var(--ho-green); }
.badge.bg-warning   { background: var(--ho-yellow-dim) !important; color: var(--ho-yellow); }
.badge.bg-danger    { background: var(--ho-red-dim) !important; color: var(--ho-red); }
.badge.bg-info      { background: var(--ho-cyan-dim) !important; color: var(--ho-cyan); }
.badge.bg-dark      { background: var(--ho-surface-3) !important; color: var(--ho-text-dim); }
a.badge { text-decoration: none !important; }
a.badge:hover { filter: brightness(1.2); }


/* ===================================
   BUTTONS
   =================================== */
.btn {
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--ho-radius-sm);
    padding: 0.45rem 1rem;
    transition: all var(--ho-transition);
    letter-spacing: 0.01em;
}
.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.76rem;
    border-radius: var(--ho-radius-xs);
}
.btn-primary {
    background: linear-gradient(135deg, var(--ho-accent), #6366f1);
    border: none;
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #6ea8f9, #818cf8);
    box-shadow: 0 0 16px var(--ho-accent-glow);
}
.btn-success {
    background: var(--ho-green);
    border-color: var(--ho-green);
    color: #0f1117;
}
.btn-success:hover {
    background: #2fc08a;
    border-color: #2fc08a;
    color: #0f1117;
}
.btn-outline-primary {
    color: var(--ho-accent);
    border-color: var(--ho-border-light);
}
.btn-outline-primary:hover {
    background: var(--ho-accent-dim);
    color: var(--ho-accent);
    border-color: var(--ho-accent);
}
.btn-outline-success {
    color: var(--ho-green);
    border-color: var(--ho-border-light);
}
.btn-outline-success:hover {
    background: var(--ho-green-dim);
    color: var(--ho-green);
    border-color: var(--ho-green);
}
.btn-outline-info {
    color: var(--ho-cyan);
    border-color: var(--ho-border-light);
}
.btn-outline-info:hover {
    background: var(--ho-cyan-dim);
    color: var(--ho-cyan);
    border-color: var(--ho-cyan);
}
.btn-outline-warning {
    color: var(--ho-yellow);
    border-color: var(--ho-border-light);
}
.btn-outline-warning:hover {
    background: var(--ho-yellow-dim);
    color: var(--ho-yellow);
    border-color: var(--ho-yellow);
}
.btn-outline-secondary {
    color: var(--ho-text-muted);
    border-color: var(--ho-border-light);
}
.btn-outline-secondary:hover {
    background: var(--ho-surface-3);
    color: var(--ho-text);
    border-color: var(--ho-text-muted);
}
.btn-outline-light {
    color: var(--ho-text-muted);
    border-color: var(--ho-border);
    font-size: 0.72rem;
}
.btn-outline-light:hover {
    background: var(--ho-surface-3);
    color: var(--ho-text);
    border-color: var(--ho-border-light);
}
.btn-outline-danger {
    color: var(--ho-red);
    border-color: var(--ho-border-light);
}
.btn-outline-danger:hover {
    background: var(--ho-red-dim);
    color: var(--ho-red);
    border-color: var(--ho-red);
}


/* ===================================
   FORMS
   =================================== */
.form-select,
.form-control {
    background: var(--ho-surface-2);
    border: 1px solid var(--ho-border);
    color: var(--ho-text);
    border-radius: var(--ho-radius-sm);
    font-size: 0.82rem;
    transition: border-color var(--ho-transition), box-shadow var(--ho-transition);
}
.form-select:focus,
.form-control:focus {
    background: var(--ho-surface-2);
    border-color: var(--ho-accent);
    box-shadow: 0 0 0 3px var(--ho-accent-dim);
    color: var(--ho-text);
}
.form-select-sm,
.form-control-sm {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
}
.form-label {
    color: var(--ho-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ===================================
   TABS
   =================================== */
.nav-tabs {
    border-bottom: 1px solid var(--ho-border);
    gap: 2px;
}
.nav-tabs .nav-link {
    color: var(--ho-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.65rem 1.2rem;
    transition: all var(--ho-transition);
}
.nav-tabs .nav-link:hover {
    color: var(--ho-text);
    border-bottom-color: var(--ho-border-light);
    background: transparent;
}
.nav-tabs .nav-link.active {
    color: var(--ho-accent);
    background: transparent;
    border-color: transparent;
    border-bottom-color: var(--ho-accent);
}
.nav-tabs .nav-link .badge {
    font-size: 0.65rem;
    vertical-align: 1px;
}


/* ===================================
   PROGRESS BARS
   =================================== */
.progress {
    background: var(--ho-surface-3);
    border-radius: var(--ho-radius-sm);
    overflow: hidden;
}
.progress-bar {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: width 0.6s ease;
}


/* ===================================
   LIST GROUPS (Inbox etc.)
   =================================== */
.list-group-item {
    background: transparent;
    border-color: var(--ho-border);
    color: var(--ho-text);
    transition: background var(--ho-transition);
}
.list-group-item:hover,
.list-group-item-action:hover {
    background: var(--ho-surface-2);
    color: var(--ho-text);
}
.inbox-list .list-group-item.active-msg {
    background: var(--ho-surface-2);
    border-left: 3px solid var(--ho-accent);
}


/* ===================================
   PAGINATION
   =================================== */
.pagination .page-link {
    background: var(--ho-surface);
    border-color: var(--ho-border);
    color: var(--ho-text-muted);
    font-size: 0.78rem;
    font-weight: 500;
}
.pagination .page-link:hover {
    background: var(--ho-surface-2);
    color: var(--ho-text);
    border-color: var(--ho-border-light);
}
.pagination .page-item.active .page-link {
    background: var(--ho-accent-dim);
    border-color: var(--ho-accent);
    color: var(--ho-accent);
}


/* ===================================
   ALERTS / TOASTS
   =================================== */
.alert {
    border-radius: var(--ho-radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
}
.alert-success { background: var(--ho-green-dim); color: var(--ho-green); }
.alert-danger  { background: var(--ho-red-dim); color: var(--ho-red); }
.alert-warning { background: var(--ho-yellow-dim); color: var(--ho-yellow); }
.alert-info    { background: var(--ho-cyan-dim); color: var(--ho-cyan); }

#toast-container {
    z-index: 1080;
    max-width: 420px;
    width: auto;
}
#toast-container .alert {
    background: var(--ho-card-bg);
    border: 1px solid var(--ho-border);
    color: var(--ho-text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    pointer-events: auto;
    animation: toastSlideUp 0.25s ease-out;
}
#toast-container .alert-success { border-left: 3px solid var(--ho-green, #3bbea0); }
#toast-container .alert-danger { border-left: 3px solid #e74c3c; }
#toast-container .alert-warning { border-left: 3px solid #f0ad4e; }
#toast-container .alert-info { border-left: 3px solid var(--ho-accent); }
@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* Lead row fade-in animation */
@keyframes leadFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lead-row-new {
    animation: leadFadeIn 0.4s ease-out both;
}
.lead-row-new:nth-child(1)  { animation-delay: 0s; }
.lead-row-new:nth-child(2)  { animation-delay: 0.04s; }
.lead-row-new:nth-child(3)  { animation-delay: 0.08s; }
.lead-row-new:nth-child(4)  { animation-delay: 0.12s; }
.lead-row-new:nth-child(5)  { animation-delay: 0.16s; }
/* Live search: rows appended one-by-one via OOB */
.lead-fade-in {
    animation: leadFadeIn 0.5s ease-out both;
}
.lead-row-new:nth-child(6)  { animation-delay: 0.2s; }
.lead-row-new:nth-child(7)  { animation-delay: 0.24s; }
.lead-row-new:nth-child(8)  { animation-delay: 0.28s; }
.lead-row-new:nth-child(9)  { animation-delay: 0.32s; }
.lead-row-new:nth-child(10) { animation-delay: 0.36s; }
.lead-row-new:nth-child(n+11) { animation-delay: 0.4s; }

/* ===================================
   TEXT & LINKS
   =================================== */
.text-muted {
    color: var(--ho-text-muted) !important;
}
a {
    color: var(--ho-accent);
    transition: color var(--ho-transition);
}
a:hover {
    color: #6ea8f9;
}
a.text-decoration-none:hover {
    color: var(--ho-accent);
}

/* Colors */
.text-primary { color: var(--ho-accent) !important; }
.text-success { color: var(--ho-green) !important; }
.text-info    { color: var(--ho-cyan) !important; }
.text-warning { color: var(--ho-yellow) !important; }
.text-danger  { color: var(--ho-red) !important; }


/* ===================================
   HEADINGS
   =================================== */
h4 {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: var(--ho-text);
}
h4 .text-muted {
    font-weight: 400;
    font-size: 0.85rem;
}
h6.card-title {
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ho-text-muted);
}


/* ===================================
   SCROLLBAR
   =================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--ho-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--ho-border-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--ho-text-dim);
}


/* ===================================
   HTMX LOADING STATES
   =================================== */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline-block;
}
.htmx-request .bi {
    display: none;
}
.htmx-request {
    opacity: 0.85;
    pointer-events: none;
}


/* ===================================
   AVATARS
   =================================== */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-sm { width: 36px; height: 36px; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

.avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.72rem;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}
.avatar-initials.avatar-sm { width: 36px; height: 36px; font-size: 0.72rem; }
.avatar-initials.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

.avatar-software  { background: var(--ho-accent); }
.avatar-ai        { background: var(--ho-purple); }
.avatar-translation { background: var(--ho-green); }
.avatar-marketing { background: #f59e0b; }
.avatar-web       { background: var(--ho-cyan); }
.avatar-production { background: var(--ho-red); }
.avatar-default   { background: var(--ho-text-dim); }


/* ===================================
   TIMELINE
   =================================== */
.timeline {
    position: relative;
    padding-left: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--ho-border);
}
.timeline-item {
    position: relative;
    padding-bottom: 1.2rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ho-border-light);
    border: 2px solid var(--ho-surface);
}
.timeline-item.tl-sent::before     { background: var(--ho-accent); }
.timeline-item.tl-received::before { background: var(--ho-green); }
.timeline-item.tl-connection::before { background: var(--ho-yellow); }
.timeline-item.tl-accepted::before { background: var(--ho-green); }
.timeline-item.tl-found::before    { background: var(--ho-text-dim); }
.timeline-item.tl-opened::before   { background: var(--ho-cyan); }

.timeline-msg {
    background: var(--ho-surface-2);
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius-sm);
    padding: 0.6rem 0.8rem;
    margin-top: 0.4rem;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
.timeline-msg.msg-outbound { border-left: 3px solid var(--ho-accent); }
.timeline-msg.msg-inbound  { border-left: 3px solid var(--ho-green); }

/* Email thread blocks (lead detail) */
.email-thread {
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius-sm);
    overflow: hidden;
}
.email-thread-header {
    padding: 0.6rem 0.75rem;
    background: var(--ho-surface-2);
    border-bottom: 1px solid var(--ho-border);
    font-size: 0.85rem;
}
.email-thread-body {
    padding: 0.75rem;
}
.email-thread-footer {
    padding: 0.4rem 0.75rem;
    background: var(--ho-surface-2);
    border-top: 1px solid var(--ho-border);
}


/* ===================================
   MODALS
   =================================== */
.modal-content {
    background: var(--ho-surface) !important;
    border: 1px solid var(--ho-border);
    color: var(--ho-text);
    border-radius: var(--ho-radius);
}
.modal-header { border-color: var(--ho-border); }
.modal-footer { border-color: var(--ho-border); }

/* Ultrawide modal sizing */
@media (min-width: 1600px) {
    .modal-xl { max-width: 70vw; }
}
@media (min-width: 2400px) {
    .modal-xl { max-width: 60vw; }
}

/* Modal timeline — messages fill available width */
.modal-body .timeline {
    max-width: 100%;
}
.modal-body .timeline-item {
    width: 100%;
}
.modal-body .timeline-msg {
    max-width: 100%;
    width: 100%;
}


/* ===================================
   RATE LIMIT BAR (LinkedIn)
   =================================== */
.rate-limit-bar .badge {
    font-size: 0.72rem;
    padding: 0.25em 0.55em;
}

/* LinkedIn Stat Cards Color Top Bars */
.card.text-center.border-primary  { border-color: var(--ho-border) !important; }
.card.text-center.border-success  { border-color: var(--ho-border) !important; }
.card.text-center.border-info     { border-color: var(--ho-border) !important; }
.card.text-center.border-warning  { border-color: var(--ho-border) !important; }


/* ===================================
   STAT CARDS v2 (with icons)
   =================================== */
.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ho-text-muted);
    margin-top: 0.15rem;
}
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.stat-icon-primary  { background: var(--ho-accent-dim); color: var(--ho-accent); }
.stat-icon-success  { background: var(--ho-green-dim); color: var(--ho-green); }
.stat-icon-warning  { background: var(--ho-yellow-dim); color: var(--ho-yellow); }
.stat-icon-danger   { background: var(--ho-red-dim); color: var(--ho-red); }
.stat-icon-info     { background: var(--ho-cyan-dim); color: var(--ho-cyan); }


/* ===================================
   ACTIONS STRIP (Overview)
   =================================== */
.actions-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
}
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 0.5rem;
    background: var(--ho-surface-2);
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius);
    cursor: pointer;
    transition: all var(--ho-transition);
    color: var(--ho-text);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}
.action-btn:hover {
    border-color: var(--ho-border-light);
    background: var(--ho-surface-2);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.action-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.action-icon-search   { background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(249,115,22,0.15)); color: var(--ho-yellow); }
.action-icon-linkedin { background: linear-gradient(135deg, rgba(34,211,238,0.15), rgba(79,143,247,0.15)); color: var(--ho-cyan); }
.action-icon-followup { background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(236,72,153,0.15)); color: var(--ho-purple); }
.action-icon-inbox    { background: linear-gradient(135deg, rgba(52,211,153,0.15), rgba(34,211,238,0.15)); color: var(--ho-green); }
/* HTMX loading on action buttons */
.action-btn.htmx-request {
    opacity: 0.7;
    pointer-events: none;
}
.action-btn.htmx-request .action-btn-icon i {
    display: inline-block !important;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================================
   PAGE HEADER (with back button)
   =================================== */
.page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.page-header-back {
    width: 36px;
    height: 36px;
    border-radius: var(--ho-radius-sm);
    background: var(--ho-surface);
    border: 1px solid var(--ho-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ho-text-muted);
    text-decoration: none;
    transition: all var(--ho-transition);
    flex-shrink: 0;
}
.page-header-back:hover {
    background: var(--ho-surface-2);
    color: var(--ho-text);
    border-color: var(--ho-border-light);
}
.page-header-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--ho-text);
}
.page-header-desc {
    font-size: 0.72rem;
    color: var(--ho-text-dim);
    margin: 0;
}

/* ===================================
   CUSTOM TABS
   =================================== */
.custom-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--ho-border);
    padding: 0 1.25rem;
}
.custom-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ho-text-dim);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--ho-transition);
    white-space: nowrap;
}
.custom-tab:hover {
    color: var(--ho-text-muted);
}
.custom-tab.active {
    color: var(--ho-accent);
    border-bottom-color: var(--ho-accent);
}
.custom-tab i {
    font-size: 0.85rem;
}
.custom-tab-count {
    font-size: 0.65rem;
    background: var(--ho-surface-3);
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-weight: 600;
}
.custom-tab.active .custom-tab-count {
    background: var(--ho-accent-dim);
    color: var(--ho-accent);
}

/* ===================================
   FILTERS BAR
   =================================== */
.filters-bar {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.filter-select {
    width: auto;
    max-width: 170px;
    min-width: 130px;
    background: var(--ho-surface-2) !important;
    border-color: var(--ho-border) !important;
    color: var(--ho-text) !important;
    font-size: 0.78rem !important;
    border-radius: var(--ho-radius-sm) !important;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%238b90a0' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.5rem center !important;
    background-size: 12px !important;
    padding-right: 1.75rem !important;
    cursor: pointer;
}
.filter-select:focus {
    border-color: var(--ho-accent) !important;
    box-shadow: 0 0 0 2px var(--ho-accent-dim) !important;
}
.filter-input {
    background: var(--ho-surface-2) !important;
    border-color: var(--ho-border) !important;
    color: var(--ho-text) !important;
    font-size: 0.78rem !important;
    border-radius: var(--ho-radius-sm) !important;
}
.filter-input:focus {
    border-color: var(--ho-accent) !important;
    box-shadow: 0 0 0 2px var(--ho-accent-dim) !important;
}
.filter-input::placeholder {
    color: var(--ho-text-dim) !important;
}

/* ===================================
   INBOX — Gmail-style
   =================================== */
.inbox-stats-bar {
    background: var(--ho-surface);
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius);
    padding: 0.75rem 1rem;
}
.inbox-filter-pills {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.inbox-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    color: var(--ho-text-muted);
    text-decoration: none;
    transition: var(--ho-transition);
    white-space: nowrap;
}
.inbox-pill:hover {
    background: var(--ho-surface-2);
    color: var(--ho-text);
}
.inbox-pill.active {
    background: var(--ho-accent-dim);
    color: var(--ho-accent);
    font-weight: 500;
}
.inbox-pill-badge {
    background: var(--ho-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.35rem;
    line-height: 1;
}
.inbox-pill-divider {
    width: 1px;
    height: 18px;
    background: var(--ho-border);
    margin: 0 0.35rem;
}

/* Two-panel layout */
.inbox-container {
    display: flex;
    gap: 0;
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius);
    overflow: hidden;
    min-height: calc(100vh - 220px);
    background: var(--ho-surface);
}
.inbox-list-panel {
    width: 380px;
    min-width: 320px;
    border-right: 1px solid var(--ho-border);
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}
.inbox-detail-panel {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    padding: 0;
}

/* Message rows */
.inbox-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid var(--ho-border);
    cursor: pointer;
    transition: background var(--ho-transition);
    gap: 0.5rem;
}
.inbox-row:hover {
    background: var(--ho-surface-2);
}
.inbox-row-active {
    background: var(--ho-accent-dim) !important;
    border-left: 3px solid var(--ho-accent);
}
.inbox-row-unread {
    background: rgba(79, 143, 247, 0.04);
}
.inbox-row-unread .inbox-row-sender {
    color: var(--ho-text);
    font-weight: 600;
}
.inbox-row-unread .inbox-row-subject {
    color: var(--ho-text);
    font-weight: 500;
}
.inbox-row-indicator {
    width: 28px;
    min-height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
}
.inbox-unread-dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ho-accent);
}
.inbox-row-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ho-surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--ho-text-muted);
}
.inbox-row-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.inbox-row-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.inbox-row-sender {
    font-size: 0.82rem;
    color: var(--ho-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inbox-row-time {
    font-size: 0.7rem;
    color: var(--ho-text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}
.inbox-row-subject {
    font-size: 0.78rem;
    color: var(--ho-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.inbox-row-preview {
    font-size: 0.73rem;
    color: var(--ho-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.inbox-row-replied {
    flex-shrink: 0;
    color: var(--ho-green);
    font-size: 0.8rem;
    padding-top: 0.3rem;
}

/* Empty state */
.inbox-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--ho-text-dim);
    font-size: 0.88rem;
}

/* Message detail styles */
.inbox-msg-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--ho-border);
}
.inbox-msg-subject {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ho-text);
    margin-bottom: 0.75rem;
}
.inbox-msg-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.inbox-msg-avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ho-surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--ho-text-muted);
}
.inbox-msg-from {
    flex: 1;
}
.inbox-msg-sender-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--ho-text);
    display: block;
}
.inbox-msg-sender-email {
    font-size: 0.75rem;
    color: var(--ho-text-dim);
}
.inbox-msg-date {
    font-size: 0.75rem;
    color: var(--ho-text-dim);
    white-space: nowrap;
}
.inbox-msg-body {
    padding: 1.25rem 1.5rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--ho-text);
    border-bottom: 1px solid var(--ho-border);
}

/* Reply sent */
.inbox-msg-reply-sent {
    margin: 1rem 1.5rem;
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius-sm);
    overflow: hidden;
}
.inbox-msg-reply-header {
    padding: 0.5rem 0.75rem;
    background: var(--ho-surface-2);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ho-green);
    border-bottom: 1px solid var(--ho-border);
}
.inbox-msg-reply-body {
    padding: 0.75rem;
    font-size: 0.85rem;
    color: var(--ho-text);
}

/* Reply compose box */
.inbox-msg-reply-box {
    margin: 1rem 1.5rem;
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius-sm);
    overflow: hidden;
    transition: border-color var(--ho-transition);
}
.inbox-msg-reply-box:focus-within {
    border-color: var(--ho-accent);
}
.inbox-reply-textarea {
    width: 100%;
    border: none;
    background: var(--ho-surface-2);
    color: var(--ho-text);
    padding: 0.75rem;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 100px;
    outline: none;
}
.inbox-reply-textarea::placeholder {
    color: var(--ho-text-dim);
}
.inbox-reply-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.75rem;
    background: var(--ho-surface-2);
    border-top: 1px solid var(--ho-border);
}

/* Message action buttons */
.inbox-msg-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}
.inbox-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--ho-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ho-transition);
    font-size: 0.9rem;
}
.inbox-action-btn:hover {
    background: var(--ho-surface-3);
    color: var(--ho-text);
}
.inbox-action-btn-sm {
    border: 1px solid var(--ho-border);
    background: transparent;
    color: var(--ho-text-dim);
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--ho-radius-xs);
    cursor: pointer;
    transition: var(--ho-transition);
}
.inbox-action-btn-sm:hover {
    background: var(--ho-surface-3);
    color: var(--ho-text);
    border-color: var(--ho-border-light);
}

/* Forward panel */
.inbox-forward-panel {
    padding: 0.6rem 1.5rem;
    background: var(--ho-surface-2);
    border-bottom: 1px solid var(--ho-border);
}

/* Reply header bar */
.inbox-reply-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: var(--ho-surface-3);
    border-bottom: 1px solid var(--ho-border);
}
.inbox-reply-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ho-text-muted);
}

/* CC row */
.inbox-cc-row {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--ho-border);
    background: var(--ho-surface-2);
}
.inbox-cc-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--ho-text);
    font-size: 0.8rem;
    padding: 0.25rem 0;
    outline: none;
}
.inbox-cc-input::placeholder {
    color: var(--ho-text-dim);
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .inbox-container {
        flex-direction: column;
        min-height: auto;
    }
    .inbox-list-panel {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid var(--ho-border);
        max-height: 40vh;
    }
    .inbox-detail-panel {
        max-height: none;
    }
}

/* ===================================
   ACTIVITY — Pipelines & Timeline
   =================================== */
/* Pipeline Rows — big colored bars */
.pipe-rows { padding: 0.25rem 0 0.5rem; }
.pipe-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0;
}
.pipe-label {
    width: 105px;
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ho-text-muted);
    white-space: nowrap;
}
.pipe-label i { opacity: 0.6; margin-right: 0.2rem; }
.pipe-track {
    flex: 1;
    height: 28px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    overflow: hidden;
}
.pipe-fill {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    min-width: 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.pipe-val {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.pipe-zero {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ho-text-dim);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
/* Bar colors */
.pipe-new          { background: linear-gradient(90deg, #64748b, #94a3b8); }
.pipe-contacted    { background: linear-gradient(90deg, #6366f1, #818cf8); }
.pipe-replied      { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.pipe-negotiating  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.pipe-won          { background: linear-gradient(90deg, #10b981, #34d399); }
.pipe-lost         { background: linear-gradient(90deg, #ef4444, #f87171); }

.activity-kpis > .flex-fill {
    min-width: 150px;
}

/* Activity Timeline (scoped to .timeline-list only) */
.tab-hint {
    font-size: 0.78rem;
    color: var(--ho-text-dim);
    margin: 0 0 0.75rem 0;
    padding: 0;
    line-height: 1.4;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.timeline-list .timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--ho-border);
    position: static;
    padding-bottom: 0;
}
.timeline-list .timeline-item::before {
    display: none;
}
.timeline-list .timeline-item:last-child {
    border-bottom: none;
}
.timeline-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.timeline-content {
    flex: 1;
    min-width: 0;
}
.timeline-desc {
    font-size: 0.82rem;
    color: var(--ho-text);
}
.timeline-subject {
    font-size: 0.75rem;
    color: var(--ho-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.timeline-time {
    font-size: 0.72rem;
    color: var(--ho-text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===================================
   DASHBOARD SECTIONS
   =================================== */
.dashboard-section {
    background: var(--ho-surface);
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--ho-border);
}
.section-title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ho-text-muted);
}
.section-title i {
    color: var(--ho-accent);
}
.section-link {
    font-size: 0.75rem;
    color: var(--ho-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--ho-transition);
}
.section-link:hover {
    color: var(--ho-text);
}
.section-body {
    /* no extra padding needed, parent has it */
}

/* --- Overview Action Links --- */
.overview-action-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--ho-radius-sm);
    text-decoration: none;
    color: var(--ho-text);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background var(--ho-transition);
}
.overview-action-link:hover {
    background: var(--ho-surface-2);
    color: var(--ho-text);
}
.overview-action-link > i:first-child {
    font-size: 0.9rem;
    color: var(--ho-text-muted);
    width: 1.2rem;
    text-align: center;
}
.overview-action-link:hover > i:first-child {
    color: var(--ho-accent);
}

/* --- Replies List --- */
.replies-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.reply-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--ho-radius-sm);
    text-decoration: none;
    color: var(--ho-text);
    transition: background var(--ho-transition);
}
.reply-item:hover {
    background: var(--ho-surface-2);
    color: var(--ho-text);
}
.reply-content {
    flex: 1;
    min-width: 0;
}
.reply-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.reply-sender {
    font-size: 0.82rem;
    color: var(--ho-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reply-sender.unread {
    color: var(--ho-text);
}
.reply-time {
    font-size: 0.68rem;
    color: var(--ho-text-dim);
    flex-shrink: 0;
}
.reply-subject {
    font-size: 0.75rem;
    color: var(--ho-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ho-text-dim);
}
.empty-state i {
    font-size: 2.5rem;
    opacity: 0.15;
    display: block;
    margin-bottom: 0.5rem;
}
.empty-state p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--ho-text-muted);
}
.empty-state small {
    font-size: 0.7rem;
}

/* ===================================
   USAGE BARS
   =================================== */
.usage-section {
    margin-top: 0;
}
.usage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 767.98px) {
    .usage-grid { grid-template-columns: 1fr; }
}
.usage-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}
.usage-item-label {
    font-size: 0.75rem;
    color: var(--ho-text-muted);
    font-weight: 500;
}
.usage-item-label i {
    font-size: 0.7rem;
}
.usage-item-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ho-text);
}
.usage-item-limit {
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--ho-text-dim);
}
.usage-item-card {
    background: var(--ho-surface-2);
    border: 1px solid var(--ho-border);
    border-radius: var(--ho-radius-sm);
    padding: 0.75rem;
}
.usage-bar {
    height: 6px;
    background: var(--ho-surface-3);
    border-radius: 3px;
    overflow: hidden;
}
.usage-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
    min-width: 2px;
}
.usage-bar-ai       { background: linear-gradient(90deg, var(--ho-purple), var(--ho-accent)); }
.usage-bar-email    { background: linear-gradient(90deg, var(--ho-green), var(--ho-cyan)); }
.usage-bar-linkedin { background: linear-gradient(90deg, var(--ho-cyan), var(--ho-accent)); }
.usage-bar-search   { background: linear-gradient(90deg, var(--ho-yellow), #f97316); }

/* Truncation utility */
.min-width-0 { min-width: 0; }


/* ===================================
   MOBILE SPECIFIC FIXES
   =================================== */
@media (max-width: 767.98px) {
    /* Stack stat cards 2x2 on mobile */
    .stat-card h2,
    .card.text-center h2 {
        font-size: 1.3rem;
    }
    .stat-card small,
    .card.text-center small {
        font-size: 0.62rem;
    }

    /* Better table readability on mobile */
    .table tbody td {
        font-size: 0.78rem;
        padding: 0.4rem 0.5rem;
    }
    .table thead th {
        font-size: 0.68rem;
        padding: 0.45rem 0.5rem;
    }

    /* Make tabs scroll horizontally */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.78rem;
        padding: 0.55rem 0.9rem;
    }

    /* Forms take full width */
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    .d-flex.gap-2 .btn {
        flex: 1 1 auto;
        min-width: 100px;
    }

    /* LinkedIn contacts table — hide less important columns on mobile */
    .table .col-hide-mobile {
        display: none;
    }
}
