:root {
    /* Industrial Color Palette */
    --color-bg-app: #f0f2f5;
    --color-bg-panel: #ffffff;
    --color-bg-sidebar: #1e293b;
    /* Dark Slate */
    --color-bg-header: #ffffff;

    --color-primary: #0f172a;
    /* Slate 900 - Strong Industrial */
    --color-primary-light: #334155;
    --color-accent: rgb(3, 92, 169);
    --color-accent-hover: rgb(56, 86, 14);

    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-text-inverse: #f8fafc;

    --color-border: #cbd5e1;
    --color-border-strong: #94a3b8;

    --color-success: #16a34a;
    --color-warning: #ea580c;
    --color-danger: #dc2626;

    /* Typography */
    --font-family: 'Arial', sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    /* Dense */
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;

    /* Spacing & Layout */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;

    --header-height: 50px;
    --sidebar-width: 194px;

    /* Components */
    --radius-sm: 3px;
    /* Sharp corners for industrial feel */
    --radius-md: 4px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    --color-bg-app: #0f172a;
    --color-bg-panel: #1e293b;
    --color-bg-sidebar: #020617;
    --color-bg-header: #1e293b;

    --color-primary: #f8fafc;
    --color-primary-light: #94a3b8;

    --color-text-main: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-text-inverse: #f8fafc;

    --color-border: #334155;
    --color-border-strong: #475569;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--color-bg-app);
    color: var(--color-text-main);
    font-size: var(--font-size-base);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    /* App-like feel */
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Utilities */
.text-xs {
    font-size: var(--font-size-xs);
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-muted {
    color: var(--color-text-muted);
}

.font-bold {
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.hidden-module {
    display: none !important;
}

/* Buttons - Industrial Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    gap: 6px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
}

.btn-secondary {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.btn-secondary:hover {
    background-color: #7DB82C;
    border-color: #7DB82C;
}

.btn-cancel {
    background-color: var(--color-accent);
    color: white;
    border: 1px solid transparent;
}

.btn-cancel:hover {
    background-color: rgb(207, 12, 48);
    border-color: rgb(207, 12, 48);
    color: white;
}

#btn-buscar-ptc:hover {
    background-color: rgb(0, 0, 255) !important;
    border-color: rgb(0, 0, 255) !important;
}

#btn-iniciar-ptc:hover {
    background-color: rgb(13, 224, 200) !important;
    border-color: rgb(13, 224, 200) !important;
}

#btn-add-equipment:hover {
    background-color: rgb(30, 58, 138) !important;
    border-color: rgb(30, 58, 138) !important;
}

#btn-resumo-consolidado:hover {
    background-color: rgb(214, 132, 24) !important;
    border-color: rgb(214, 132, 24) !important;
    color: white !important;
}

.eq-item.dragging {
    opacity: 0.4;
}

.eq-item.drag-over {
    border-top: 2px solid var(--color-accent) !important;
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-text-muted);
}

.btn-ghost:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--color-text-main);
}

/* Tables - High Density */
.table-container {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: auto;
    max-height: 70vh;
    position: relative;
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

th {
    background-color: #f8fafc;
    border-bottom: 2px solid var(--color-border);
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 var(--color-border);
}

td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #fdfdfd;
}

/* Cards */
.card {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
}

.card-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-primary);
    margin: 0;
}

/* Inputs */
.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 6px 10px;
    font-size: var(--font-size-sm);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    width: 600px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: var(--spacing-md);
    overflow-y: auto;
}

.modal-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    background: #f8fafc;
}

/* App Layout Specifics */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    height: 100vh;
}

.app-sidebar {
    grid-row: 1 / -1;
    background: rgb(45, 45, 45);
    color: white;
    display: flex;
    flex-direction: column;
}

.app-header {
    grid-column: 2;
    background-color: var(--color-bg-header);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md);
    justify-content: space-between;
}

.module-header-sticky {
    background: var(--color-accent);
    color: white;
}

.app-content {
    grid-column: 2;
    padding: var(--spacing-md);
    overflow-y: auto;
    position: relative;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md);
    font-weight: 700;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    background: var(--color-accent);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.nav-item {
    padding: 10px var(--spacing-md);
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: var(--color-accent);
    color: white;
}

.nav-item.active {
    background-color: var(--color-accent);
    color: white;
    border-left-color: white;
}

.status-badge {
    padding: 2px 6px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-green {
    background-color: #dcfce7;
    color: #15803d;
}

.status-blue {
    background-color: #e0f2fe;
    color: #0369a1;
}

.status-gray {
    background-color: #f1f5f9;
    color: #475569;
}

.status-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.text-warning {
    color: var(--color-warning);
}

/* Tabs */
.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--color-accent);
}

