/* ============================================
   LeadHouse — Premium Dark Theme
   Inspirado no estilo Tegra Incorporadora
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta escura premium */
    --bg-dark: #0A0A0A;
    --bg-card: rgba(22, 22, 22, 0.65);
    --bg-card-solid: #161616;
    --bg-card-hover: rgba(28, 28, 28, 0.7);
    --bg-elevated: rgba(30, 30, 30, 0.75);
    --bg-input: rgba(26, 26, 26, 0.8);
    --bg-sidebar: rgba(13, 13, 13, 0.85);

    /* Glass */
    --glass-blur: 20px;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shine: inset 0 0.5px 0 rgba(255, 255, 255, 0.06);

    /* Acentos dourados */
    --gold: #C9A84C;
    --gold-light: #D4B86A;
    --gold-muted: rgba(201, 168, 76, 0.15);
    --gold-glow: rgba(201, 168, 76, 0.25);

    /* Verde da marca (sutis) */
    --brand: #2B6B1A;
    --brand-light: #3D8B2A;
    --brand-muted: rgba(43, 107, 26, 0.12);

    /* Bordas e separadores */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-gold: rgba(201, 168, 76, 0.2);

    /* Texto */
    --text-white: #F5F5F5;
    --text-primary: #E0E0E0;
    --text-secondary: #8A8A8A;
    --text-muted: #5A5A5A;
    --text-gold: #C9A84C;

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 4px 20px rgba(201, 168, 76, 0.15);

    /* Raio e transicoes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 50px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.18s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Orbs de luz sutis no fundo (estilo Apple) */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
}

body::before {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -150px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.08), transparent 70%);
}

body::after {
    width: 500px;
    height: 500px;
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(47, 128, 194, 0.05), transparent 70%);
}

::selection {
    background: var(--gold-muted);
    color: var(--text-white);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ============================================
   Layout
   ============================================ */
.layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    min-width: 0;
}

.dashboard {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2.5rem;
    animation: pageIn 0.5s ease both;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar__logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.sidebar__logo-img {
    height: 44px;
    width: 44px;
    transition: var(--transition);
}

.sidebar__title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: 0.5px;
}

.sidebar__subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-top: 3px;
    font-weight: 500;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.75rem;
    flex: 1;
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: var(--font-body);
    text-align: left;
    width: 100%;
    letter-spacing: 0.2px;
    position: relative;
}

.sidebar__item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--gold);
    border-radius: 0 4px 4px 0;
    transition: var(--transition);
}

.sidebar__item:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar__item--active {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    font-weight: 500;
}

.sidebar__item--active::after {
    transform: translateY(-50%) scaleY(1);
}

.sidebar__item--ai {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.sidebar__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: var(--transition);
}

.sidebar__item:hover .sidebar__icon,
.sidebar__item--active .sidebar__icon {
    opacity: 0.9;
}

.sidebar__item--active .sidebar__icon {
    color: var(--gold);
}

.sidebar__badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #C9A84C;
    color: #0A0A0A;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar__footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
}

.sidebar__plan {
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    margin-bottom: 1rem;
}

.sidebar__plan--pro,
.sidebar__plan--elite {
    border-color: var(--gold-muted);
    background: rgba(201, 168, 76, 0.04);
}

.sidebar__plan-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.sidebar__plan-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.5rem;
}

.sidebar__plan--pro .sidebar__plan-name,
.sidebar__plan--elite .sidebar__plan-name {
    color: var(--gold);
}

.sidebar__plan-cta {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--gold);
    text-decoration: none;
    border: 1px solid var(--gold-muted);
    padding: 4px 10px;
    border-radius: 4px;
    transition: var(--transition-fast);
    letter-spacing: 0.2px;
}

.sidebar__plan-cta:hover {
    background: var(--gold);
    color: #0A0A0A;
    border-color: var(--gold);
}

.sidebar__user {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.2px;
}

.sidebar__logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.sidebar__logout:hover {
    color: #D48A8A;
}

.sidebar__status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.header__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px var(--gold-glow);
    animation: dotPulse 3s ease-in-out infinite;
}

.header__status-dot--offline {
    background: #8A3232;
    box-shadow: 0 0 6px rgba(138, 50, 50, 0.4);
    animation: none;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 150;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 42px;
    height: 42px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    border-color: var(--border-hover);
}

/* ============================================
   Stats Grid
   ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shine);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-muted), transparent);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.stat-card__value {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: -1px;
    line-height: 1;
}

.stat-card__detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    letter-spacing: 0.3px;
}

/* Highlight card (Total de Leads) */
.stat-card--highlight {
    grid-column: span 2;
    border-color: var(--border-gold);
}

.stat-card--highlight .stat-card__value {
    font-size: 3.2rem;
    color: var(--gold);
}

.stat-card--highlight::before {
    opacity: 1;
}

/* Trend indicators */
.stat-card__trend {
    font-size: 0.7rem;
    margin-top: 0.5rem;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.trend--up { color: #7EC868; }
.trend--down { color: #D48A8A; }
.trend--neutral { color: var(--text-muted); }

/* ============================================
   Section Title
   ============================================ */
.section-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-white);
    margin-bottom: 1.25rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title__icon { display: none; }

/* ============================================
   Leads Container
   ============================================ */
.leads-container {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shine);
}

.leads-toolbar {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.leads-toolbar__filters {
    display: flex;
    gap: 0.35rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
    letter-spacing: 0.3px;
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-btn--active,
.filter-btn--quente.filter-btn--active,
.filter-btn--morno.filter-btn--active,
.filter-btn--frio.filter-btn--active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg-dark);
    font-weight: 600;
}

.search-input {
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.82rem;
    width: 220px;
    outline: none;
    transition: var(--transition);
    font-family: var(--font-body);
}

.search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-muted);
}

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

/* ============================================
   Table
   ============================================ */
.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table th {
    text-align: left;
    padding: 0.75rem 1.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.leads-table td {
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.leads-table tbody tr {
    transition: var(--transition-fast);
}

.leads-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.leads-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.badge--quente,
.badge--morno,
.badge--frio {
    background: var(--gold-muted);
    color: var(--gold-light);
    border: 1px solid rgba(201, 168, 76, 0.12);
}

.badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
}

.badge--status-disponivel {
    background: rgba(43, 107, 26, 0.1);
    color: #7EC868;
    border: 1px solid rgba(43, 107, 26, 0.15);
}

.badge--status-reservado {
    background: var(--gold-muted);
    color: var(--gold-light);
    border: 1px solid rgba(201, 168, 76, 0.12);
}

.badge--status-vendido {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge--status-alugado {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge--visit-agendada {
    background: var(--gold-muted);
    color: var(--gold-light);
    border: 1px solid rgba(201, 168, 76, 0.12);
}

.badge--visit-confirmada {
    background: rgba(43, 107, 26, 0.1);
    color: #7EC868;
    border: 1px solid rgba(43, 107, 26, 0.15);
}

.badge--visit-realizada {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge--visit-cancelada {
    background: rgba(138, 50, 50, 0.1);
    color: #D48A8A;
    border: 1px solid rgba(138, 50, 50, 0.15);
}

.badge--visit-reagendada {
    background: var(--gold-muted);
    color: var(--gold-light);
    border: 1px solid rgba(201, 168, 76, 0.12);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay--open {
    display: flex;
    animation: overlayIn 0.3s ease both;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-elevated);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    max-width: 540px;
    width: 92%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), var(--glass-shine);
    padding: 2rem;
    animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-white);
}

.modal__close {
    background: transparent;
    border: 1px solid var(--border);
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}

.modal__close:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.modal__field {
    margin-bottom: 1.1rem;
}

.modal__label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.modal__value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ============================================
   Form Card
   ============================================ */
.form-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--glass-shine);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group--full {
    grid-column: 1 / -1;
}

/* Form hint */
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    letter-spacing: 0.2px;
}

/* Form sections */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 0.5px solid var(--border);
}

.form-section--last {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    letter-spacing: 0.2px;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    letter-spacing: 0.1px;
}

.form-input {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-muted);
}

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

.form-textarea {
    min-height: 90px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
    appearance: auto;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 0.7rem 1.75rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.btn--primary {
    background: var(--gold);
    color: var(--bg-dark);
}

.btn--primary:hover {
    background: var(--gold-light);
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn--text {
    background: none;
    color: var(--text-muted);
    padding: 0.7rem 1rem;
    border: none;
    text-transform: none;
    letter-spacing: 0.3px;
    font-weight: 500;
}

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

.btn--ghost-sm {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-body);
    margin-top: 1rem;
    text-transform: none;
    letter-spacing: 0.3px;
}

.btn--ghost-sm:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: var(--transition-fast);
    line-height: 1;
    color: var(--text-muted);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.btn-icon--danger:hover {
    color: #D48A8A;
    background: rgba(138, 50, 50, 0.08);
}

.btn-icon--success:hover {
    color: #7EC868;
    background: rgba(43, 107, 26, 0.08);
}

.td-acoes {
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

/* ============================================
   AI Panel
   ============================================ */
.ai-panel__result {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--glass-shine);
}

.ai-panel__result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: var(--gold-muted);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--gold);
    border-bottom: 1px solid var(--border-gold);
    letter-spacing: 0.5px;
}

.ai-panel__result-body {
    padding: 1.5rem;
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.sidebar__item--ai {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: var(--font-body);
    z-index: 300;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    letter-spacing: 0.3px;
}

.toast--show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast--sucesso {
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    color: #7EC868;
    border: 1px solid rgba(43, 107, 26, 0.2);
    box-shadow: var(--shadow-md);
}

.toast--erro {
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    color: #D48A8A;
    border: 1px solid rgba(138, 50, 50, 0.2);
    box-shadow: var(--shadow-md);
}

.toast--info {
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    color: var(--gold-light);
    border: 1px solid var(--border-gold);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Pipeline Section
   ============================================ */
.pipeline-section {
    margin-bottom: 2rem;
}

.pipeline-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.pipeline-header__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-white);
    letter-spacing: 0.3px;
}

.pipeline-header__ts {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* Pipeline grid */
.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Pipe card */
.pipe-card {
    background: rgba(22, 22, 22, 0.65);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--glass-shine);
}

.pipe-card:hover {
    border-color: rgba(255,255,255,0.14);
    background: rgba(26, 26, 26, 0.75);
}

.pipe-card__accent {
    height: 3px;
}

.pipe-card__accent--hot { background: #C0392B; }
.pipe-card__accent--warm { background: #C9A84C; }
.pipe-card__accent--cold { background: #2F80C2; }

.pipe-card__body {
    padding: 1.25rem 1.5rem 1.5rem;
}

/* Badge */
.pipe-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    margin-bottom: 1rem;
}

.pipe-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.pipe-badge--hot {
    background: rgba(192,57,43,0.13);
    color: #E87A7A;
}

.pipe-badge--hot .pipe-badge__dot { background: #C0392B; }

.pipe-badge--warm {
    background: rgba(201,168,76,0.12);
    color: #E8C97A;
}

.pipe-badge--warm .pipe-badge__dot { background: #C9A84C; }

.pipe-badge--cold {
    background: rgba(47,128,194,0.13);
    color: #7ABDE8;
}

.pipe-badge--cold .pipe-badge__dot { background: #2F80C2; }

/* Number */
.pipe-card__number {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 600;
    color: #F0EDE6;
    line-height: 1;
    letter-spacing: -1px;
}

.pipe-card__sublabel {
    font-size: 0.72rem;
    color: #5A5650;
    margin-top: 0.35rem;
    letter-spacing: 0.2px;
}

.pipe-card__divider {
    height: 0.5px;
    background: rgba(255,255,255,0.07);
    margin: 1rem 0;
}

/* Meta rows */
.pipe-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.75rem;
}

.pipe-card__meta span:first-child {
    color: #5A5650;
}

.pipe-card__meta span:last-child {
    color: #9A9488;
    font-weight: 500;
}

/* Skeleton loading */
.skeleton-text {
    color: transparent;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
    min-width: 24px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Distribution bar */
.pipe-distrib {
    background: rgba(22, 22, 22, 0.65);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--glass-shine);
}

.pipe-distrib__bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    gap: 2px;
    margin-bottom: 0.85rem;
}

.pipe-distrib__seg {
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 4px;
}

.pipe-distrib__seg--hot { background: #C0392B; }
.pipe-distrib__seg--warm { background: #C9A84C; }
.pipe-distrib__seg--cold { background: #2F80C2; }

.pipe-distrib__legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pipe-distrib__total {
    font-size: 0.75rem;
    color: #9A9488;
    font-weight: 500;
}

.pipe-distrib__labels {
    display: flex;
    gap: 1.25rem;
}

.pipe-distrib__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #5A5650;
}

.pipe-distrib__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.pipe-distrib__dot--hot { background: #C0392B; }
.pipe-distrib__dot--warm { background: #C9A84C; }
.pipe-distrib__dot--cold { background: #2F80C2; }

/* ============================================
   Viz Section (Chart)
   ============================================ */
.dash-viz--single {
    grid-template-columns: 1fr;
}

/* ============================================
   Viz Section (Chart + Funnel)
   ============================================ */
.dash-viz {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.viz-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--glass-shine);
}

.viz-card__title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

/* Bar chart */
.viz-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
}

.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.chart-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar {
    width: 100%;
    max-width: 32px;
    background: var(--gold);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-bar__val {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.chart-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: capitalize;
}

/* Funnel removido — substituido pelo Pipeline */

/* ============================================
   Table Row Temperature Tints
   ============================================ */
.tr--quente { background: rgba(138, 50, 50, 0.05); }
.tr--quente:hover { background: rgba(138, 50, 50, 0.09) !important; }
.tr--morno { background: rgba(138, 109, 10, 0.04); }
.tr--morno:hover { background: rgba(138, 109, 10, 0.08) !important; }
.tr--frio { background: rgba(45, 90, 122, 0.04); }
.tr--frio:hover { background: rgba(45, 90, 122, 0.08) !important; }

/* ============================================
   Engajamento (mini progress bar)
   ============================================ */
.engajamento {
    display: flex;
    align-items: center;
    gap: 8px;
}

.engajamento__bar {
    width: 48px;
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.engajamento__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.engajamento--baixo { background: var(--text-muted); }
.engajamento--medio { background: var(--gold); }
.engajamento--alto { background: #7EC868; }

.engajamento__num {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 14px;
}

/* ============================================
   Dado Vazio
   ============================================ */
.dado-vazio {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* ============================================
   Row Actions (reveal on hover)
   ============================================ */
.td-acoes--row .btn-icon {
    opacity: 0.25;
    transition: opacity 0.2s ease, color 0.2s ease;
}

tr:hover .td-acoes--row .btn-icon {
    opacity: 0.7;
}

tr:hover .td-acoes--row .btn-icon:hover {
    opacity: 1;
}

/* ============================================
   Demo Badge (sidebar)
   ============================================ */
.header__status-dot--demo {
    background: var(--text-muted);
    box-shadow: none;
    animation: none;
}

/* ============================================
   Detalhes Grid (Valor wider)
   ============================================ */
.form-grid--detalhes {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ============================================
   Upload Area
   ============================================ */
.upload-area {
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-md);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover,
.upload-area--hover {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.03);
}

.upload-area__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.upload-area__content svg {
    opacity: 0.3;
    margin-bottom: 0.25rem;
}

.upload-area__text {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.upload-area__hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.upload-area__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.upload-area__preview img {
    max-height: 160px;
    max-width: 100%;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.upload-area__remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    line-height: 1;
}

.upload-area__remove:hover {
    background: rgba(138, 50, 50, 0.15);
    border-color: rgba(138, 50, 50, 0.3);
    color: #D48A8A;
}

/* ============================================
   Form Validation
   ============================================ */
.form-error {
    display: block;
    font-size: 0.72rem;
    color: #D48A8A;
    margin-top: 0.3rem;
    min-height: 0;
    letter-spacing: 0.2px;
}

.form-input--error {
    border-color: rgba(138, 50, 50, 0.5) !important;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    opacity: 0.2;
    letter-spacing: 4px;
    color: var(--text-muted);
}

.empty-state__svg {
    opacity: 0.15;
    margin-bottom: 1rem;
}

.empty-state__text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.empty-state__sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    letter-spacing: 0.2px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar--open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0,0,0,0.5);
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content { margin-left: 0; }
    .dashboard { padding: 1.25rem; padding-top: 5rem; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
    .stat-card { padding: 1.1rem; }
    .stat-card--highlight { grid-column: span 2; }
    .stat-card--highlight .stat-card__value { font-size: 2rem; }
    .stat-card__value { font-size: 1.6rem; }
    .pipeline-grid { grid-template-columns: 1fr; }
    .pipe-distrib__legend { flex-direction: column; gap: 0.5rem; }
    .pipe-distrib__labels { gap: 0.75rem; }
    .dash-viz { grid-template-columns: 1fr; }
    .leads-toolbar { flex-direction: column; align-items: stretch; }
    .search-input { width: 100%; }
    .form-card { padding: 1.25rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid--detalhes { grid-template-columns: 1fr 1fr; }
    .form-actions { flex-direction: column; }
    .btn { width: 100%; text-align: center; }
    .td-acoes { flex-wrap: wrap; }
    .leads-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .stat-card--highlight { grid-column: span 1; }
}
