/* =========================================================
   GCM CRM - Main Stylesheet (Dark UI)
   ========================================================= */

:root {
    --topbar-h: 60px;

    --body-bg: #050b16;
    --body-bg-alt: #0a1324;
    --surface-1: #0f1a31;
    --surface-2: #152641;
    --card-bg: #101f35;
    --card-bg-soft: #172842;

    --primary: #3f7abf;
    --primary-dark: #325f96;
    --primary-light: rgba(63, 122, 191, 0.2);
    --primary-soft: rgba(63, 122, 191, 0.12);

    --text-main: #e6eefc;
    --text-muted: #8da2c0;
    --text-soft: #657b9d;

    --border: #223552;
    --border-strong: #33517a;

    --danger: #f97373;
    --success: #34d399;
    --warning: #fbbf24;

    --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.28);
    --shadow-strong: 0 14px 34px rgba(0, 0, 0, 0.34);

    --radius-xl: 14px;
    --radius-lg: 12px;
    --radius-md: 9px;
    --radius-sm: 7px;
}

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-main);
    color-scheme: dark;
    background:
        radial-gradient(circle at 12% -10%, rgba(63, 122, 191, 0.22), transparent 44%),
        radial-gradient(circle at 85% 0%, rgba(13, 116, 144, 0.14), transparent 40%),
        linear-gradient(165deg, #050b16 0%, #0a1323 46%, #102039 100%);
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -1;
    pointer-events: none;
    filter: blur(18px);
}

body::before {
    width: 320px;
    height: 320px;
    left: -90px;
    bottom: -120px;
    background: radial-gradient(circle, rgba(63, 122, 191, 0.34), transparent 72%);
}

body::after {
    width: 280px;
    height: 280px;
    right: -80px;
    top: 100px;
    background: radial-gradient(circle, rgba(13, 116, 144, 0.2), transparent 70%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Sora', sans-serif;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, rgba(5, 10, 18, 0.94), rgba(6, 12, 22, 0.84));
    border-bottom: 1px solid rgba(141, 162, 192, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    z-index: 1000;
}

.topbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 14px;
}

.topbar-brand img {
    height: 30px;
    width: auto;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.35));
}

.topbar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(141, 162, 192, 0.24);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.topbar-toggle:hover {
    color: var(--text-main);
    border-color: rgba(141, 162, 192, 0.36);
    background: rgba(255, 255, 255, 0.05);
}

.topbar-toggle i {
    font-size: 18px;
}

.topbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.topbar-divider {
    width: 1px;
    height: 22px;
    background: rgba(141, 162, 192, 0.28);
    margin: 0 8px;
    flex-shrink: 0;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.topbar-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.18s ease;
    position: relative;
}

.topbar-badge {
    position: absolute;
    top: -5px;
    right: -4px;
    background: #e53e3e;
    color: #fff;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 0 0 2px #0b1923;
    z-index: 1;
}

.topbar-nav a:hover {
    color: var(--text-main);
    border-color: rgba(141, 162, 192, 0.24);
    background: rgba(255, 255, 255, 0.04);
}

.topbar-nav a.active {
    color: #f4f8ff;
    border-color: rgba(96, 147, 216, 0.55);
    background: linear-gradient(130deg, #335f96 0%, #3f7abf 52%, #4b8ecc 100%);
    box-shadow: 0 8px 20px rgba(51, 95, 150, 0.36);
}

.topbar-nav a.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.topbar-nav a i {
    font-size: 14px;
}

.topbar-nav a .soon {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-soft);
}

.topbar-nav-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.topbar-nav-group::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 8px;
}

.topbar-nav-group-trigger {
    padding-right: 9px;
}

.topbar-nav-group-caret {
    font-size: 10px;
    transition: transform 0.16s ease;
}

.topbar-nav-group:hover .topbar-nav-group-caret,
.topbar-nav-group:focus-within .topbar-nav-group-caret {
    transform: rotate(180deg);
}

.topbar-nav-submenu {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    min-width: 190px;
    padding: 7px;
    border-radius: 12px;
    border: 1px solid rgba(141, 162, 192, 0.24);
    background: linear-gradient(170deg, rgba(10, 20, 37, 0.98), rgba(7, 15, 29, 0.98));
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 1020;
}

.topbar-nav-group:hover .topbar-nav-submenu,
.topbar-nav-group:focus-within .topbar-nav-submenu {
    display: flex;
}

.topbar-nav-submenu a {
    border-radius: 9px;
    border: 1px solid transparent;
    padding: 7px 9px;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.16s ease;
}

.topbar-nav-submenu a:hover {
    color: var(--text-main);
    border-color: rgba(141, 162, 192, 0.24);
    background: rgba(255, 255, 255, 0.04);
}

.topbar-nav-submenu a.active {
    color: #f4f8ff;
    border-color: rgba(96, 147, 216, 0.55);
    background: linear-gradient(130deg, #335f96 0%, #3f7abf 52%, #4b8ecc 100%);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    min-width: 0;
}

.topbar-user-name {
    max-width: 170px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.topbar-user-role {
    max-width: 170px;
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-soft);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.topbar-icon-btn,
.topbar-avatar {
    border: 1px solid transparent;
    background: transparent;
    padding: 0;
    line-height: 1;
}

.topbar-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.18s ease;
    position: relative;
    cursor: pointer;
}

.topbar-icon-btn:hover {
    color: var(--text-main);
    border-color: rgba(141, 162, 192, 0.24);
    background: rgba(255, 255, 255, 0.04);
}

.topbar-icon-btn .dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f43f5e;
    border: 2px solid #08101d;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #edf4ff;
    background: linear-gradient(140deg, #335f96, #4b8ecc);
    box-shadow: 0 8px 20px rgba(51, 95, 150, 0.36);
    cursor: pointer;
    user-select: none;
}

.topbar-logout {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid rgba(141, 162, 192, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.16s ease;
}

.topbar-logout:hover {
    color: #ffd5d5;
    border-color: rgba(249, 115, 115, 0.48);
    background: rgba(249, 115, 115, 0.12);
}

.topbar-offcanvas {
    --bs-offcanvas-width: min(360px, 92vw);
    background: linear-gradient(170deg, rgba(10, 20, 37, 0.98), rgba(7, 15, 29, 0.98));
    color: var(--text-main);
    border-left: 1px solid rgba(141, 162, 192, 0.2);
}

.topbar-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(141, 162, 192, 0.16);
    padding: 12px 14px;
}

.topbar-offcanvas .offcanvas-title {
    font-size: 16px;
    font-weight: 700;
}

.topbar-offcanvas .offcanvas-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topbar-offcanvas-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(141, 162, 192, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.topbar-offcanvas-user .topbar-user-meta {
    align-items: flex-start;
}

.topbar-offcanvas-user .topbar-user-name,
.topbar-offcanvas-user .topbar-user-role {
    max-width: none;
}

.topbar-offcanvas-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topbar-offcanvas-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.16s ease;
}

.topbar-offcanvas-nav a:hover {
    color: var(--text-main);
    border-color: rgba(141, 162, 192, 0.24);
    background: rgba(255, 255, 255, 0.04);
}

.topbar-offcanvas-nav a.active {
    color: #f4f8ff;
    border-color: rgba(96, 147, 216, 0.55);
    background: linear-gradient(130deg, #335f96 0%, #3f7abf 52%, #4b8ecc 100%);
}

.topbar-offcanvas-nav a.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.topbar-offcanvas-nav a .soon {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-soft);
}

.topbar-offcanvas-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topbar-offcanvas-group-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: all 0.16s ease;
}