.tab-btn.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-content {
    animation: fadeIn 0.2s ease;
}

@media print {

    .app-sidebar,
    .app-header {
        display: none;
    }

    .app-container {
        display: block;
        height: auto;
    }

    .app-content {
        overflow: visible;
        padding: 0;
    }

    .modal-overlay {
        position: static;
        background: white;
    }

    .modal {
        box-shadow: none;
        width: 100%;
        max-width: none;
    }

    .btn,
    .no-print {
        display: none !important;
    }
}

/* Table Striping */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* ===== Ajuda System ===== */
.ajuda-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 1001;
}
.ajuda-modal {
    background: white; border-radius: var(--radius-md);
    width: 90vw; max-width: 1200px;
    height: 85vh; max-height: 800px;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.ajuda-header {
    padding: 16px 24px; border-bottom: 1px solid var(--color-border);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--color-bg-header);
    flex-shrink: 0;
}
.ajuda-search-input {
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    padding: 8px 12px 8px 32px; font-size: 13px; width: 260px;
    background: var(--color-bg-panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%2394a3b8' d='M229.66 218.34l-50.07-50.06a88.11 88.11 0 1 0-11.31 11.31l50.06 50.07a8 8 0 0 0 11.32-11.32ZM40 112a72 72 0 1 1 72 72a72.08 72.08 0 0 1-72-72Z'/%3E%3C/svg%3E") no-repeat 10px center;
    background-size: 16px;
    outline: none;
}
.ajuda-search-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}
.ajuda-layout {
    display: flex; flex: 1; overflow: hidden;
}
.ajuda-sidebar {
    width: 260px; border-right: 1px solid var(--color-border);
    overflow-y: auto; padding: 8px 0;
    background: #f8fafc;
    flex-shrink: 0;
}
.ajuda-content {
    flex: 1; overflow-y: auto; padding: 32px 40px;
}
.ajuda-item {
    padding: 8px 16px 8px 20px; cursor: pointer; font-size: 13px;
    display: flex; align-items: center; gap: 8px;
    color: var(--color-text-muted);
    border-left: 3px solid transparent;
    transition: all 0.1s;
}
.ajuda-item:hover {
    background: #e2e8f0;
    color: var(--color-text-main);
}
.ajuda-item.active {
    background: #e8eddc;
    color: var(--color-accent);
    font-weight: 700;
    border-left-color: var(--color-accent);
}
.ajuda-categoria {
    padding: 12px 16px 4px 20px;
    font-size: 10px; font-weight: 700;
    color: #94a3b8; text-transform: uppercase;
    letter-spacing: 0.8px;
}
.ajuda-section-title {
    margin: 0 0 8px; font-size: 22px; font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}
.ajuda-section-desc {
    font-size: 14px; color: var(--color-text-muted);
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}
.ajuda-subsection-title {
    font-size: 16px; font-weight: 700;
    color: var(--color-primary); margin: 24px 0 12px;
}
.ajuda-subsubtitle {
    font-size: 14px; font-weight: 600;
    color: var(--color-text-main); margin: 20px 0 10px;
}
.ajuda-paragraph {
    font-size: 14px; line-height: 1.7;
    color: var(--color-text-main); margin: 0 0 12px;
}
.ajuda-list {
    font-size: 14px; line-height: 1.7;
    color: var(--color-text-main);
    margin: 8px 0 16px; padding-left: 24px;
}
.ajuda-list li {
    margin-bottom: 4px;
}
.ajuda-list--numbered {
    padding-left: 28px;
}
.ajuda-campo {
    margin: 10px 0; padding: 12px 16px;
    background: #f8fafc; border-radius: 6px;
    border-left: 3px solid var(--color-accent);
}
.ajuda-campo-nome {
    font-weight: 700; font-size: 13px;
    color: var(--color-primary);
}
.ajuda-campo-desc {
    font-size: 13px; color: var(--color-text-main);
    margin-top: 2px;
}
.ajuda-screenshot-wrapper {
    margin: 20px 0;
}
.ajuda-screenshot-wrapper img {
    max-width: 100%; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ajuda-screenshot-fallback {
    border: 2px dashed #cbd5e1; border-radius: 8px;
    padding: 28px 20px; text-align: center; background: #f8fafc;
    flex-direction: column; align-items: center; gap: 6px;
}
.ajuda-screenshot-fallback i {
    font-size: 36px; color: #94a3b8;
}
.ajuda-screenshot-fallback p {
    margin: 0; font-size: 13px; font-weight: 600; color: #64748b;
}
.ajuda-screenshot-fallback span {
    font-size: 11px; color: #94a3b8;
}
.ajuda-screenshot-fallback code {
    background: #e2e8f0; padding: 1px 6px;
    border-radius: 3px; font-size: 11px;
}
.ajuda-highlight {
    background: #fef08a; padding: 0 2px;
    border-radius: 2px;
}
.ajuda-footer {
    padding: 12px 24px; border-top: 1px solid var(--color-border);
    display: flex; justify-content: space-between; align-items: center;
    background: #f8fafc; font-size: 12px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.ajuda-footer kbd {
    background: #e2e8f0; border: 1px solid #cbd5e1;
    border-radius: 3px; padding: 1px 5px;
    font-size: 11px; font-family: inherit;
}
.ajuda-empty {
    font-size: 14px; color: var(--color-text-muted);
    padding: 40px; text-align: center;
}
.ajuda-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
}
.ajuda-content code {
    background: #f1f5f9; padding: 1px 4px;
    border-radius: 3px; font-size: 13px;
    color: #dc2626;
}
@media (max-width: 768px) {
    .ajuda-modal { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }
    .ajuda-sidebar { width: 200px; }
    .ajuda-content { padding: 20px; }
    .ajuda-search-input { width: 160px; }
}

