/* assets/style.css - UI Moderna e Refinada */

:root {
    --bg-dark: #060b14;
    --card-dark: #0d1526;
    --border-dark: #1e2d45;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Status Colors */
    --status-pendente: #64748b;
    --status-andamento: #06b6d4;
    --status-validacao: #f59e0b;
    --status-aprovada: #10b981;
    --status-finalizada: #10b981;
    --status-reprovada: #ef4444;
    --status-correcao: #f97316;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    color-scheme: dark;
}

[data-theme="light"] {
    --bg-dark: #f1f5f9;
    --card-dark: #ffffff;
    --border-dark: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    color-scheme: light;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(900px 420px at 50% 20%, rgba(99, 102, 241, 0.22), transparent 60%),
        radial-gradient(700px 420px at 15% 85%, rgba(16, 185, 129, 0.16), transparent 55%),
        radial-gradient(700px 420px at 85% 85%, rgba(245, 158, 11, 0.12), transparent 55%),
        var(--bg-dark);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 1.25rem;
    padding: 2.25rem 2rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .login-card {
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.login-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-form .btn-block {
    width: 100%;
    justify-content: center;
}

.login-form input::placeholder {
    color: var(--text-muted);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background-color: var(--card-dark);
    border-right: 1px solid var(--border-dark);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 1rem 0.75rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem;
    max-width: calc(100vw - 240px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: rgba(13, 21, 38, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-dark);
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

/* Sidebar Navigation */
.sidebar-header h1 {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-version-link {
    display: inline-flex;
    margin: -1rem 0 1rem 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border-dark);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
}

.sidebar-version-link:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--text-primary);
    transform: translateX(2px);
}

.login-alert-content { width: min(96vw, 980px); max-width: 980px; max-height: 92vh; overflow: auto; }
.login-alert-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.kpi-alert { padding: 1.25rem; }
.kpi-alert .kpi-label { font-size: 0.65rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.35rem; }
.kpi-alert .kpi-value { font-size: 1.75rem; font-weight: 900; font-family: 'Syne', sans-serif; margin-bottom: 0.5rem; color: var(--text-primary); }
.kpi-alert.tone-blue { border-color: rgba(59, 130, 246, 0.25); background: rgba(59, 130, 246, 0.06); }
.kpi-alert.tone-red { border-color: rgba(239, 68, 68, 0.25); background: rgba(239, 68, 68, 0.06); }
.kpi-alert.tone-purple { border-color: rgba(139, 92, 246, 0.25); background: rgba(139, 92, 246, 0.06); }

.has-tooltip { position: relative; }
.has-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 10px);
    width: min(520px, 90vw);
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    z-index: 2000;
    white-space: normal;
}

@media (max-width: 900px) {
    .login-alert-kpis { grid-template-columns: 1fr; }
}

.sidebar-header small {
    font-size: 0.6rem;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    color: var(--text-muted);
}

.nav-badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
    margin-left: auto;
}

.nav-arrow {
    font-size: 0.6rem;
    margin-left: auto;
    transition: transform 0.3s;
}

.has-submenu.open .nav-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding-left: 2.75rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.has-submenu.open .submenu {
    max-height: 200px;
    margin-bottom: 0.5rem;
}

.submenu a {
    font-size: 0.85rem;
    padding: 0.5rem 0;
    opacity: 0.7;
}

.submenu a:hover {
    opacity: 1;
    background: transparent;
    transform: none;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-dark);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.user-avatar-small {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
}

.user-info-small {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.user-name-small {
    font-size: 0.85rem;
    font-weight: 700;
}

.user-role-small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-more {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav a:hover {
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar-nav a.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.nav-section {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem 1rem;
    letter-spacing: 0.1em;
}

.nav-section.nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer !important;
    user-select: none;
    padding-right: 1rem;
}

.nav-section.nav-section-toggle * {
    cursor: pointer !important;
}

.nav-section.nav-section-toggle:hover {
    color: var(--text-secondary);
}

.nav-section-arrow {
    font-size: 0.7rem;
    opacity: 0.75;
    transition: transform 0.15s ease;
}

.nav-section.collapsed .nav-section-arrow {
    transform: rotate(-90deg);
}

.nav-icon {
    font-size: 1.125rem;
}

/* Cards */
.card {
    background-color: var(--card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    font-size: 0.8125rem;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--border-dark);
}

/* Forms & Inputs */
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dark);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
}