.topbar-offcanvas-group-toggle>span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topbar-offcanvas-group-toggle:hover {
    color: var(--text-main);
    border-color: rgba(141, 162, 192, 0.24);
    background: rgba(255, 255, 255, 0.04);
}

.topbar-offcanvas-group-toggle.active {
    color: #f4f8ff;
    border-color: rgba(96, 147, 216, 0.55);
    background: linear-gradient(130deg, #335f96 0%, #3f7abf 52%, #4b8ecc 100%);
}

.topbar-offcanvas-group-toggle i.bi-chevron-down {
    font-size: 11px;
    transition: transform 0.16s ease;
}

.topbar-offcanvas-group.is-open .topbar-offcanvas-group-toggle i.bi-chevron-down {
    transform: rotate(180deg);
}

.topbar-offcanvas-subnav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 12px;
}

.topbar-offcanvas-subnav[hidden] {
    display: none !important;
}

.topbar-offcanvas-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.16s ease;
}

.topbar-offcanvas-subnav a:hover {
    color: var(--text-main);
    border-color: rgba(141, 162, 192, 0.24);
    background: rgba(255, 255, 255, 0.04);
}

.topbar-offcanvas-subnav a.active {
    color: #f4f8ff;
    border-color: rgba(96, 147, 216, 0.55);
    background: linear-gradient(130deg, #335f96 0%, #3f7abf 52%, #4b8ecc 100%);
}

.topbar-offcanvas-logout {
    margin-top: 4px;
    color: #fca5a5 !important;
    border-color: rgba(249, 115, 115, 0.35) !important;
    background: rgba(249, 115, 115, 0.1) !important;
}

/* Main container */
.main-content {
    width: 100%;
    max-width: 1520px;
    margin: calc(var(--topbar-h) + 8px) auto 0;
    padding: 6px 8px 8px;
}

/* Auth */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 18px;
}

.auth-main {
    width: 100%;
}

.auth-shell {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    align-items: center;
}

.auth-brand img {
    width: 210px;
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.auth-brand p {
    margin: 0;
    max-width: 380px;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: linear-gradient(165deg, rgba(19, 35, 58, 0.94), rgba(12, 23, 40, 0.96));
    box-shadow: var(--shadow-soft);
    padding: 18px 16px;
}

.auth-card-header {
    margin-bottom: 12px;
}

.auth-card-header h1 {
    margin: 0;
    font-size: 24px;
}

.auth-card-header p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    pointer-events: none;
}

.auth-input-wrap .form-control {
    height: 40px;
    padding-left: 34px;
}

.auth-submit {
    height: 40px;
    margin-top: 3px;
}

.auth-alert {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
}

.auth-alert i {
    margin-top: 1px;
}

.auth-alert-danger {
    color: #ffd7d7;
    border-color: rgba(249, 115, 115, 0.36);
    background: rgba(127, 29, 29, 0.28);
}

/* Generic blocks */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.page-title-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.page-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #89a0bf;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 0;
}

.page-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.page-header h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-soft);
}

.breadcrumb-bar i {
    font-size: 11px;
}

.breadcrumb-current {
    color: var(--text-main);
    font-weight: 600;
}

.table-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: linear-gradient(165deg, rgba(19, 35, 58, 0.94), rgba(12, 23, 40, 0.96));
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(116, 167, 232, 0.62), transparent);
    pointer-events: none;
}

.table-card>* {
    position: relative;
    z-index: 1;
}

/* Buttons and form controls */
.btn-primary {
    border: 1px solid #4c86ca;
    background: linear-gradient(130deg, #3a72b3 0%, #4b8bcc 100%);
    color: #f4f8ff;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(130deg, #325f96 0%, #3f7abf 100%);
    border-color: #3f7abf;
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(51, 95, 150, 0.35);
}

.btn-primary:disabled,
.btn-primary.disabled,
.disabled-action {
    opacity: 0.48;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text-muted);
    background: transparent;
    margin-top: 3px;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: var(--text-main);
    border-color: #4b6f9c;
    background: rgba(255, 255, 255, 0.05);
}

.form-control,
.form-select {
    background: rgba(8, 16, 29, 0.8);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: rgba(8, 16, 29, 0.58);
    border-color: rgba(65, 87, 120, 0.72);
    color: #8fa3c1;
    opacity: 1;
}

.form-control::placeholder {
    color: #6f85a6;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    background: rgba(8, 16, 29, 0.95);
    color: var(--text-main);
    box-shadow: 0 0 0 3px rgba(63, 122, 191, 0.18);
}

