/* ============================================================
   CRM Module — styles
   ============================================================ */

/* ── Layout helpers ─────────────────────────────────────── */
.module_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}
.module_header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
}
.module_header_actions {
    display: flex;
    gap: 8px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn           { display:inline-block; padding:7px 14px; border-radius:4px; font-size:13px; cursor:pointer; text-decoration:none; border:1px solid #ccc; background:#f5f5f5; color:#333; transition:background .15s; }
.btn:hover     { background:#e8e8e8; }
.btn_new       { background:#2980b9; border-color:#2471a3; color:#fff; }
.btn_new:hover { background:#2471a3; }
.btn_save      { background:#27ae60; border-color:#229954; color:#fff; }
.btn_save:hover{ background:#229954; }
.btn_cancel    { background:#95a5a6; border-color:#7f8c8d; color:#fff; }
.btn_cancel:hover { background:#7f8c8d; }
.btn_delete    { background:#e74c3c; border-color:#c0392b; color:#fff; }
.btn_delete:hover { background:#c0392b; }
.btn_ok        { background:#27ae60; border-color:#229954; color:#fff; }
.btn_ok:hover  { background:#229954; }
.btn_small     { padding:4px 10px; font-size:12px; }

/* ── Messages ────────────────────────────────────────────── */
.msg       { padding:10px 14px; border-radius:4px; margin-bottom:16px; font-size:13px; }
.msg.ok    { background:#d4edda; border:1px solid #c3e6cb; color:#155724; }
.msg.error { background:#f8d7da; border:1px solid #f5c6cb; color:#721c24; }

/* ── Dashboard stats ─────────────────────────────────────── */
.crm_stats_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.crm_stat_card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.crm_stat_value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}
.crm_stat_label {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.crm_stat_won .crm_stat_value { color: #27ae60; }
.crm_stat_lost .crm_stat_value { color: #e74c3c; }

/* ── Dashboard columns ────────────────────────────────────── */
.crm_dashboard_cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) { .crm_dashboard_cols { grid-template-columns: 1fr; } }

/* ── Panels ──────────────────────────────────────────────── */
.crm_panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.crm_panel_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.crm_panel_header h2,
.crm_panel_header h3 { margin: 0; font-size: 15px; color: #2c3e50; }
.crm_panel h3 { font-size: 15px; color: #2c3e50; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.crm_panel_alert { border-left: 4px solid #e74c3c; }

/* ── Pipeline mini (dashboard) ───────────────────────────── */
.crm_pipeline_mini { display: flex; flex-direction: column; gap: 8px; }
.crm_pipeline_stage_mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.crm_stage_dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.crm_stage_name { flex: 1; color: #444; }
.crm_stage_count { color: #888; font-size: 12px; }
.crm_stage_value { font-weight: 600; color: #2c3e50; }

/* ── Activity list ───────────────────────────────────────── */
.crm_activity_list { list-style: none; margin: 0; padding: 0; }
.crm_activity_item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.crm_activity_item:last-child { border-bottom: none; }
.crm_activity_icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.crm_activity_info { flex: 1; }
.crm_activity_info strong { display: block; color: #2c3e50; }
.crm_activity_info p { margin: 4px 0; color: #555; font-size: 12px; }
.crm_activity_meta { font-size: 11px; color: #999; display: block; margin-top: 3px; }
.crm_activity_full .crm_activity_item { padding: 14px 0; }

/* ── Task list ────────────────────────────────────────────── */
.crm_task_list { list-style: none; margin: 0; padding: 0; }
.crm_task_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.crm_task_item:last-child { border-bottom: none; }
.crm_task_info { flex: 1; }
.crm_task_info strong { display: block; color: #2c3e50; }
.crm_task_info span { font-size: 12px; color: #888; }
.crm_task_due { font-size: 12px; color: #e74c3c; font-weight: 600; min-width: 70px; }
.crm_task_overdue { background: #fff5f5; border-radius: 4px; padding: 8px 10px; }
.crm_task_done .crm_task_info strong { text-decoration: line-through; color: #aaa; }
.crm_task_status_badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.crm_task_pending { background: #fef9c3; color: #856404; }
.crm_task_done    { background: #d4edda; color: #155724; }
.crm_row_overdue  { background: #fff8f8; }
.crm_row_done td  { opacity: .6; }

/* ── Status badges ────────────────────────────────────────── */
.crm_status { display:inline-block; padding:3px 10px; border-radius:10px; font-size:12px; font-weight:500; }
.crm_status_lead      { background:#e3f2fd; color:#1565c0; }
.crm_status_qualified { background:#e8f5e9; color:#2e7d32; }
.crm_status_client    { background:#f3e5f5; color:#6a1b9a; }
.crm_status_inactive  { background:#f5f5f5; color:#757575; }
.crm_status_open      { background:#e3f2fd; color:#1565c0; }
.crm_status_won       { background:#e8f5e9; color:#2e7d32; }
.crm_status_lost      { background:#ffebee; color:#c62828; }

/* ── Stage badge ─────────────────────────────────────────── */
.crm_stage_badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    color: #fff;
    font-weight: 500;
}
.crm_value      { font-weight: 600; color: #2c3e50; }
.crm_value_big  { font-size: 22px; font-weight: 700; color: #27ae60; }

/* ── Filter form ─────────────────────────────────────────── */
.crm_filter_form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}
.crm_filter_form input[type=text],
.crm_filter_form select {
    padding: 7px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

/* ── Tables ──────────────────────────────────────────────── */
.list_table { width:100%; border-collapse:collapse; font-size:13px; }
.list_table th { padding:9px 12px; background:#f8f9fa; border-bottom:2px solid #dee2e6; text-align:left; color:#495057; font-weight:600; white-space:nowrap; }
.list_table td { padding:9px 12px; border-bottom:1px solid #f0f0f0; color:#333; }
.list_table tr:hover td { background:#fafafa; }
.list_table th a { color:#495057; text-decoration:none; }
.list_table th a:hover { color:#2980b9; }
.list_count { font-size:12px; color:#888; margin-top:10px; }

.actions { white-space: nowrap; }
.action_view,
.action_edit,
.action_delete { display:inline-block; width:24px; height:24px; margin:0 2px; vertical-align:middle; cursor:pointer; background:center/16px no-repeat; }
.action_view   { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232980b9'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z'/%3E%3C/svg%3E"); }
.action_edit   { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f39c12'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E"); }
.action_delete { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e74c3c'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E"); }

/* ── Forms ───────────────────────────────────────────────── */
.admin_form .form_cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:20px; margin-bottom:20px; }
.form_row { margin-bottom:14px; }
.form_row label { display:block; font-size:12px; font-weight:600; color:#555; margin-bottom:5px; text-transform:uppercase; letter-spacing:.4px; }
.form_row input[type=text],
.form_row input[type=email],
.form_row input[type=url],
.form_row input[type=number],
.form_row input[type=date],
.form_row input[type=datetime-local],
.form_row input[type=color],
.form_row select,
.form_row textarea { width:100%; padding:8px 10px; border:1px solid #ced4da; border-radius:4px; font-size:13px; box-sizing:border-box; }
.form_row textarea { resize:vertical; }
.form_row input:focus,
.form_row select:focus,
.form_row textarea:focus { outline:none; border-color:#2980b9; box-shadow:0 0 0 2px rgba(41,128,185,.15); }
.form_row_inline { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.form_row_inline > div { flex:1; min-width:120px; }
.form_actions { margin-top:20px; display:flex; gap:8px; padding-top:16px; border-top:1px solid #f0f0f0; }
.crm_multiselect { display:flex; flex-wrap:wrap; gap:8px; }
.crm_checkbox_label { display:flex; align-items:center; gap:5px; font-size:13px; cursor:pointer; }
.crm_notes { margin-top:12px; padding-top:12px; border-top:1px solid #f0f0f0; font-size:13px; color:#555; }
.crm_notes p { margin:6px 0 0; }
.crm_inline_form .form_row_inline { display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; }
.crm_inline_form .form_row_inline > div { flex:1; }
.crm_field_options_row { margin-top:10px; }

/* ── Detail table (view pages) ───────────────────────────── */
.crm_detail_table { width:100%; font-size:13px; border-collapse:collapse; }
.crm_detail_table th { width:160px; padding:8px 10px; text-align:left; color:#888; font-weight:600; font-size:12px; vertical-align:top; white-space:nowrap; }
.crm_detail_table td { padding:8px 10px; color:#333; border-bottom:1px solid #f5f5f5; }

/* ── View layout ─────────────────────────────────────────── */
.crm_view_cols { display:grid; grid-template-columns:1fr; gap:20px; }
.crm_view_main { display:flex; flex-direction:column; gap:0; }

/* ── Stage progress bar ──────────────────────────────────── */
.crm_stage_progress {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.crm_stage_step {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border-radius: 4px;
    font-size: 12px;
    background: #f5f5f5;
    color: #999;
    border: 2px solid transparent;
    min-width: 80px;
}
.crm_stage_step.past { background: #e8f5e9; color: #2e7d32; }
.crm_stage_step.active { font-weight: 700; background: #fff; }

/* ── Pipeline board (Kanban) ─────────────────────────────── */
.crm_pipeline_board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    align-items: flex-start;
}
.crm_pipeline_col {
    flex: 0 0 260px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0 0 12px;
    border: 1px solid #e9ecef;
}
.crm_pipeline_col_header {
    padding: 12px 14px 10px;
    border-radius: 7px 7px 0 0;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 10px;
}
.crm_stage_title { font-weight: 600; font-size: 13px; color: #2c3e50; display: block; }
.crm_stage_meta  { font-size: 12px; color: #888; display: block; margin-top: 2px; }
.crm_pipeline_cards { min-height: 80px; padding: 0 10px; }
.crm_pipeline_cards.crm_drag_over { background: #e8f4fd; border-radius: 6px; }
.crm_deal_card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: box-shadow .15s;
}
.crm_deal_card:hover { box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.crm_deal_card.dragging { opacity: .5; }
.crm_deal_card_title a { font-size: 13px; font-weight: 600; color: #2c3e50; text-decoration: none; }
.crm_deal_card_title a:hover { color: #2980b9; }
.crm_deal_card_value { font-size: 14px; font-weight: 700; color: #27ae60; margin: 4px 0; }
.crm_deal_card_contact { font-size: 12px; color: #888; margin-bottom: 6px; }
.crm_deal_card_footer { display:flex; justify-content:space-between; font-size:11px; color:#aaa; margin-top:6px; }
.crm_pipeline_add_btn { display:block; text-align:center; margin:8px 10px 0; padding:6px; font-size:12px; color:#2980b9; text-decoration:none; border:1px dashed #2980b9; border-radius:4px; }
.crm_pipeline_add_btn:hover { background:#e8f4fd; }

/* ── Activity quick form ─────────────────────────────────── */
.crm_activity_form { background:#f8f9fa; border:1px solid #e9ecef; border-radius:6px; padding:12px; margin-bottom:14px; }
.crm_activity_form_row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:8px; }
.crm_activity_form_row select,
.crm_activity_form_row input[type=text],
.crm_activity_form_row input[type=datetime-local] { padding:7px 10px; border:1px solid #ced4da; border-radius:4px; font-size:13px; }
.crm_activity_form_row input[type=text] { flex:1; min-width:200px; }
.crm_activity_form textarea { width:100%; padding:7px 10px; border:1px solid #ced4da; border-radius:4px; font-size:13px; box-sizing:border-box; resize:vertical; }

/* ── Task quick form ─────────────────────────────────────── */
.crm_task_quick_form { display:flex; gap:8px; flex-wrap:wrap; align-items:center; background:#f8f9fa; border:1px solid #e9ecef; border-radius:6px; padding:10px 12px; margin-bottom:14px; }
.crm_task_quick_form input[type=text] { flex:1; min-width:180px; padding:7px 10px; border:1px solid #ced4da; border-radius:4px; font-size:13px; }
.crm_task_quick_form input[type=date],
.crm_task_quick_form select { padding:7px 10px; border:1px solid #ced4da; border-radius:4px; font-size:13px; }

/* ── Modals ──────────────────────────────────────────────── */
.crm_modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.crm_modal_box {
    background: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    min-width: 360px;
    max-width: 520px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.crm_modal_box h3 { margin: 0 0 18px; font-size: 16px; color: #2c3e50; }

/* ── Field config ────────────────────────────────────────── */
.crm_tab_nav { display:flex; gap:4px; margin-bottom:20px; border-bottom:2px solid #e9ecef; padding-bottom:0; }
.crm_tab_nav a { padding:8px 16px; font-size:13px; color:#666; text-decoration:none; border-radius:4px 4px 0 0; border:1px solid transparent; border-bottom:none; }
.crm_tab_nav a:hover { background:#f5f5f5; color:#333; }
.crm_tab_nav a.active { background:#fff; border-color:#e9ecef; color:#2980b9; font-weight:600; border-bottom:2px solid #fff; margin-bottom:-2px; }
.crm_sortable_row { cursor:ns-resize; }
.crm_drag_handle { color:#ccc; font-size:16px; cursor:grab; }
.crm_badge_ok  { background:#d4edda; color:#155724; padding:2px 8px; border-radius:10px; font-size:12px; }
.crm_badge_off { background:#f5f5f5; color:#888; padding:2px 8px; border-radius:10px; font-size:12px; }

/* ── Permissions layout ──────────────────────────────────── */
.crm_permissions_layout { display:grid; grid-template-columns:220px 1fr; gap:20px; }
@media(max-width:700px) { .crm_permissions_layout { grid-template-columns:1fr; } }
.crm_user_list { list-style:none; margin:0; padding:0; }
.crm_user_list li { margin-bottom:4px; }
.crm_user_list a { display:flex; flex-direction:column; padding:10px 12px; border-radius:6px; text-decoration:none; background:#f8f9fa; border:1px solid #e9ecef; }
.crm_user_list a:hover { background:#e8f4fd; border-color:#2980b9; }
.crm_user_list a.active { background:#2980b9; border-color:#2471a3; }
.crm_user_list a.active .crm_user_name,
.crm_user_list a.active .crm_user_type { color:#fff; }
.crm_user_name { font-size:13px; font-weight:600; color:#2c3e50; }
.crm_user_type { font-size:11px; color:#888; margin-top:2px; }
.crm_perm_table td:last-child { text-align:center; }

/* ── Config layout ────────────────────────────────────────── */
.crm_config_cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(380px,1fr)); gap:20px; }

/* ── Reports ─────────────────────────────────────────────── */
.crm_report_grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:20px; margin-bottom:20px; }
.crm_report_table th { background:#f8f9fa; }
.crm_report_bar { height:16px; background:#2980b9; border-radius:2px; min-width:4px; transition:width .4s; }
.crm_report_bar_won  { background:#27ae60; }
.crm_report_bar_lost { background:#e74c3c; }
.crm_report_filter { display:flex; gap:10px; align-items:center; margin-bottom:16px; flex-wrap:wrap; }
.crm_report_filter select,
.crm_report_filter input { padding:7px 10px; border:1px solid #ced4da; border-radius:4px; font-size:13px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display:flex; gap:4px; margin-top:14px; flex-wrap:wrap; }
.pagination a { display:inline-block; padding:5px 10px; border:1px solid #dee2e6; border-radius:4px; font-size:13px; color:#2980b9; text-decoration:none; }
.pagination a:hover { background:#e8f4fd; }
.pagination a.active { background:#2980b9; border-color:#2471a3; color:#fff; }

/* ── Contact view summary stats ─────────────────────────── */
.crm_contact_stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.crm_cstat {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 18px;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.crm_cstat_val {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}
.crm_cstat_label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.crm_cstat_blue   .crm_cstat_val { color: #2980b9; }
.crm_cstat_orange .crm_cstat_val { color: #e67e22; }
.crm_cstat_red    .crm_cstat_val { color: #e74c3c; }
.crm_cstat_green  .crm_cstat_val { color: #27ae60; }
.crm_cstat_blue   { border-color: #aed6f1; background: #eaf4fb; }
.crm_cstat_orange { border-color: #f8c471; background: #fef9e7; }
.crm_cstat_red    { border-color: #f1948a; background: #fdedec; }
.crm_cstat_green  { border-color: #82e0aa; background: #eafaf1; }

/* ── Search results ──────────────────────────────────────── */
.crm_search_cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 800px) { .crm_search_cols { grid-template-columns: 1fr; } }
.crm_search_section_icon {
    width: 16px; height: 16px;
    fill: currentColor;
    vertical-align: middle;
    margin-right: 5px;
    opacity: .7;
}
.crm_search_count {
    display: inline-block;
    background: #e9ecef;
    color: #555;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
}
.crm_search_list { list-style: none; margin: 0; padding: 0; }
.crm_search_list li { border-bottom: 1px solid #f5f5f5; }
.crm_search_list li:last-child { border-bottom: none; }
.crm_search_result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    text-decoration: none;
    border-radius: 4px;
    transition: background .1s;
}
.crm_search_result:hover { background: #f8f9fa; }
.crm_search_result_main { flex: 1; min-width: 0; }
.crm_search_result_main strong { display: block; font-size: 13px; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm_search_sub { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.crm_search_result_meta { display: flex; gap: 6px; align-items: center; flex-shrink: 0; font-size: 12px; color: #888; }

/* ── Top navigation bar ──────────────────────────────────── */
.crm_nav {
    background: #1e2d3d;
    border-radius: 8px;
    margin-bottom: 22px;
    padding: 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.crm_nav::-webkit-scrollbar { display: none; }
.crm_nav_inner {
    display: flex;
    align-items: stretch;
    gap: 2px;
    min-width: max-content;
}
.crm_nav_item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px;
    color: #a8b8c8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
}
.crm_nav_item:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
}
.crm_nav_active {
    color: #fff;
    border-bottom-color: #3498db;
    background: rgba(52,152,219,.12);
}
.crm_nav_icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
    opacity: .85;
}
.crm_nav_active .crm_nav_icon { opacity: 1; }

/* Badge de tarefas em atraso */
.crm_nav_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    margin-left: 4px;
    line-height: 1;
}

/* Pesquisa global no navbar */
.crm_nav_search {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 6px 4px;
}
.crm_nav_search_wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.crm_nav_search_icon {
    position: absolute;
    left: 8px;
    width: 15px;
    height: 15px;
    fill: #8aa;
    pointer-events: none;
    flex-shrink: 0;
}
.crm_nav_search input[type=text] {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 20px;
    color: #e0e8f0;
    font-size: 12px;
    padding: 5px 12px 5px 30px;
    width: 150px;
    transition: width .2s, background .2s, border-color .2s;
    outline: none;
}
.crm_nav_search input[type=text]::placeholder { color: #7a9ab0; }
.crm_nav_search input[type=text]:focus,
.crm_nav_search input[type=text].crm_nav_search_open {
    width: 220px;
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.3);
    color: #fff;
}

/* ── Misc ────────────────────────────────────────────────── */
.crm_empty { color:#aaa; font-style:italic; padding:16px 0; font-size:13px; }

/* ── Config sub-navigation ───────────────────────────────── */
.crm_config_subnav { display:flex; gap:4px; margin-top:10px; flex-wrap:wrap; }
.crm_config_tab { padding:6px 14px; font-size:13px; border-radius:4px 4px 0 0; border:1px solid #ddd; border-bottom:none; background:#f5f5f5; color:#333 !important; text-decoration:none; }
.crm_config_tab:hover { background:#e8e8e8; color:#111 !important; }
.crm_config_tab_active { background:#fff; color:#2c3e50 !important; font-weight:600; border-bottom:1px solid #fff; margin-bottom:-1px; }

/* ── Reports page ────────────────────────────────────────── */
.crm-wrap { color:#333; }
.crm-page-header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:20px; padding-bottom:12px; border-bottom:1px solid #e0e0e0; }
.crm-page-header h1 { margin:0; font-size:22px; font-weight:600; color:#2c3e50; }
.crm-page-actions { display:flex; gap:8px; flex-wrap:wrap; }
.crm-btn { display:inline-block; padding:7px 16px; border-radius:4px; font-size:13px; font-weight:500; text-decoration:none; cursor:pointer; border:none; }
.crm-btn-primary { background:#2c3e50; color:#fff !important; }
.crm-btn-primary:hover { background:#1a252f; }
.crm-btn-secondary { background:#ecf0f1; color:#2c3e50 !important; border:1px solid #ddd; }
.crm-btn-secondary:hover { background:#dde4e6; }