select option {
    background: var(--card-dark);
    color: var(--text-primary);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Custom Checkbox Grid for Modules */
.modules-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.module-checkbox {
    background: var(--card-dark);
    border: 2px solid var(--border-dark);
    border-radius: 1rem;
    padding: 1.25rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.module-checkbox input {
    position: absolute;
    opacity: 0;
}

.module-checkbox .module-icon {
    font-size: 2rem;
    transition: transform 0.3s;
}

.module-checkbox .module-name {
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
}

.module-checkbox:hover {
    border-color: var(--text-muted);
    transform: translateY(-4px);
}

.module-checkbox:has(input:checked) {
    border-color: var(--mod-color);
    background: rgba(from var(--mod-color) r g b / 0.15);
    box-shadow: 0 8px 24px rgba(from var(--mod-color) r g b / 0.1);
}

.module-checkbox:has(input:checked) .module-icon {
    transform: scale(1.2);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

th {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

td {
    padding: 0.875rem 1rem;
    background-color: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-dark);
    border-bottom: 1px solid var(--border-dark);
    font-size: 0.8125rem;
}

td:first-child {
    border-left: 1px solid var(--border-dark);
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
}

td:last-child {
    border-right: 1px solid var(--border-dark);
    border-top-right-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 11, 20, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 1rem;
    width: 100%;
    max-width: 800px;
    max-height: 95vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Responsive Grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.25rem; }

/* Dashboard Stats */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-card.danger .stat-icon {
    background: rgba(239, 68, 68, 0.1);
}

.stat-card.danger .stat-value {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-msg {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-msg::before {
    content: '📭';
    display: block;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-right: 1.5rem;
    border-right: 1px solid var(--border-dark);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.7rem;
    border: 2px solid var(--border-dark);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
}

.view-title {
    font-size: 1.125rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .view-title {
    background: none;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}
 
.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Syne', sans-serif;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .stat-card .stat-value {
    background: none;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

[data-theme="light"] .stat-card.danger .stat-value {
    background: none;
    color: #ef4444;
    -webkit-text-fill-color: #ef4444;
}

/* Step Item Cards (Técnico Workflow) */
.step-item-card { 
    background: var(--card-dark); 
    border: 1px solid var(--border-dark); 
    border-radius: 0.75rem; 
    padding: 1rem 1.25rem; 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; 
    margin-bottom: 0.75rem; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item-card:hover { 
    transform: translateX(4px); 
    border-color: var(--accent); 
    background: rgba(255, 255, 255, 0.03);
}

.step-item-main { flex: 1; }
.step-item-main strong { 
    display: block; 
    font-size: 0.875rem; 
    margin-bottom: 0.25rem; 
    text-transform: uppercase; 
    letter-spacing: 0.025em;
    color: var(--text-primary);
}
.step-item-main p { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    margin: 0; 
}

.step-item-meta { 
    display: flex; 
    flex-direction: column; 
    gap: 0.375rem; 
    min-width: 200px; 
}
.event-tag { 
    font-size: 0.65rem; 
    font-weight: 800; 
    color: var(--accent); 
    text-transform: uppercase; 
}
.date-tag { 
    font-size: 0.75rem; 
    color: var(--text-secondary); 
}
.date-tag.overdue { 
    color: #ef4444; 
    font-weight: 700; 
}

.step-item-status { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    min-width: 120px; 
    justify-content: flex-end; 
}

.btn-action-mini{
    border: 1px solid var(--border-dark);
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.35rem 0.6rem;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn-action-mini:hover{
    background: rgba(255,255,255,0.06);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-action-mini:active{
    transform: translateY(0px);
}

.active-step { border-left: 4px solid #f59e0b; }
.finished-step { border-left: 4px solid #10b981; opacity: 0.8; }

.empty-msg-mini { 
    text-align: center; 
    padding: 2rem; 
    color: var(--text-muted); 
    background: rgba(255, 255, 255, 0.01); 
    border-radius: 0.75rem; 
    border: 1px dashed var(--border-dark); 
    font-size: 0.8rem; 
}

/* Timeline V2 */
.timeline-v2 { display: flex; flex-direction: column; gap: 1rem; }
.timeline-v2-item { display: flex; gap: 1rem; padding: 0.75rem; background: rgba(255,255,255,0.02); border-radius: 0.5rem; }
.v2-marker { width: 6px; height: 6px; border-radius: 50%; margin-top: 0.5rem; flex-shrink: 0; }
.v2-marker.aprovada { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.v2-marker.reprovada { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.v2-marker.gray { background: var(--text-muted); }
.v2-content { flex: 1; }
.v2-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.v2-header strong { font-size: 0.75rem; }
.v2-header small { font-size: 0.65rem; color: var(--text-muted); }
.v2-content p { font-size: 0.8rem; margin: 0.25rem 0; color: var(--text-secondary); }

/* Flow Component */
.flow-row { display: flex; align-items: center; justify-content: space-between; margin: 1.5rem 0; }
.flow-step { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; position: relative; flex: 1; }
.flow-circle { 
    width: 1.25rem; 
    height: 1.25rem; 
    border-radius: 50%; 
    background: var(--border-dark); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.7rem; 
    font-weight: 800; 
    transition: all 0.3s;
}
.flow-step span { font-size: 0.6rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.flow-step.active .flow-circle { background: var(--accent); color: white; transform: scale(1.2); }
.flow-step.done .flow-circle { background: #10b981; color: white; }
.flow-line { flex: 1; height: 2px; background: var(--border-dark); margin: 0 -0.5rem; margin-top: -1.25rem; }

/* Status Badges */
.status-pendente { background: var(--status-pendente); color: white; }
.status-andamento { background: var(--status-andamento); color: white; }
.status-validacao { background: var(--status-validacao); color: white; }
.status-finalizada { background: var(--status-finalizada); color: white; }
.status-reprovada { background: var(--status-reprovada); color: white; }
.status-correcao { background: var(--status-correcao); color: white; }

.text-danger { color: #ef4444; border-color: #ef4444; }
.text-danger:hover { background-color: rgba(239, 68, 68, 0.1); }
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger::before {
    content: '⚠️';
}


/* CRM / Radar Comercial */
.crm-hero {
    background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(6,182,212,0.07));
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 1.25rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.crm-eyebrow {
    display: inline-flex;
    color: var(--accent);
    font-weight: 900;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.view-header p,
.crm-card-header p {
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-size: 0.82rem;
}

.view-actions,
.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    border-radius: 0.45rem;
}

.badge-outline {
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-dark);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.stat-label { color: var(--text-muted); font-size: 0.78rem; font-weight: 700; }
.crm-stat-card { min-height: 120px; }

.crm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.crm-list,
.crm-timeline,
.crm-pipeline-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-dark);
    border-radius: 0.85rem;
}

.crm-list-main {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.crm-list-main strong { color: var(--text-primary); }
.crm-list-main span,
.crm-list-main small { color: var(--text-muted); }

.crm-list-side {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
    color: var(--text-secondary);
    font-weight: 800;
}

.crm-temp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.crm-temp-frio { background: rgba(100,116,139,0.18); color: #94a3b8; border: 1px solid rgba(148,163,184,0.24); }
.crm-temp-morno { background: rgba(245,158,11,0.14); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.crm-temp-quente { background: rgba(249,115,22,0.14); color: #fb923c; border: 1px solid rgba(249,115,22,0.28); }
.crm-temp-prioridade { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.30); }

.crm-timeline-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem;
    border: 1px solid var(--border-dark);
    border-radius: 0.85rem;
    background: rgba(255,255,255,0.02);
}

.crm-timeline-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--accent);
    flex: 0 0 auto;
    margin-top: 0.35rem;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}

.crm-timeline-content { flex: 1; min-width: 0; }
.crm-timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; }
.crm-timeline-head small,
.crm-timeline-content small { color: var(--text-muted); }
.crm-timeline-content p { color: var(--text-secondary); margin: 0.25rem 0; }

.crm-ai-note {
    margin-top: 0.55rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.7rem;
    background: rgba(99,102,241,0.10);
    border: 1px solid rgba(99,102,241,0.20);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}

.crm-modal-lg { max-width: 980px; }
.crm-inner-card { margin-bottom: 0; }
.crm-filters { margin-bottom: 1rem; }
.crm-filter-action { display: flex; flex-direction: column; justify-content: end; }

.crm-pipeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-dark);
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.02);
}
.crm-pipeline-row span { color: var(--text-secondary); font-weight: 700; }
.crm-pipeline-row strong { font-family: 'Syne', sans-serif; }

.crm-radar-info {
    background: rgba(6,182,212,0.08);
    border-color: rgba(6,182,212,0.20);
    color: var(--text-secondary);
}
.crm-radar-info strong { color: var(--text-primary); }

.crm-discovered-list { max-height: 68vh; overflow: auto; padding-right: 0.25rem; }
.crm-lead-card {
    padding: 1rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-dark);
    border-radius: 1rem;
}
.crm-lead-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.crm-lead-top div { display: flex; flex-direction: column; gap: 0.18rem; }
.crm-lead-top span,
.crm-lead-card small,
.crm-lead-card p { color: var(--text-muted); }
.crm-lead-card p { margin: 0.45rem 0; }
.crm-lead-card a { color: var(--accent); text-decoration: none; font-weight: 800; }
.crm-lead-card details { margin-top: 0.65rem; color: var(--text-secondary); }
.crm-lead-card summary { cursor: pointer; font-weight: 800; }
.crm-lead-excerpt {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-dark);
    color: var(--text-secondary);
    background: rgba(0,0,0,0.10);
    max-height: 160px;
    overflow: auto;
}
.crm-lead-actions { margin-top: 0.85rem; }

.req-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 700;
    margin: 0.5rem 0 1rem;
}
.req-check input { width: auto; }

@media (max-width: 900px) {
    .view-header { flex-direction: column; align-items: stretch; }
    .crm-list-item, .crm-lead-top, .crm-timeline-head { flex-direction: column; align-items: flex-start; }
    .crm-list-side { align-items: flex-start; flex-direction: row; }
}

/* Radar de Leads - tutorial e ajuda de campos */
.crm-radar-tutorial {
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(99,102,241,0.18);
}

.crm-radar-tutorial summary {
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 900;
    font-family: 'Syne', sans-serif;
    font-size: 1rem;
    list-style: none;
}

.crm-radar-tutorial summary::-webkit-details-marker { display: none; }
.crm-radar-tutorial summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 0.45rem;
    color: var(--accent);
    transition: transform 0.2s ease;
}
.crm-radar-tutorial details[open] summary::before { transform: rotate(90deg); }

.crm-tutorial-intro {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.55;
}

.crm-tutorial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.crm-tutorial-item {
    padding: 0.8rem;
    border-radius: 0.85rem;
    border: 1px solid var(--border-dark);
    background: rgba(0,0,0,0.08);
}

.crm-tutorial-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
}

.crm-tutorial-item span,
.crm-radar-example span,
.crm-field-help {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.crm-radar-example {
    margin-top: 0.9rem;
    padding: 0.85rem;
    border-radius: 0.85rem;
    background: rgba(6,182,212,0.08);
    border: 1px solid rgba(6,182,212,0.18);
}

.crm-radar-example strong { color: var(--text-primary); }

.crm-field-help {
    display: block;
    margin-top: 0.35rem;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .crm-tutorial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .crm-tutorial-grid { grid-template-columns: 1fr; }
}

/* CRM Radar - modal de progresso real por job */
.crm-progress-modal {
    align-items: center;
    justify-content: center;
}
.crm-progress-box {
    width: 520px;
    max-width: 94vw;
    text-align: center;
    border-radius: 22px;
}
.crm-progress-icon {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 10px;
    background: rgba(99, 102, 241, .12);
    box-shadow: 0 0 0 8px rgba(99, 102, 241, .06);
    animation: crmRadarPulse 1.4s ease-in-out infinite;
}
.crm-progress-subtitle {
    margin: 4px 0 16px;
    color: var(--text-muted);
    line-height: 1.45;
}
.crm-progress-step {
    font-weight: 700;
    margin: 8px 0 12px;
    color: var(--text-primary);
}
.crm-progress-bar-wrap {
    width: 100%;
    height: 14px;
    background: rgba(148, 163, 184, .22);
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0;
}
.crm-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #22c55e);
    transition: width .35s ease;
}
.crm-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: .92rem;
    margin-top: 8px;
    color: var(--text-muted);
}
.crm-progress-meta strong {
    color: var(--text-primary);
    font-size: 1.05rem;
}
.crm-progress-message {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(148, 163, 184, .12);
    color: var(--text-primary);
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.35;
}
.crm-progress-warning {
    margin-top: 10px;
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.35;
}
@keyframes crmRadarPulse {
    0%, 100% { transform: scale(1); opacity: .92; }
    50% { transform: scale(1.06); opacity: 1; }
}

/* CRM Radar V10 - layout e transparência de score */
.crm-radar-explain-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
.crm-radar-main-grid {
    align-items: start;
}
.crm-radar-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-top: .95rem;
}
.crm-radar-flow div {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 16px;
    padding: .85rem;
    background: rgba(248, 250, 252, .72);
    min-height: 118px;
}
.crm-radar-flow b {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, .12);
    color: var(--primary);
    margin-bottom: .45rem;
}
.crm-radar-flow strong,
.crm-radar-flow span {
    display: block;
}
.crm-radar-flow strong {
    font-size: .88rem;
    color: var(--text-primary);
    margin-bottom: .25rem;
}
.crm-radar-flow span {
    font-size: .76rem;
    line-height: 1.35;
    color: var(--text-muted);
}
.crm-radar-score-guide h3 {
    margin: 0 0 .35rem;
}
.crm-radar-score-guide p,
.crm-radar-score-guide li {
    color: var(--text-muted);
    line-height: 1.45;
    font-size: .86rem;
}
.crm-radar-score-guide ul {
    margin: .75rem 0;
    padding-left: 1rem;
}
.crm-score-scale {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    margin-top: .75rem;
}
.crm-score-scale span {
    border-radius: 12px;
    padding: .55rem .65rem;
    background: rgba(148, 163, 184, .12);
    font-size: .78rem;
    color: var(--text-muted);
}
.crm-score-scale b {
    color: var(--text-primary);
}
.crm-score-pill {
    min-width: 96px;
    border-radius: 16px;
    padding: .55rem .7rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    border: 1px solid rgba(148, 163, 184, .22);
}
.crm-score-pill b {
    font-size: 1.05rem;
}
.crm-score-pill small {
    font-size: .68rem;
    opacity: .85;
    margin-top: .18rem;
}
.crm-lead-card-v2 {
    border-left: 4px solid rgba(79, 70, 229, .42);
}
.crm-score-details {
    margin-top: .75rem;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 14px;
    background: rgba(248, 250, 252, .72);
    overflow: hidden;
}
.crm-score-details summary {
    cursor: pointer;
    padding: .75rem .85rem;
    font-weight: 800;
    color: var(--text-primary);
}
.crm-score-diagnostics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .6rem;
    padding: 0 .85rem .8rem;
}
.crm-score-diagnostics div {
    border-radius: 12px;
    background: #fff;
    padding: .65rem;
    border: 1px solid rgba(148, 163, 184, .18);
}
.crm-score-diagnostics strong,
.crm-score-diagnostics span {
    display: block;
}
.crm-score-diagnostics strong {
    font-size: .72rem;
    color: var(--text-muted);
    margin-bottom: .24rem;
}
.crm-score-diagnostics span {
    font-size: .78rem;
    color: var(--text-primary);
    word-break: break-word;
}
.crm-diagnostic-note {
    margin: 0 .85rem .75rem;
    color: var(--text-muted);
    font-size: .8rem;
    line-height: 1.4;
}
.crm-diagnostic-list {
    padding: 0 .85rem .85rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.crm-diagnostic-list b {
    width: 100%;
    font-size: .72rem;
    color: var(--text-muted);
    margin-bottom: .15rem;
}
.crm-diagnostic-list span {
    border-radius: 999px;
    padding: .35rem .55rem;
    background: rgba(34, 197, 94, .1);
    color: #166534;
    font-size: .72rem;
    font-weight: 700;
}
.crm-diagnostic-list.warn span {
    background: rgba(245, 158, 11, .12);
    color: #92400e;
}
.crm-diagnostic-list.lock span {
    background: rgba(239, 68, 68, .1);
    color: #991b1b;
}
@media (max-width: 1180px) {
    .crm-radar-explain-grid { grid-template-columns: 1fr; }
    .crm-radar-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crm-score-diagnostics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .crm-radar-flow,
    .crm-score-scale,
    .crm-score-diagnostics { grid-template-columns: 1fr; }
    .crm-score-pill { min-width: auto; }
}

/* ===== CRM Radar V11 - SaaS layout ===== */
.crm-saas-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.crm-saas-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: stretch;
    padding: 28px;
    border-radius: 26px;
    background: radial-gradient(circle at top left, rgba(99,102,241,.23), transparent 38%), linear-gradient(135deg, rgba(15,23,42,.98), rgba(49,46,129,.95));
    color: #fff;
    box-shadow: 0 18px 55px rgba(15,23,42,.22);
    overflow: hidden;
}
.crm-saas-hero:after {
    content: "";
    position: absolute;
    right: -80px;
    top: -90px;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    pointer-events: none;
}
.crm-saas-hero-content,
.crm-saas-hero-actions { position: relative; z-index: 1; }
.crm-saas-kicker,
.crm-saas-card-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.crm-saas-kicker { background: rgba(255,255,255,.12); color: #c7d2fe; }
.crm-saas-hero h1 {
    margin: 10px 0 8px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
    letter-spacing: -.04em;
}
.crm-saas-hero p { max-width: 850px; color: rgba(255,255,255,.82); font-size: 1rem; }
.crm-saas-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: flex-start;
    gap: 10px;
    min-width: 300px;
}
.crm-saas-hero-actions .btn-outline {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-color: rgba(255,255,255,.18);
}
.crm-saas-status-row {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: rgba(255,255,255,.86);
}
.crm-saas-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}
.crm-saas-badge.ok { background: rgba(16,185,129,.18); color: #bbf7d0; border: 1px solid rgba(16,185,129,.25); }
.crm-saas-badge.warn { background: rgba(245,158,11,.18); color: #fde68a; border: 1px solid rgba(245,158,11,.25); }
.crm-saas-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.crm-saas-metric-card,
.crm-saas-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, rgba(148,163,184,.25));
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15,23,42,.06);
}
.crm-saas-metric-card { padding: 18px; }
.crm-saas-metric-card span { display:block; color: var(--text-muted, #64748b); font-size:.78rem; font-weight:700; text-transform: uppercase; letter-spacing:.04em; }
.crm-saas-metric-card strong { display:block; margin-top:7px; color: var(--text-primary, #0f172a); font-size:1.22rem; letter-spacing:-.03em; }
.crm-saas-metric-card small { display:block; margin-top:5px; color: var(--text-muted, #64748b); }
.crm-saas-grid-main {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr);
    gap: 22px;
    align-items: start;
}
.crm-saas-grid-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}
.crm-saas-card { padding: 22px; }
.crm-saas-search-card { padding: 26px; }
.crm-saas-card-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.crm-saas-card-head.compact { margin-bottom: 14px; }
.crm-saas-card-tag { background: rgba(99,102,241,.12); color: #4f46e5; }
.crm-saas-card h2,
.crm-saas-card h3 { margin: 8px 0 4px; color: var(--text-primary, #0f172a); letter-spacing: -.03em; }
.crm-saas-card p { color: var(--text-muted, #64748b); }
.crm-saas-form { display: flex; flex-direction: column; gap: 14px; }
.crm-saas-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.crm-saas-field-xl textarea { min-height: 155px; }
.crm-saas-form .form-group label { font-weight: 800; }
.crm-saas-form .form-group small,
.crm-saas-small-text { color: var(--text-muted, #64748b); font-size: .82rem; }
.crm-saas-form textarea,
.crm-saas-form input,
.crm-saas-form select,
.crm-prompt-editor textarea {
    border-radius: 14px;
    border: 1px solid var(--border-color, #dbe3ef);
    background: var(--input-bg, #fff);
    transition: box-shadow .18s ease, border-color .18s ease;
}
.crm-saas-form textarea:focus,
.crm-saas-form input:focus,
.crm-prompt-editor textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.crm-saas-actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.crm-saas-side-stack { display: flex; flex-direction: column; gap: 22px; }
.crm-saas-steps { display: grid; gap: 12px; }
.crm-saas-steps div {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 2px 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(99,102,241,.06);
}
.crm-saas-steps b {
    grid-row: span 2;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #4f46e5;
    color: #fff;
}
.crm-saas-steps strong { color: var(--text-primary, #0f172a); }
.crm-saas-steps span { color: var(--text-muted, #64748b); font-size: .86rem; }
.crm-score-modern { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.crm-score-modern div { padding: 13px; border-radius: 16px; background: rgba(15,23,42,.04); }
.crm-score-modern span { display:block; color: var(--text-muted, #64748b); font-size:.8rem; font-weight:800; }
.crm-score-modern strong { display:block; color: var(--text-primary, #0f172a); margin-top:4px; }
.crm-saas-results-card { padding: 24px; }
.crm-saas-leads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.crm-saas-lead-card { margin: 0 !important; height: 100%; }
.crm-saas-mini-item { border-radius: 16px; }
.crm-saas-preview {
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(99,102,241,.18);
    background: rgba(99,102,241,.06);
}
.crm-preview-grid { display:grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 16px; }
.crm-saas-preview pre,
.crm-prompt-editor pre {
    margin: 8px 0 0;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 12px;
    border-radius: 14px;
    background: rgba(15,23,42,.92);
    color: #e5e7eb;
    font-size: .82rem;
}
.crm-modal-xl { width: min(1180px, 94vw); max-height: 90vh; overflow: auto; }
.crm-prompt-layout { display: grid; grid-template-columns: 360px minmax(0,1fr); gap: 20px; align-items: start; }
.crm-prompt-list { display: grid; gap: 10px; margin-top: 12px; }
.crm-prompt-card {
    text-align: left;
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid var(--border-color, #dbe3ef);
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 13px;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.crm-prompt-card:hover { transform: translateY(-1px); box-shadow: 0 10px 25px rgba(15,23,42,.08); }
.crm-prompt-card.active { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99,102,241,.11); }
.crm-prompt-card strong { color: var(--text-primary, #0f172a); }
.crm-prompt-card span { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color:#4f46e5; font-size:.78rem; }
.crm-prompt-card small { color: var(--text-muted, #64748b); }
.crm-prompt-card em { width: fit-content; margin-top: 4px; border-radius: 999px; padding: 3px 8px; background: rgba(16,185,129,.11); color: #059669; font-style: normal; font-size: .72rem; font-weight: 800; }
.crm-prompt-card em.off { background: rgba(239,68,68,.10); color: #dc2626; }
.crm-prompt-editor {
    border: 1px solid rgba(99,102,241,.14);
    border-radius: 20px;
    padding: 18px;
    background: rgba(99,102,241,.035);
}
.crm-prompt-editor-head { display:flex; justify-content:space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.crm-prompt-editor-head span { color: #4f46e5; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .78rem; }
.crm-prompt-editor-head h3 { margin: 5px 0; }
.crm-prompt-editor-head p { color: var(--text-muted, #64748b); }
.crm-switch-label { display:flex; align-items:center; gap:8px; white-space: nowrap; font-weight: 800; }
.crm-prompt-tokens { display:flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; margin-bottom: 12px; color: var(--text-muted, #64748b); font-size: .82rem; }
.crm-prompt-tokens span { padding: 3px 7px; border-radius: 999px; background: rgba(15,23,42,.06); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: var(--text-primary, #0f172a); }
@media (max-width: 1120px) {
    .crm-saas-hero,
    .crm-saas-grid-main,
    .crm-saas-grid-secondary,
    .crm-prompt-layout { grid-template-columns: 1fr; }
    .crm-saas-hero-actions { justify-content: flex-start; min-width: 0; }
    .crm-saas-metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .crm-saas-hero { padding: 22px; border-radius: 20px; }
    .crm-saas-metrics,
    .crm-saas-form-grid,
    .crm-preview-grid,
    .crm-saas-leads-grid { grid-template-columns: 1fr; }
}

.crm-progress-provider{margin:8px auto 12px;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;background:#eef2ff;color:#3730a3;font-weight:700;font-size:.85rem;}

/* ===== Gerenciador de Mesas / Mapa de Mesas ===== */
.tm-saas-page{display:flex;flex-direction:column;gap:20px;max-width:1480px;margin:0 auto}.tm-hero{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;padding:28px;border:1px solid var(--border-color,#263244);border-radius:28px;background:linear-gradient(135deg,rgba(37,99,235,.16),rgba(124,58,237,.12)),var(--card-bg,#111827);box-shadow:0 20px 60px rgba(0,0,0,.18)}.tm-hero-compact{padding:22px}.tm-kicker,.tm-card-tag{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#60a5fa}.tm-hero h1{font-family:Syne,DM Sans,sans-serif;font-size:clamp(30px,4vw,52px);line-height:.98;margin:8px 0 10px}.tm-hero p{max-width:760px;color:var(--text-muted,#94a3b8);font-size:16px}.tm-hero-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.tm-grid-3,.tm-grid-4{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.tm-grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}.tm-metric{padding:18px;border:1px solid var(--border-color,#263244);border-radius:20px;background:var(--card-bg,#111827);box-shadow:0 12px 34px rgba(0,0,0,.10)}.tm-metric span{display:block;color:var(--text-muted,#94a3b8);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.tm-metric strong{display:block;font-family:Syne,DM Sans,sans-serif;font-size:32px;margin:6px 0}.tm-metric small{color:var(--text-muted,#94a3b8)}.tm-card{border:1px solid var(--border-color,#263244);border-radius:24px;background:var(--card-bg,#111827);box-shadow:0 14px 40px rgba(0,0,0,.12);padding:20px}.tm-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:16px}.tm-card-head.compact{margin-bottom:10px}.tm-card h2,.tm-card h3{margin:4px 0 4px}.tm-card p,.tm-help{color:var(--text-muted,#94a3b8)}.tm-grid-main{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,.75fr);gap:16px}.tm-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.tm-actions-inline{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}.tm-permissions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:14px;border:1px solid var(--border-color,#263244);border-radius:16px;background:rgba(148,163,184,.06)}.tm-permissions label,.tm-check{display:flex;gap:8px;align-items:center;color:var(--text-color,#e5e7eb);font-size:14px}.tm-subtitle{margin:18px 0 8px}.tm-list{display:flex;flex-direction:column;gap:10px}.tm-list.compact{gap:8px}.tm-list-item{display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid var(--border-color,#263244);border-radius:16px;padding:12px;background:rgba(148,163,184,.05)}.tm-list-item.compact{padding:9px}.tm-list-item strong{display:block}.tm-list-item span,.tm-list-item small{display:block;color:var(--text-muted,#94a3b8);font-size:13px}.tm-list-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.tm-steps{display:flex;flex-direction:column;gap:10px}.tm-steps div{display:grid;grid-template-columns:34px 1fr;gap:8px;padding:10px;border-radius:16px;background:rgba(148,163,184,.06)}.tm-steps b{grid-row:span 2;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:#2563eb;color:#fff}.tm-steps strong{display:block}.tm-steps span{color:var(--text-muted,#94a3b8);font-size:13px}.tm-tabs{display:flex;gap:8px;flex-wrap:wrap;border:1px solid var(--border-color,#263244);background:var(--card-bg,#111827);border-radius:18px;padding:8px}.tm-tabs button{border:0;background:transparent;color:var(--text-muted,#94a3b8);padding:10px 14px;border-radius:13px;font-weight:800;cursor:pointer}.tm-tabs button.active{background:#2563eb;color:#fff;box-shadow:0 10px 24px rgba(37,99,235,.24)}.tm-tab-content{display:none}.tm-tab-content.active{display:block}.tm-table-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}.tm-table-card{display:flex;justify-content:space-between;gap:10px;padding:14px;border-radius:18px;border:1px solid var(--border-color,#263244);background:rgba(148,163,184,.06)}.tm-table-card strong,.tm-table-card span{display:block}.tm-table-card span,.tm-occupancy small{color:var(--text-muted,#94a3b8);font-size:13px}.tm-occupancy{text-align:right}.tm-occupancy b{font-size:20px}.tm-map-grid{display:grid;grid-template-columns:230px minmax(0,1fr);gap:16px}.tm-toolbox .btn{margin-bottom:8px}.tm-map-card{overflow:hidden}.tm-map-canvas{position:relative;width:100%;height:680px;overflow:auto;border:1px dashed rgba(148,163,184,.45);border-radius:20px;background-image:linear-gradient(rgba(148,163,184,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(148,163,184,.12) 1px,transparent 1px);background-size:28px 28px;background-color:rgba(15,23,42,.20)}.tm-map-object{position:absolute;display:flex;align-items:center;justify-content:center;border:2px solid rgba(255,255,255,.40);color:#fff;font-weight:800;text-align:center;cursor:move;user-select:none;box-shadow:0 10px 22px rgba(0,0,0,.20)}.tm-map-object span{pointer-events:none;padding:6px}.tm-map-object.mesa_redonda{border-radius:50%}.tm-map-object.mesa_retangular,.tm-map-object.palco,.tm-map-object.buffet,.tm-map-object.entrada,.tm-map-object.texto{border-radius:16px}.tm-ai-actions{display:flex;gap:10px;flex-wrap:wrap}.tm-ai-result{white-space:pre-wrap;max-height:440px;overflow:auto;border:1px solid var(--border-color,#263244);border-radius:18px;padding:16px;background:rgba(15,23,42,.28);color:var(--text-color,#e5e7eb)}.tm-modal-lg{max-width:820px}.tm-modal-xl{max-width:1120px}.tm-prompt-layout{display:grid;grid-template-columns:320px minmax(0,1fr);gap:16px}.tm-prompt-list{display:flex;flex-direction:column;gap:8px;max-height:560px;overflow:auto}.tm-prompt-list button{border:1px solid var(--border-color,#263244);border-radius:14px;background:rgba(148,163,184,.06);padding:12px;text-align:left;color:var(--text-color,#e5e7eb);cursor:pointer}.tm-prompt-list strong,.tm-prompt-list span{display:block}.tm-prompt-list span{color:var(--text-muted,#94a3b8);font-size:12px}.tm-public-login-body{min-height:100vh;background:radial-gradient(circle at top left,rgba(37,99,235,.24),transparent 35%),linear-gradient(135deg,#07111f,#111827 55%,#1e1b4b);display:flex;align-items:center;justify-content:center;padding:24px}.tm-public-login-wrap{width:min(1050px,100%);display:grid;grid-template-columns:1.2fr 420px;gap:26px;align-items:center}.tm-public-login-brand{color:#fff}.tm-public-login-brand span{color:#93c5fd;text-transform:uppercase;font-weight:800;letter-spacing:.08em}.tm-public-login-brand h1{font-family:Syne,DM Sans,sans-serif;font-size:clamp(38px,6vw,70px);line-height:.95;margin:12px 0}.tm-public-login-brand p{font-size:18px;color:#cbd5e1}.tm-public-login-card{background:#fff;color:#0f172a;border-radius:28px;padding:28px;box-shadow:0 30px 80px rgba(0,0,0,.35)}.tm-public-login-card h2{font-family:Syne,DM Sans,sans-serif;font-size:34px;margin:0 0 8px}.tm-public-login-card p,.tm-public-login-card .tm-help{color:#64748b}.tm-public-panel{padding:22px}.tm-public-body{background:#f8fafc;color:#0f172a}.btn-block{width:100%}@media(max-width:980px){.tm-hero,.tm-grid-main,.tm-map-grid,.tm-public-login-wrap{grid-template-columns:1fr;display:grid}.tm-grid-3,.tm-grid-4{grid-template-columns:1fr 1fr}.tm-form-grid,.tm-permissions,.tm-prompt-layout{grid-template-columns:1fr}.tm-hero-actions{justify-content:flex-start}}@media(max-width:640px){.tm-grid-3,.tm-grid-4{grid-template-columns:1fr}.tm-hero{padding:18px}.tm-map-canvas{height:520px}}


/* ===== V17 - Compatibilidade completa com tema claro/escuro ===== */
:root,
[data-theme="dark"] {
    --card-bg: var(--card-dark);
    --border-color: var(--border-dark);
    --text-color: var(--text-primary);
    --tm-soft: rgba(148, 163, 184, 0.06);
    --tm-soft-strong: rgba(148, 163, 184, 0.10);
    --tm-map-bg: rgba(15, 23, 42, 0.22);
    --tm-map-grid: rgba(148, 163, 184, 0.12);
    --tm-hero-bg: linear-gradient(135deg, rgba(37,99,235,.16), rgba(124,58,237,.12)), var(--card-dark);
    --tm-login-bg: radial-gradient(circle at top left, rgba(37,99,235,.24), transparent 35%), linear-gradient(135deg, #07111f, #111827 55%, #1e1b4b);
    --tm-login-brand: #ffffff;
    --tm-login-brand-muted: #cbd5e1;
}

[data-theme="light"] {
    --card-bg: var(--card-dark);
    --border-color: var(--border-dark);
    --text-color: var(--text-primary);
    --tm-soft: rgba(15, 23, 42, 0.035);
    --tm-soft-strong: rgba(15, 23, 42, 0.06);
    --tm-map-bg: rgba(15, 23, 42, 0.035);
    --tm-map-grid: rgba(15, 23, 42, 0.08);
    --tm-hero-bg: linear-gradient(135deg, rgba(37,99,235,.10), rgba(124,58,237,.07)), var(--card-dark);
    --tm-login-bg: radial-gradient(circle at top left, rgba(37,99,235,.12), transparent 34%), radial-gradient(circle at bottom right, rgba(124,58,237,.10), transparent 30%), var(--bg-dark);
    --tm-login-brand: var(--text-primary);
    --tm-login-brand-muted: var(--text-secondary);
}

/* O Gerenciador de Mesas usa aliases de tema para acompanhar o modo selecionado. */
.tm-hero { background: var(--tm-hero-bg) !important; border-color: var(--border-color) !important; color: var(--text-color); }
.tm-card,
.tm-metric,
.tm-tabs,
.tm-public-login-card { background: var(--card-bg) !important; border-color: var(--border-color) !important; color: var(--text-color) !important; }
.tm-list-item,
.tm-table-card,
.tm-steps div,
.tm-permissions,
.tm-prompt-list button { background: var(--tm-soft) !important; border-color: var(--border-color) !important; color: var(--text-color) !important; }
.tm-tabs button { color: var(--text-muted) !important; }
.tm-tabs button.active { color: #fff !important; }
.tm-map-canvas {
    background-color: var(--tm-map-bg) !important;
    background-image: linear-gradient(var(--tm-map-grid) 1px, transparent 1px), linear-gradient(90deg, var(--tm-map-grid) 1px, transparent 1px) !important;
    border-color: var(--border-color) !important;
}
.tm-ai-result { background: var(--tm-soft) !important; border-color: var(--border-color) !important; color: var(--text-color) !important; }
.tm-public-body { background: var(--bg-dark) !important; color: var(--text-primary) !important; }
.tm-public-panel { color: var(--text-primary); }
.tm-public-login-body { background: var(--tm-login-bg) !important; color: var(--text-primary) !important; }
.tm-public-login-brand { color: var(--tm-login-brand) !important; }
.tm-public-login-brand p { color: var(--tm-login-brand-muted) !important; }
.tm-public-login-card p,
.tm-public-login-card .tm-help { color: var(--text-muted) !important; }
.tm-public-login-card input,
.tm-public-login-card select,
.tm-public-login-card textarea { background: var(--card-bg); color: var(--text-primary); border-color: var(--border-color); }
.tm-public-theme-toggle {
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 50;
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 14px 36px rgba(0,0,0,.16);
}
[data-theme="light"] .topbar { background-color: rgba(255,255,255,0.82); }
[data-theme="dark"] .topbar { background-color: rgba(13,21,38,0.82); }

/* V18 - Gerenciador de Mesas: mapa vinculado, propriedades e IA aplicável */
.tm-map-grid-v18{grid-template-columns:300px minmax(0,1fr) !important;align-items:start}.tm-divider-label{margin:14px 0 8px;color:var(--text-muted,#94a3b8);font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}.tm-selected-panel{margin-top:16px;padding-top:14px;border-top:1px solid var(--border-color,#263244)}.tm-form-grid.tight{gap:8px}.tm-form-grid.tight .form-group{margin-bottom:0}.tm-map-scroll{width:100%;height:720px;overflow:auto;border-radius:20px;border:1px dashed rgba(148,163,184,.45);background:var(--tm-map-bg,rgba(15,23,42,.08))}.tm-map-scroll .tm-map-canvas{width:1400px;height:850px;max-width:none!important;overflow:visible!important;border:0!important;border-radius:0!important}.tm-map-object.selected{outline:3px solid #f59e0b;outline-offset:3px;box-shadow:0 0 0 6px rgba(245,158,11,.18),0 14px 30px rgba(0,0,0,.28)}.tm-map-object.linked::after{content:'🔗';position:absolute;right:-8px;top:-10px;width:24px;height:24px;border-radius:999px;background:var(--card-bg,#111827);border:1px solid var(--border-color,#263244);display:flex;align-items:center;justify-content:center;font-size:12px}.tm-map-object small{display:block;font-size:11px;font-weight:800;opacity:.9;margin-top:2px}.tm-ai-action-bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:14px 0;padding:12px;border:1px solid var(--border-color,#263244);border-radius:16px;background:rgba(37,99,235,.08)}.tm-map-card .tm-card-head{align-items:center}.tm-map-object.area_bloqueada,.tm-map-object.setor{border-radius:18px;opacity:.9}.tm-map-object.bar,.tm-map-object.banheiro,.tm-map-object.pista{border-radius:16px}@media(max-width:1080px){.tm-map-grid-v18{grid-template-columns:1fr!important}.tm-map-scroll{height:560px}.tm-toolbox{order:2}.tm-map-card{order:1}}