.modal-content {
    background: linear-gradient(165deg, #13223a, #0d182b);
    border-color: var(--border);
    color: var(--text-main);
}

.btn-close {
    filter: invert(1) grayscale(1) brightness(1.7);
    opacity: 0.75;
}

.btn-close:hover {
    opacity: 1;
}

/* Stage cards */
.stat-card {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(155deg, rgba(22, 37, 61, 0.95), rgba(13, 24, 41, 0.95));
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.08), transparent 50%);
    opacity: 0;
    transition: opacity 0.16s ease;
}

.stat-card:hover {
    transform: none;
    border-color: var(--border-strong);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
    color: inherit;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(63, 122, 191, 0.22), 0 14px 28px rgba(0, 0, 0, 0.25);
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.stage-card-icon {
    background: var(--etapa-bg, rgba(63, 122, 191, 0.18));
    color: var(--etapa-cor, var(--primary));
    border: 1px solid var(--etapa-border, rgba(63, 122, 191, 0.42));
}

.stat-value {
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    margin-top: 1px;
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Leads page blocks */
.leads-page {
    display: flex;
    flex-direction: column;
}

/* Pipeline page */
.pipeline-page {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-header--pipeline {
    margin-bottom: 2px;
}

.pipeline-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(120, 169, 230, 0.35);
    background: rgba(63, 122, 191, 0.16);
    color: #dbe9ff;
    font-size: 11px;
    font-weight: 700;
}

.pipeline-toolbar-card {
    overflow: hidden;
}

.pipeline-toolbar {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(11, 21, 37, 0.95), rgba(8, 16, 28, 0.95));
}

.pipeline-hidden-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 0 10px 8px;
}

.pipeline-hidden-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.pipeline-hidden-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 28px;
}

.pipeline-hidden-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(141, 162, 192, 0.32);
    background: rgba(255, 255, 255, 0.04);
    color: #d6e4fa;
    border-radius: 999px;
    padding: 4px 6px 4px 9px;
    font-size: 11px;
    font-weight: 700;
}

.pipeline-hidden-chip-remove {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(249, 115, 115, 0.45);
    background: rgba(249, 115, 115, 0.12);
    color: #ffb7b7;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

.pipeline-hidden-chip-remove:hover {
    background: rgba(249, 115, 115, 0.2);
    border-color: rgba(249, 115, 115, 0.7);
    color: #ffd4d4;
}

.pipeline-search-box {
    flex: 1;
    min-width: 200px;
    max-width: 390px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    padding: 5px 10px;
}

.pipeline-search-box:focus-within {
    border-color: rgba(63, 122, 191, 0.62);
    box-shadow: 0 0 0 3px rgba(63, 122, 191, 0.16);
}

.pipeline-search-box i {
    color: var(--text-soft);
    font-size: 12px;
}

.pipeline-search-box input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 12px;
}

.pipeline-search-box input::placeholder {
    color: #6f85a6;
}

.pipeline-board-wrap {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
}

.pipeline-board {
    min-width: max-content;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 300px);
    gap: 10px;
}

.pipeline-column {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(165deg, rgba(19, 35, 58, 0.94), rgba(12, 23, 40, 0.96));
    min-height: 460px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pipeline-column.is-hidden-stage {
    display: none;
}

.pipeline-column--sem-etapa {
    border-style: dashed;
    border-color: rgba(141, 162, 192, 0.35);
}

.pipeline-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(141, 162, 192, 0.16);
    background: linear-gradient(180deg, rgba(11, 21, 37, 0.9), rgba(8, 16, 28, 0.9));
}

.pipeline-column-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pipeline-column-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.pipeline-column-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--etapa-bg, rgba(63, 122, 191, 0.18));
    color: var(--etapa-cor, #74a7e8);
    border: 1px solid var(--etapa-border, rgba(63, 122, 191, 0.4));
    flex-shrink: 0;
}

.pipeline-column-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-column-count {
    min-width: 26px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #dce9ff;
    border: 1px solid rgba(120, 169, 230, 0.35);
    background: rgba(63, 122, 191, 0.15);
}

.pipeline-hide-stage-btn {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(249, 115, 115, 0.45);
    background: rgba(249, 115, 115, 0.12);
    color: #ffb3b3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pipeline-hide-stage-btn i {
    font-size: 10px;
    line-height: 1;
}

.pipeline-hide-stage-btn:hover {
    border-color: rgba(249, 115, 115, 0.72);
    background: rgba(249, 115, 115, 0.2);
    color: #ffd4d4;
}

.pipeline-column-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 215px);
}

.pipeline-empty {
    border: 1px dashed rgba(141, 162, 192, 0.3);
    border-radius: 9px;
    padding: 12px 10px;
    text-align: center;
    color: var(--text-soft);
    font-size: 11px;
}

.pipeline-lead-card {
    border: 1px solid rgba(141, 162, 192, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pipeline-lead-card-open {
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.pipeline-lead-card-open:hover {
    border-color: rgba(120, 169, 230, 0.4);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.pipeline-lead-card-open:focus-visible {
    outline: none;
    border-color: rgba(120, 169, 230, 0.62);
    box-shadow: 0 0 0 3px rgba(63, 122, 191, 0.16);
}

.pipeline-lead-card-open.is-filter-hidden {
    display: none;
}

.pipeline-lead-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.pipeline-lead-name {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    color: #edf5ff;
}

.pipeline-lead-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

.pipeline-lead-info i {
    color: var(--text-soft);
}

.pipeline-lead-foot {
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.pipeline-lead-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-soft);
}

.pipeline-last-actor {
    max-width: 126px;
    font-size: 10px;
    color: #9fc1ea;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-header--leads {
    margin-bottom: 6px;
}

.stage-toggle-row {
    margin-bottom: 4px;
}

.stage-toggle-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 0;
}

.stage-toggle-btn:hover {
    color: var(--text-main);
}

.stage-toggle-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(141, 162, 192, 0.25);
    transition: transform 0.2s ease;
}

.stage-toggle-icon.is-open {
    transform: rotate(180deg);
}

.etapas-summary-collapse {
    overflow: hidden;
    max-height: 0;
    margin-bottom: 0;
    transition: max-height 0.3s ease, margin-bottom 0.3s ease;
}

.stage-card-content {
    min-width: 0;
}

.leads-table-card {
    overflow: hidden;
}

/* Toolbar */
.dt-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(11, 21, 37, 0.95), rgba(8, 16, 28, 0.95));
}

.dt-toolbar .search-box {
    flex: 1;
    min-width: 190px;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    padding: 5px 10px;
    transition: all 0.15s ease;
}

.dt-toolbar .search-box:focus-within {
    border-color: rgba(63, 122, 191, 0.62);
    box-shadow: 0 0 0 3px rgba(63, 122, 191, 0.16);
    background: rgba(255, 255, 255, 0.05);
}

.dt-toolbar .search-box i {
    color: var(--text-soft);
    font-size: 12px;
    flex-shrink: 0;
}

.dt-toolbar .search-box input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-main);
    font-size: 12px;
}

.dt-toolbar .search-box input::placeholder {
    color: #6f85a6;
}

.toolbar-select {
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    padding: 0 28px 0 10px;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
    color-scheme: dark;
}

.toolbar-select:focus {
    border-color: rgba(63, 122, 191, 0.62);
    box-shadow: 0 0 0 3px rgba(63, 122, 191, 0.16);
}

.toolbar-select option,
.toolbar-select optgroup {
    background-color: #0f1d31;
    color: var(--text-main);
}

select option,
select optgroup {
    background-color: #0f1d31;
    color: var(--text-main);
}

.toolbar-select-small {
    min-width: 74px;
}

.dt-toolbar .select2-container {
    min-width: 194px;
}

.dt-toolbar .select2-container--default .select2-selection--single {
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
}

.dt-toolbar .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    line-height: 32px;
    padding-left: 10px;
    padding-right: 28px;
}

.dt-toolbar .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 30px;
    right: 6px;
}

.dt-toolbar .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #8ea6c8 transparent transparent transparent;
}

.dt-toolbar .select2-container--default.select2-container--focus .select2-selection--single,
.dt-toolbar .select2-container--default.select2-container--open .select2-selection--single {
    border-color: rgba(63, 122, 191, 0.62);
    box-shadow: 0 0 0 3px rgba(63, 122, 191, 0.16);
}

.select2-container--default .select2-dropdown {
    border: 1px solid var(--border);
    background: #0f1d31;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
}

.select2-container--default .select2-results>.select2-results__options {
    max-height: 320px;
}

.select2-container--default .select2-results__option {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    padding: 7px 10px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: rgba(116, 154, 206, 0.14) !important;
    color: var(--text-main) !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: rgba(63, 122, 191, 0.24) !important;
    color: #f2f7ff !important;
}

.select2-container--default .select2-results__option.select2-results__option--selected {
    background: rgba(63, 122, 191, 0.24) !important;
    color: #f2f7ff !important;
}

.etapa-select2-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.etapa-select2-option i {
    width: 14px;
    flex: 0 0 14px;
    font-size: 11px;
    text-align: center;
}

.etapa-select2-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-clear-filters {
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: all 0.18s ease;
}

.btn-clear-filters.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.toolbar-right {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 12px;
}

.per-page-label {
    margin: 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    font-weight: 700;
}

.toolbar-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

.results-amount strong {
    color: var(--text-main);
    font-weight: 800;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 34px 14px;
}

.empty-state-icon {
    display: block;
    font-size: 34px;
    color: #4f6282;
    margin-bottom: 12px;
}

.empty-state-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.empty-state-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* DataTables */
table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse !important;
    border-spacing: 0;
}

table.dataTable thead th {
    background: rgba(12, 22, 38, 0.98);
    color: #91a5c3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.dataTable tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(141, 162, 192, 0.14);
    vertical-align: middle;
    color: var(--text-main);
}

table.dataTable tbody tr {
    transition: background 0.15s ease;
}

table.dataTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.035) !important;
    cursor: pointer;
}

table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

.col-id {
    width: 56px;
}

.lead-id-cell {
    color: #6f86a9;
    font-size: 11px;
    font-weight: 700;
}

.lead-main-cell {
    min-width: 150px;
}

.lead-name {
    font-size: 12px;
    font-weight: 700;
    color: #f2f7ff;
}

.lead-sub {
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    color: var(--text-muted);
}

.lead-sub i {
    font-size: 10px;
}

.contact-email-cell,
.contact-phone-cell {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 150px;
}

.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 210px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-chip i {
    font-size: 10px;
    color: #7f97ba;
    flex-shrink: 0;
}

.clinic-cell,
.role-cell {
    font-size: 12px;
}

.role-cell,
.location-cell {
    color: var(--text-muted);
}

.location-cell {
    font-size: 11px;
}

.location-cell i {
    margin-right: 4px;
}

.entry-cell {
    white-space: nowrap;
}

.entry-stack {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.15;
}

.entry-date {
    font-size: 11px;
    font-weight: 700;
}

.entry-time {
    font-size: 10px;
    color: var(--text-muted);
}

.empty-value {
    color: #6980a1;
    font-size: 10.5px;
}

.badge-origem {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(141, 162, 192, 0.28);
    background: rgba(141, 162, 192, 0.09);
    color: #c8d5ea;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.reuniao-status-faltou {
    border-color: rgba(248, 113, 113, 0.44);
    background: rgba(185, 28, 28, 0.18);
    color: #fecaca;
}

.reuniao-lead-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    line-height: 1.15;
}

.reuniao-lead-name {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reuniao-lead-clinic,
.reuniao-lead-phone {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reuniao-lead-clinic {
    color: #d7e5f8;
    font-size: 11px;
    font-weight: 700;
}

.reuniao-lead-phone {
    color: #8fa6c7;
    font-size: 10.5px;
    font-weight: 600;
}

.reuniao-lead-clinic i,
.reuniao-lead-phone i {
    flex: 0 0 auto;
    width: 12px;
    color: #7f97ba;
    font-size: 10px;
}

.reuniao-lead-clinic span,
.reuniao-lead-phone span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-etapa {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--etapa-border, rgba(63, 122, 191, 0.38));
    background: var(--etapa-bg, rgba(63, 122, 191, 0.18));
    color: var(--etapa-cor, var(--primary));
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-etapa-empty {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px dashed rgba(141, 162, 192, 0.34);
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 600;
}

.stage-cell {
    min-width: 120px;
}

.actions-cell {
    min-width: 72px;
    white-space: nowrap;
}

.btn-stage-action {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    border-radius: 7px;
    padding: 0;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    line-height: 1;
}

.btn-stage-action:last-child {
    margin-right: 0;
}

.btn-stage-action:hover {
    color: var(--text-main);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.06);
}

/* Bottom info and paging */
.dt-bottom {
    border-top: 1px solid var(--border);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(9, 18, 32, 0.82), rgba(8, 15, 27, 0.82));
}

.dt-info-text {
    font-size: 11px;
    color: var(--text-muted);
}

.dt-paging {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dt-paging button {
    min-width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 700;
    padding: 0 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dt-paging button:hover:not(:disabled) {
    border-color: rgba(63, 122, 191, 0.55);
    color: #eaf2ff;
    background: rgba(63, 122, 191, 0.18);
}

.dt-paging button.current,
.dt-paging button.current:hover {
    border-color: #78a9e6;
    color: #f7fbff;
    background: linear-gradient(135deg, #386aa6, #4a86c4);
}

.dt-paging button:disabled {
    opacity: 0.4;
    cursor: default;
}

.paging-gap {
    color: var(--text-soft);
    font-size: 11px;
    padding: 0 3px;
}

/* Etapas page */
.etapas-page {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.page-header--compact {
    margin-bottom: 10px;
}

.etapas-card {
    border-color: rgba(56, 82, 118, 0.8);
}

.etapas-order-actions {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(8, 16, 29, 0.96);
    border: 1px solid rgba(120, 169, 230, 0.38);
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(5, 10, 20, 0.5);
    padding: 10px 12px;
}

.etapas-order-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.etapas-order-actions .btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .etapas-order-actions {
        left: 10px;
        right: 10px;
        bottom: 10px;
        justify-content: space-between;
        gap: 8px;
    }

    .etapas-order-hint {
        font-size: 11px;
    }
}

.etapas-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.etapas-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
}

.etapa-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(141, 162, 192, 0.16);
    cursor: default;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.etapa-item:last-child {
    border-bottom: none;
}

.etapa-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(141, 162, 192, 0.28);
}

.etapa-drag {
    color: #7190b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    width: 20px;
}

.etapa-drag:active {
    cursor: grabbing;
}

.etapa-drag i {
    font-size: 16px;
}

.etapa-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: var(--etapa-bg, rgba(63, 122, 191, 0.18));
    color: var(--etapa-cor, var(--primary));
    border: 1px solid var(--etapa-border, rgba(63, 122, 191, 0.36));
}

.etapa-meta {
    flex: 1;
    min-width: 0;
}

.etapa-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    color: #edf5ff;
}

.etapa-count {
    margin-top: 1px;
    font-size: 11px;
    color: var(--text-muted);
}

.etapa-color-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.28);
    flex-shrink: 0;
}

.etapa-actions {
    display: flex;
    gap: 5px;
}

.btn-acao {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.btn-acao i {
    font-size: 12px;
}

.btn-acao:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.btn-excluir:not([disabled]) {
    color: #f37f7f;
}

.btn-excluir[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    color: #657b9d;
}

.etapa-modal-dialog {
    max-width: 390px;
}

.etapa-modal {
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-strong);
}

.etapa-modal-header {
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.lead-action-header-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lead-action-header-subtitle {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 12px;
    color: #f4f8ff;
    font-weight: 600;
    line-height: 1.25;
}

.lead-action-header-line {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-action-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lead-action-header-actions .btn-close {
    margin: 0;
}

.lead-action-send-btn {
    border-color: rgba(84, 156, 255, 0.55);
    background: rgba(52, 109, 193, 0.12);
    color: #e8f2ff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    padding: 4px 9px;
}

.lead-action-send-btn:hover,
.lead-action-send-btn:focus {
    border-color: rgba(104, 171, 255, 0.8);
    background: rgba(52, 109, 193, 0.24);
    color: #ffffff;
}

.lead-action-send-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.etapa-modal-body {
    padding: 12px 14px;
}

.etapa-modal-footer {
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    gap: 6px;
}

.etapa-modal-footer .btn {
    font-size: 12px;
    padding: 5px 10px;
}

.form-label-caps {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.lead-closure-select {
    font-weight: 700;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.lead-closure-select.lead-closure-none,
.lead-closure-select.lead-closure-reopen {
    color: #8cc7ff;
    border-color: rgba(76, 141, 255, 0.45);
    box-shadow: 0 0 0 1px rgba(76, 141, 255, 0.2) inset;
}

.lead-closure-select.lead-closure-won {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25) inset;
}

.lead-closure-select.lead-closure-lost {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25) inset;
}

.lead-closure-select option {
    background: #0f1d34;
    color: #d8e5ff;
}

.lead-closure-select option[value="none"],
.lead-closure-select option[value="reopen"] {
    color: #8cc7ff;
}

.lead-closure-select option[value="won"] {
    color: #86efac;
}

.lead-closure-select option[value="lost"] {
    color: #fca5a5;
}

.move-lead-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.lead-meeting-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 5px 8px;
    border: 1px solid rgba(141, 162, 192, 0.28);
    border-radius: 999px;
    background: rgba(141, 162, 192, 0.1);
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.lead-meeting-indicator i {
    color: #8ca4c9;
    font-size: 11px;
}

.lead-meeting-indicator.is-scheduled {
    border-color: rgba(65, 170, 110, 0.4);
    background: rgba(65, 170, 110, 0.15);
    color: #b8f5d3;
}

.lead-meeting-indicator.is-scheduled i {
    color: #78d9a6;
}

.lead-action-tabs {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(141, 162, 192, 0.2);
    gap: 5px;
}

.lead-action-tabs .nav-item {
    margin-bottom: -1px;
}

.lead-action-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    background: transparent;
}

.lead-action-tabs .nav-link:hover,
.lead-action-tabs .nav-link:focus {
    color: var(--text-main);
    border-color: rgba(141, 162, 192, 0.25);
    background: rgba(255, 255, 255, 0.03);
}

.lead-action-tabs .nav-link.active {
    color: #f2f7ff;
    border-color: rgba(63, 122, 191, 0.58);
    border-bottom-color: #13223a;
    background: linear-gradient(155deg, rgba(24, 43, 72, 0.95), rgba(18, 33, 55, 0.95));
}

.lead-action-content {
    min-height: 255px;
}

.hist-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hist-item {
    border: 1px solid rgba(141, 162, 192, 0.2);
    border-radius: 8px;
    padding: 8px 9px;
    background: rgba(255, 255, 255, 0.02);
}

.hist-item-entry {
    border-color: rgba(63, 122, 191, 0.45);
    background: rgba(63, 122, 191, 0.12);
}

.hist-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.hist-item-to {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hist-item-date {
    font-size: 10px;
    color: var(--text-soft);
    white-space: nowrap;
}

.hist-item-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    color: var(--text-muted);
}

.hist-item-note {
    margin-top: 5px;
    font-size: 11px;
    color: #d6e1f4;
    border-left: 2px solid rgba(141, 162, 192, 0.36);
    padding-left: 7px;
    white-space: pre-line;
}

.hist-empty {
    font-size: 12px;
    color: var(--text-muted);
}

.mini-help-text {
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-soft);
}

.wa-audio-box {
    border: 1px solid rgba(141, 162, 192, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px;
}

.wa-audio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wa-audio-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
}

.wa-audio-preview {
    width: 100%;
    margin-top: 8px;
}

.wa-audio-preview::-webkit-media-controls-panel {
    background: #10233f;
}

/* Dashboard */
.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 9px 10px;
}

.dashboard-card.is-danger {
    border-color: rgba(249, 115, 115, 0.46);
    background: rgba(127, 29, 29, 0.2);
}

.dashboard-card-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    font-weight: 700;
}

.dashboard-card-value {
    margin-top: 2px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
}

.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tasks-page {
    gap: 9px;
}

.tasks-kpi-grid {
    gap: 9px;
}

.tasks-kpi-card {
    background: linear-gradient(165deg, rgba(18, 34, 57, 0.92), rgba(13, 25, 43, 0.94));
    border-color: rgba(106, 156, 220, 0.26);
    padding: 8px 10px 9px;
}

.tasks-kpi-head {
    display: flex;
    align-items: center;
    gap: 7px;
}

.tasks-kpi-icon {
    width: 21px;
    height: 21px;
    border-radius: 6px;
    border: 1px solid rgba(126, 176, 236, 0.45);
    background: rgba(60, 131, 222, 0.16);
    color: #b7d7ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.tasks-kpi-card.is-danger .tasks-kpi-icon {
    border-color: rgba(249, 115, 115, 0.5);
    background: rgba(249, 115, 115, 0.14);
    color: #ffc6c6;
}

.tasks-kpi-meta {
    margin-top: 1px;
    font-size: 10px;
    color: var(--text-muted);
}

.tasks-columns {
    gap: 9px;
}

.tasks-panel {
    border-radius: 12px;
}

.tasks-panel-header {
    padding: 7px 10px;
}

.tasks-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tasks-panel-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tasks-panel-header h2 i {
    font-size: 12px;
    color: #a8c9ef;
}

.tasks-panel-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(141, 162, 192, 0.3);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.tasks-panel--today .tasks-panel-header h2 i {
    color: #f7d889;
}

.tasks-panel--overdue .tasks-panel-header h2 i {
    color: #ffb5b5;
}

.tasks-panel--next .tasks-panel-header h2 i {
    color: #9ad0ff;
}

.analytics-dashboard-page {
    gap: 12px;
}

.analytics-filter-card {
    padding: 10px;
}

.analytics-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.analytics-filter-toolbar .toolbar-select {
    min-width: 190px;
}

.analytics-date-range {
    min-width: 240px;
    cursor: pointer;
}

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.analytics-kpi-card {
    border: 1px solid rgba(94, 143, 208, 0.28);
    border-radius: 11px;
    background: linear-gradient(180deg, rgba(20, 37, 67, 0.9), rgba(13, 28, 52, 0.86));
    padding: 10px 11px;
}

.analytics-kpi-card.is-positive {
    border-color: rgba(34, 197, 94, 0.45);
}

.analytics-kpi-card.is-negative {
    border-color: rgba(239, 68, 68, 0.45);
}

.analytics-kpi-card.is-highlight {
    border-color: rgba(56, 189, 248, 0.55);
    background: linear-gradient(180deg, rgba(12, 43, 68, 0.95), rgba(12, 29, 55, 0.9));
}

.analytics-kpi-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-soft);
    font-weight: 700;
}

.analytics-kpi-value {
    margin-top: 4px;
    font-size: 24px;
    font-weight: 800;
    color: #e7efff;
    line-height: 1.1;
}

.analytics-kpi-meta {
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.analytics-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.analytics-chart-card {
    overflow: hidden;
}

.analytics-chart {
    padding: 8px 6px 4px;
    min-height: 300px;
}

.analytics-chart--donut {
    min-height: 300px;
}

.apexcharts-tooltip,
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
    background: #0b1c38 !important;
    color: #e5eefc !important;
    border: 1px solid rgba(98, 153, 223, 0.45) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35) !important;
}

.apexcharts-tooltip-title {
    background: rgba(31, 64, 114, 0.75) !important;
    color: #dbe9ff !important;
    border-bottom: 1px solid rgba(98, 153, 223, 0.4) !important;
}

.apexcharts-tooltip-text-y-label,
.apexcharts-tooltip-text-y-value,
.apexcharts-tooltip-text-z-label,
.apexcharts-tooltip-text-z-value,
.apexcharts-tooltip-text-x-label,
.apexcharts-tooltip-series-group span {
    color: #e5eefc !important;
}

.apexcharts-xaxistooltip:before,
.apexcharts-xaxistooltip:after,
.apexcharts-yaxistooltip:before,
.apexcharts-yaxistooltip:after {
    border-bottom-color: rgba(98, 153, 223, 0.45) !important;
}

.daterangepicker {
    border: 1px solid rgba(98, 153, 223, 0.45) !important;
    background: #0b1c38 !important;
    color: #dce7fa !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42) !important;
}

.daterangepicker:before,
.daterangepicker:after {
    border-bottom-color: rgba(98, 153, 223, 0.45) !important;
}

.daterangepicker .calendar-table,
.daterangepicker .ranges li {
    background: transparent !important;
    border: none !important;
    color: #dce7fa !important;
}

.daterangepicker .calendar-table th,
.daterangepicker .calendar-table td {
    color: #dce7fa !important;
    background: transparent !important;
}

.daterangepicker td.off,
.daterangepicker td.off.in-range,
.daterangepicker td.off.start-date,
.daterangepicker td.off.end-date {
    color: #6b83a6 !important;
    background: rgba(22, 40, 69, 0.72) !important;
}

.daterangepicker td.disabled,
.daterangepicker option.disabled {
    color: #6b83a6 !important;
    text-decoration: line-through;
}

.daterangepicker td.start-date,
.daterangepicker td.end-date {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

.daterangepicker td.available:hover,
.daterangepicker th.available:hover,
.daterangepicker .ranges li:hover {
    background: rgba(56, 130, 246, 0.2) !important;
}

.daterangepicker td.in-range {
    background: rgba(56, 130, 246, 0.3) !important;
}

.daterangepicker td.active,
.daterangepicker td.active:hover,
.daterangepicker .ranges li.active {
    background-color: #3b82f6 !important;
    color: #fff !important;
}

.daterangepicker .drp-buttons {
    border-top: 1px solid rgba(98, 153, 223, 0.35) !important;
}

.daterangepicker .drp-buttons .btn {
    font-size: 12px !important;
}

.daterangepicker .monthselect,
.daterangepicker .yearselect,
.daterangepicker .hourselect,
.daterangepicker .minuteselect,
.daterangepicker .ampmselect {
    background: #0f2447 !important;
    color: #dce7fa !important;
    border: 1px solid rgba(98, 153, 223, 0.45) !important;
}

.dashboard-panel {
    overflow: hidden;
}

.dashboard-panel-header {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(141, 162, 192, 0.16);
}

.dashboard-panel-header h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.profile-evolution-box {
    border: 1px solid rgba(120, 169, 230, 0.2);
    background: rgba(18, 34, 64, 0.5);
    border-radius: 10px;
    padding: 10px;
}

.profile-evolution-head {
    margin-bottom: 8px;
}

.profile-evolution-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.profile-evolution-subtitle {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

.profile-evolution-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.profile-evolution-status {
    border: 1px solid rgba(141, 162, 192, 0.2);
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 12px;
    line-height: 1.4;
}

.profile-evolution-status--muted {
    color: var(--text-muted);
    background: rgba(11, 27, 52, 0.52);
}

.profile-evolution-status--info {
    color: #b6d9ff;
    background: rgba(16, 55, 104, 0.35);
    border-color: rgba(65, 140, 231, 0.45);
}

.profile-evolution-status--success {
    color: #b7f7d0;
    background: rgba(17, 87, 49, 0.34);
    border-color: rgba(47, 196, 108, 0.42);
}

.profile-evolution-status--warning {
    color: #ffe2aa;
    background: rgba(117, 74, 11, 0.3);
    border-color: rgba(255, 177, 52, 0.45);
}

.profile-evolution-status--danger {
    color: #ffb6bf;
    background: rgba(116, 23, 36, 0.35);
    border-color: rgba(228, 80, 103, 0.45);
}

.profile-evolution-qr {
    margin-top: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.profile-evolution-qr img {
    width: min(260px, 100%);
    max-width: 100%;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
}

.profile-evolution-pairing {
    max-width: 260px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    word-break: break-all;
}

.dashboard-empty {
    padding: 14px 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.task-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(141, 162, 192, 0.12);
}

.task-item:last-child {
    border-bottom: none;
}

.task-item-open {
    cursor: pointer;
    transition: background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.task-item-open:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(63, 122, 191, 0.06));
}

.task-item-open:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(120, 169, 230, 0.75);
}

.task-item.is-overdue {
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.2), rgba(127, 29, 29, 0.08));
}

.task-main {
    min-width: 0;
    flex: 1;
}

.task-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}

.task-stage-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(120, 169, 230, 0.35);
    background: rgba(63, 122, 191, 0.14);
    color: #b8d8ff;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-lead {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-meta {
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-muted);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-meta-item i {
    color: var(--text-soft);
    font-size: 10px;
}

.task-meta-dot {
    color: #647b9d;
    flex-shrink: 0;
}

.task-note {
    margin-top: 4px;
    font-size: 10.5px;
    color: #d6e1f4;
    border-left: 2px solid rgba(141, 162, 192, 0.3);
    padding-left: 7px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.35;
}

.task-note i {
    margin-top: 1px;
    color: #8fb0d8;
    flex-shrink: 0;
}

.task-side {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    min-width: 116px;
}

.task-last-actor {
    max-width: 150px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #9ec0ea;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-due {
    white-space: nowrap;
    font-size: 10px;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-due i,
.task-last-actor i {
    font-size: 10px;
    opacity: 0.9;
}

.etapa-color-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.etapa-color-input {
    width: 34px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 2px;
    cursor: pointer;
}

.etapa-color-hex {
    flex: 1;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 5px 8px;
    font-size: 12px;
    font-family: monospace;
    max-width: 92px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.cores-rapidas {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cor-rapida {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.12s, transform 0.12s;
}

.cor-rapida:hover {
    transform: scale(1.08);
}

.icon-picker {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    max-height: 145px;
    overflow-y: auto;
    padding: 6px;
    background: rgba(9, 18, 32, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.icon-opt {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 1.5px solid transparent;
    background: var(--card-bg-soft);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.12s;
}

.etapa-preview {
    margin-top: 10px;
    padding: 10px 11px;
    background: rgba(9, 18, 32, 0.75);
    border: 1px solid rgba(141, 162, 192, 0.16);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.preview-icon-box {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: #2563eb1a;
    color: #2563eb;
}

.preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #2563eb1a;
    color: #2563eb;
    border: 1px solid #2563eb33;
}

.sortable-ghost {
    opacity: 0.45;
    background: rgba(63, 122, 191, 0.16) !important;
}

/* Hide native DataTables controls */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate,
.dt-container .dt-layout-row:not(.dt-layout-table) {
    display: none !important;
}

/* Legacy status classes kept for compatibility */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
}

.bs-novo {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
}

.bs-em_contato {
    background: rgba(14, 116, 144, 0.22);
    color: #67e8f9;
}

.bs-interessado {
    background: rgba(180, 83, 9, 0.22);
    color: #fcd34d;
}

.bs-proposta_enviada {
    background: rgba(109, 40, 217, 0.22);
    color: #c4b5fd;
}

.bs-convertido {
    background: rgba(21, 128, 61, 0.22);
    color: #86efac;
}

.bs-perdido {
    background: rgba(185, 28, 28, 0.2);
    color: #fca5a5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: rgba(5, 11, 21, 0.75);
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(107, 132, 166, 0.65);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(126, 153, 190, 0.85);
}

/* Responsive */
@media (max-width: 1200px) {
    .dt-toolbar .search-box {
        max-width: none;
        flex: 1 1 100%;
    }

    .pipeline-search-box {
        max-width: none;
        flex: 1 1 100%;
    }
}

@media (max-width: 1280px) {
    .topbar {
        padding: 0 12px;
        gap: 6px;
    }

    .topbar-brand {
        margin-right: auto;
    }

    .topbar-toggle {
        display: inline-flex;
    }

    .topbar-menu {
        display: none;
    }
}

@media (max-width: 992px) {
    :root {
        --topbar-h: 56px;
    }

    .main-content {
        margin-top: calc(var(--topbar-h) + 8px);
        padding: 8px 8px 10px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-title {
        font-size: 21px;
    }

    .dt-toolbar {
        padding: 9px 10px;
    }

    .toolbar-right {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .pipeline-column-body {
        max-height: none;
    }

    .auth-shell {
        max-width: 460px;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .auth-brand {
        text-align: center;
    }

    .auth-brand p {
        margin: 0 auto;
    }

    .dashboard-cards,
    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .analytics-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-chart-grid {
        grid-template-columns: 1fr;
    }

    .analytics-filter-toolbar .toolbar-select,
    .analytics-date-range {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 19px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .col-id,
    .lead-id-cell {
        display: none;
    }

    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 7px 8px;
    }

    .dt-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .dt-paging {
        flex-wrap: wrap;
    }

    .analytics-kpi-grid {
        grid-template-columns: 1fr;
    }

    .tasks-panel-title {
        align-items: flex-start;
    }

    .task-item {
        flex-direction: column;
        gap: 6px;
    }

    .task-top {
        flex-wrap: wrap;
    }

    .task-meta {
        flex-wrap: wrap;
        white-space: normal;
    }

    .task-side {
        min-width: 0;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
}

@media (max-width: 520px) {
    .topbar-brand img {
        height: 24px;
    }

    .topbar {
        padding: 0 10px;
    }

    .topbar-toggle {
        width: 34px;
        height: 34px;
    }

    .topbar-offcanvas {
        --bs-offcanvas-width: 100vw;
    }

    .topbar-offcanvas .offcanvas-body {
        padding: 10px;
    }

    .topbar-nav a {
        gap: 6px;
        font-size: 11.5px;
        padding: 6px 9px;
    }

    .topbar-user-meta {
        flex: 1;
        min-width: 0;
    }

    .dt-toolbar {
        gap: 8px;
    }

    .toolbar-select {
        width: 100%;
    }

    .dt-toolbar .select2-container {
        width: 100%;
    }

    .toolbar-right {
        gap: 6px;
    }

    .toolbar-select-small {
        width: auto;
        min-width: 72px;
    }

    .auth-page {
        padding: 12px;
    }

    .auth-card {
        padding: 14px 12px;
    }

    .auth-card-header h1 {
        font-size: 21px;
    }
}

/* ===== Agenda Tab (lead action modal) ===== */
.agenda-nav-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0 10px;
}

.btn-agenda-nav {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    padding: 0;
}

.btn-agenda-nav:hover {
    background: rgba(255, 255, 255, .07);
    color: var(--text);
}

.agenda-date-label {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.agenda-today-btn {
    font-size: 11px;
    padding: 2px 9px;
    flex-shrink: 0;
    height: 28px;
    line-height: 1;
}

.agenda-timeline-wrap {
    height: 340px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    border-radius: 6px;
    border: 1px solid var(--border);
    scrollbar-width: thin;
}

.agenda-timeline {
    position: relative;
    /* height is set by JS: (H_END - H_START) * H_PX */
}

.agenda-hour-row {
    height: 54px;
    display: flex;
    align-items: flex-start;
    position: relative;
}

.agenda-hour-label {
    width: 44px;
    text-align: right;
    padding-right: 8px;
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    line-height: 1;
    font-weight: 500;
    user-select: none;
    transform: translateY(-5px);
}

.agenda-hour-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    opacity: .55;
}

.agenda-now-line {
    position: absolute;
    left: 44px;
    right: 0;
    height: 2px;
    background: #f87171;
    z-index: 2;
    border-radius: 1px;
    pointer-events: none;
}

.agenda-now-line::before {
    content: '';
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f87171;
}

.agenda-event {
    position: absolute;
    left: 50px;
    right: 6px;
    border-radius: 5px;
    background: rgba(52, 109, 193, 0.72);
    border-left: 3px solid #4e9fff;
    padding: 3px 7px;
    overflow: hidden;
    z-index: 1;
    cursor: default;
    transition: background .15s;
}

.agenda-event:hover {
    background: rgba(52, 109, 193, 0.88);
}

.agenda-event.is-done {
    background: rgba(22, 101, 52, 0.55);
    border-left-color: #4ade80;
}

.agenda-event.is-done:hover {
    background: rgba(22, 101, 52, 0.72);
}

.agenda-event.is-missed {
    background: rgba(153, 27, 27, 0.62);
    border-left-color: #f87171;
}

.agenda-event.is-missed:hover {
    background: rgba(153, 27, 27, 0.78);
}

.agenda-event-time {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, .75);
    line-height: 1;
}

.agenda-event-name {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-top: 2px;
}

.agenda-event-lead {
    font-size: 10px;
    color: rgba(255, 255, 255, .6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.agenda-empty {
    position: absolute;
    left: 50px;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
}

.agenda-loading-msg {
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}