.btn-xs { font-size: 11px; padding: 2px 6px; height: 24px; line-height: 20px; }

/* Pagination styles */
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; padding: 0 6px;
    font-size: 12px; font-weight: 500; cursor: pointer;
    border-radius: 4px; color: #334155;
    transition: all 0.15s; user-select: none;
}
.page-btn:hover { background: #e2e8f0; }
.page-btn.active { background: #0f172a; color: #fff; font-weight: 600; }
.page-btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
.page-ellipsis { display: inline-flex; align-items: center; padding: 0 4px; font-size: 12px; color: #94a3b8; }

/* =====================================================================
   CRM MODULE STYLES
   ===================================================================== */
.crm-layout { display:flex; flex-direction:column; min-height:calc(100vh - 80px); background:var(--color-bg-app); gap:8px; margin:-16px; }
.crm-header { display:flex; align-items:center; justify-content:space-between; background:var(--color-bg-panel); border-radius:var(--radius-md); padding:8px 12px; box-shadow:var(--shadow-sm); }
.crm-tabs { display:flex; gap:2px; }
.crm-tab { padding:6px 14px; font-size:13px; font-weight:500; border:none; background:transparent; color:var(--color-text-muted); cursor:pointer; border-radius:var(--radius-sm); transition:all .15s; display:flex; align-items:center; gap:6px; }
.crm-tab:hover { background:#f1f5f9; color:var(--color-text-main); }
.crm-tab.active { background:var(--color-accent); color:var(--color-text-inverse); }
.crm-header-actions { display:flex; gap:6px; }
.crm-toolbar { background:var(--color-bg-panel); border-radius:var(--radius-md); padding:8px 12px; box-shadow:var(--shadow-sm); }
.crm-filters { display:flex; gap:8px; flex-wrap:wrap; }
.crm-filters select, .crm-filters input { padding:4px 8px; font-size:12px; border:1px solid var(--color-border); border-radius:var(--radius-sm); background:white; min-width:140px; }
.crm-content { flex:1; overflow-y:auto; }

/* Dashboard */
.crm-dashboard { padding-bottom:16px; }
.crm-dashboard-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.crm-dashboard-col { display:flex; flex-direction:column; gap:12px; }
.crm-panel { background:var(--color-bg-panel); border-radius:var(--radius-md); box-shadow:var(--shadow-sm); overflow:hidden; }
.crm-panel-header { display:flex; align-items:center; gap:8px; padding:10px 14px; font-size:13px; font-weight:600; border-bottom:1px solid var(--color-border); background:#f8fafc; }
.crm-panel-body { padding:12px 14px; }
.crm-summary-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.crm-summary-card { padding:12px; background:#f8fafc; border-radius:var(--radius-sm); text-align:center; }
.crm-summary-value { font-size:20px; font-weight:700; color:var(--color-primary); }
.crm-summary-label { font-size:11px; color:var(--color-text-muted); margin-top:2px; text-transform:uppercase; letter-spacing:.3px; }
.crm-status-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.crm-stat-card { padding:10px 12px; background:#f8fafc; border-radius:var(--radius-sm); }
.crm-stat-value { font-size:18px; font-weight:700; }
.crm-stat-label { font-size:11px; color:var(--color-text-muted); margin-top:2px; }
.crm-alert-item { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:13px; }
.crm-alert-icon { font-size:16px; }

/* Kanban */
.crm-kanban { display:flex; gap:8px; height:100%; overflow-x:auto; padding-bottom:8px; }
.crm-kanban-col { flex:1; min-width:200px; max-width:280px; background:#f1f5f9; border-radius:var(--radius-md); display:flex; flex-direction:column; }
.crm-kanban-col-header { display:flex; align-items:center; justify-content:space-between; padding:8px 10px; border-bottom:3px solid; font-size:12px; font-weight:600; background:var(--color-bg-panel); border-radius:var(--radius-md) var(--radius-md) 0 0; }
.crm-kanban-col-count { background:#e2e8f0; padding:1px 7px; border-radius:10px; font-size:11px; }
.crm-kanban-col-body { flex:1; padding:6px; overflow-y:auto; min-height:200px; }
.crm-kanban-empty { font-size:12px; color:var(--color-text-muted); text-align:center; padding:20px 8px; }

/* Lead Card */
.crm-lead-card { background:var(--color-bg-panel); border-radius:var(--radius-sm); padding:8px 10px; margin-bottom:6px; cursor:pointer; box-shadow:0 1px 2px rgba(0,0,0,.05); transition:box-shadow .15s; border:1px solid var(--color-border); }
.crm-lead-card:hover { box-shadow:var(--shadow-md); }
.crm-lead-card-header { display:flex; align-items:center; justify-content:space-between; font-size:13px; gap:6px; }
.crm-lead-card-empresa { font-size:11px; color:var(--color-text-muted); margin:2px 0; }
.crm-lead-card-info { display:flex; flex-wrap:wrap; gap:6px; font-size:11px; color:var(--color-text-muted); margin:4px 0; }
.crm-lead-card-info span { display:flex; align-items:center; gap:3px; }
.crm-lead-card-footer { display:flex; align-items:center; justify-content:space-between; font-size:10px; margin-top:4px; padding-top:4px; border-top:1px solid #f1f5f9; }

/* Score */
.crm-score { display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:20px; padding:0 5px; font-size:11px; font-weight:700; border-radius:10px; color:white; }
.crm-score.score-alto { background:#16a34a; }
.crm-score.score-medio { background:#f59e0b; }
.crm-score.score-baixo { background:#ef4444; }
.crm-score-circle { width:60px; height:60px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.crm-score-circle span { font-size:22px; font-weight:700; color:white; }
.crm-score-circle.score-alto { background:#16a34a; }
.crm-score-circle.score-medio { background:#f59e0b; }
.crm-score-circle.score-baixo { background:#ef4444; }
.crm-score-criterios { list-style:none; padding:0; margin:0; font-size:12px; color:var(--color-text-main); }
.crm-score-criterios li { padding:3px 0; border-bottom:1px solid #f1f5f9; }
.crm-score-criterios li:before { content:"\\2713 "; color:#16a34a; font-weight:700; }

/* Status Badge */
.crm-status-badge { display:inline-block; padding:2px 8px; font-size:11px; font-weight:600; color:white; border-radius:10px; white-space:nowrap; }

/* Table */
.crm-table { width:100%; border-collapse:collapse; font-size:13px; }
.crm-table th { padding:8px 10px; text-align:left; font-weight:600; font-size:12px; color:var(--color-text-muted); border-bottom:2px solid var(--color-border); background:#f8fafc; white-space:nowrap; }
.crm-table td { padding:8px 10px; border-bottom:1px solid #f1f5f9; }
.crm-table-row-clickable { cursor:pointer; transition:background .1s; }
.crm-table-row-clickable:hover { background:#f8fafc; }
.crm-text-muted { color:var(--color-text-muted); font-size:12px; }

/* Modal */
.crm-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.4); display:flex; align-items:flex-start; justify-content:center; padding:40px 20px; z-index:1000; overflow-y:auto; }
.crm-modal { background:var(--color-bg-panel); border-radius:var(--radius-md); width:100%; max-width:560px; box-shadow:0 20px 60px rgba(0,0,0,.15); animation:crmModalIn .2s ease; }
.crm-modal-lg { max-width:720px; }
.crm-modal-lead { max-width:900px; }
.crm-modal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--color-border); gap:12px; }
.crm-modal-header h3 { margin:0; font-size:16px; }
.crm-modal-close { background:none; border:none; font-size:20px; cursor:pointer; color:var(--color-text-muted); padding:4px; }
.crm-modal-close:hover { color:var(--color-text-main); }
.crm-modal-tabs { display:flex; border-bottom:1px solid var(--color-border); background:#f8fafc; overflow-x:auto; }
.crm-modal-tab { padding:8px 14px; font-size:12px; font-weight:500; border:none; background:transparent; color:var(--color-text-muted); cursor:pointer; white-space:nowrap; display:flex; align-items:center; gap:5px; transition:all .15s; border-bottom:2px solid transparent; }
.crm-modal-tab:hover { color:var(--color-text-main); background:#f1f5f9; }
.crm-modal-tab.active { color:var(--color-primary); border-bottom-color:var(--color-primary); background:white; }
.crm-modal-body { padding:16px; max-height:70vh; overflow-y:auto; }
.crm-modal-tab-content { min-height:200px; }

/* Form */
.crm-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; }
.crm-field { display:flex; flex-direction:column; gap:2px; }
.crm-field label { font-size:11px; font-weight:600; color:var(--color-text-muted); text-transform:uppercase; letter-spacing:.3px; }
.crm-field input, .crm-field select, .crm-field textarea { padding:5px 8px; font-size:13px; border:1px solid var(--color-border); border-radius:var(--radius-sm); background:white; }
.crm-field input:focus, .crm-field select:focus, .crm-field textarea:focus { outline:none; border-color:var(--color-primary); box-shadow:0 0 0 2px rgba(15,23,42,.1); }

/* Interação Card */
.crm-interacao-card { padding:10px 12px; margin-bottom:8px; background:#f8fafc; border-radius:var(--radius-sm); border-left:3px solid var(--color-border); }
.crm-interacao-header { display:flex; align-items:center; gap:8px; margin-bottom:6px; font-size:12px; }
.crm-interacao-tipo { font-size:10px; font-weight:600; text-transform:uppercase; padding:1px 6px; border-radius:3px; background:#e2e8f0; color:var(--color-text-muted); }
.crm-interacao-tipo.ligacao { background:#dbeafe; color:#2563eb; }
.crm-interacao-tipo.email { background:#fce7f3; color:#db2777; }
.crm-interacao-tipo.whatsapp { background:#d1fae5; color:#059669; }
.crm-interacao-tipo.reuniao { background:#fef3c7; color:#d97706; }
.crm-interacao-tipo.visita { background:#e0e7ff; color:#4f46e5; }
.crm-interacao-body { font-size:13px; margin-bottom:6px; }
.crm-interacao-resultado { font-size:12px; color:var(--color-text-main); margin-bottom:4px; }
.crm-interacao-proximo { font-size:12px; color:var(--color-text-main); margin-bottom:4px; }
.crm-interacao-footer { display:flex; justify-content:space-between; align-items:center; font-size:11px; color:var(--color-text-muted); padding-top:6px; border-top:1px solid #e2e8f0; }

/* Tarefa Card */
.crm-tarefa-card { padding:10px 12px; margin-bottom:8px; background:var(--color-bg-panel); border-radius:var(--radius-sm); border:1px solid var(--color-border); }
.crm-tarefa-card.crm-tarefa-late { border-left:3px solid var(--color-danger); }
.crm-tarefa-card.crm-tarefa-hoje { border-left:3px solid var(--color-warning); }
.crm-tarefa-card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.crm-tarefa-card-body { font-size:12px; }
.crm-tarefa-card-body p { margin:0 0 6px; color:var(--color-text-muted); }
.crm-tarefa-card-meta { display:flex; gap:8px; flex-wrap:wrap; font-size:11px; color:var(--color-text-muted); }
.crm-tarefa-tipo { font-size:10px; font-weight:600; text-transform:uppercase; padding:1px 6px; border-radius:3px; background:#e2e8f0; color:var(--color-text-muted); }
.crm-followup-late { color:var(--color-danger); font-size:14px; }

/* Relatorios */
.crm-bar-bg { height:8px; background:#e2e8f0; border-radius:4px; overflow:hidden; }
.crm-bar-fill { height:100%; border-radius:4px; transition:width .3s; }

/* Empty State */
.crm-empty { text-align:center; padding:40px 20px; color:var(--color-text-muted); font-size:14px; }
.crm-empty i { font-size:40px; display:block; margin-bottom:12px; opacity:.3; }

/* Animations */
@keyframes crmModalIn { from { opacity:0; transform:translateY(-10px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }

