:root {
    --bg: #0f1217;
    --text: #ffffff;
    --text-secondary: #a1a1aa;
    --primary: #ff6a00;
    --primary-glow: rgba(255, 106, 0, 0.4);
    --primary-gradient: linear-gradient(135deg, #ff6a00, #ff4d00);
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.1);
    --glass: blur(12px) saturate(180%);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

p {
    margin: 0;
    color: var(--text-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

.section {
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(15, 18, 23, 0.7);
    backdrop-filter: var(--glass);
    border-bottom: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.header-wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 80px;
    gap: 24px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--primary);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    white-space: nowrap;
}

.nav a:not(.btn) {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav a:not(.btn):hover {
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.menu-toggle .burger { display: block; position: relative; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform .25s ease, background .25s ease; }
.menu-toggle .burger::before, .menu-toggle .burger::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.menu-toggle .burger::before { top: -7px; }
.menu-toggle .burger::after { top: 7px; }
.menu-toggle.open .burger { background: transparent; }
.menu-toggle.open .burger::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open .burger::after { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10,12,16,0.95);
    backdrop-filter: blur(8px);
    z-index: 60;
    padding: 24px 0;
}

.mobile-menu.open { display: block; }

.mobile-menu .container { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.mobile-menu-links { display: grid; gap: 14px; text-align: center; }
.mobile-menu-links a { color: #fff; font-size: 18px; }
.mobile-menu-links a:hover { color: var(--primary); }
.mobile-menu-actions { display: flex; justify-content: center; gap: 12px; }
.mobile-menu.open { animation: mmfade .2s ease forwards; }
@keyframes mmfade { from { opacity: 0; } to { opacity: 1; } }
.menu-open { overflow: hidden; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 32px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-compact {
    height: 40px;
    padding: 0 18px;
    font-size: 14px;
    border-radius: 999px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: #fff;
}

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-link {
    color: var(--text-secondary);
    padding: 0;
    height: auto;
}

.btn-link:hover {
    color: #fff;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 140px;
    background-image: linear-gradient(to bottom, rgba(15, 18, 23, 0.8), #0f1217), url('36861.jpg');
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
    justify-items: center;
    text-align: center;
}

.hero-text h1 {
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    font-size: 20px;
    margin-bottom: 28px;
    max-width: 720px;
    line-height: 1.7;
    margin-left: auto;
    margin-right: auto;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
}

.badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.badge {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.kpi {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.desc {
    font-size: 14px;
}

/* Stats Section */
.section.orange {
    background: radial-gradient(circle at top right, rgba(255, 106, 0, 0.1), transparent 40%);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.stat {
    text-align: center;
    padding: 40px 32px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    border: 1px solid var(--border);
}

.stat-kpi {
    font-size: 56px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(255, 106, 0, 0.3);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.step {
    padding: 40px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 32px;
    position: relative;
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.step-n {
    font-size: 56px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
    position: absolute;
    top: 24px;
    right: 32px;
}

.step h4 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--primary);
}

/* Products */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 32px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
}

.card-media {
    height: 240px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-media::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, #0f1217, transparent);
}

.card-body {
    padding: 32px;
}

.card h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.chip {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(255, 106, 0, 0.1);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 106, 0, 0.2);
}

/* Features/Trust */
.trust,
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.trust-item,
.feature {
    padding: 40px;
    background: var(--surface);
    border-radius: 32px;
    border: 1px solid var(--border);
    text-align: center;
}

.icon {
    font-size: 40px;
    margin-bottom: 24px;
    display: block;
}

/* Testimonials */
.testimonials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.testimonial {
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: 32px;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 2px solid var(--primary);
    background-size: cover;
    background-position: center;
}

/* FAQ */
.faq {
    display: grid;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.faq-q {
    padding: 32px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.faq-q::after {
    content: '+';
    font-size: 24px;
    color: var(--primary);
}

.faq-item.open .faq-q::after {
    content: '-';
}

.faq-a {
    padding: 0 32px 32px;
    color: var(--text-secondary);
    display: none;
    line-height: 1.7;
}

.faq-item.open .faq-a {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact Form */
.contact-bg {
    background-image: linear-gradient(rgba(15, 18, 23, 0.55), rgba(15, 18, 23, 0.55)), url('15314.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Contact section heading */
#contato h2 { text-align: center; font-size: 44px; line-height: 1.2; margin-bottom: 24px; }

.form {
    background: rgba(15, 18, 23, 0.8);
    backdrop-filter: blur(20px);
    padding: 56px;
    border-radius: 40px;
    border: 1px solid var(--border);
    max-width: 680px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.form-row {
    margin-bottom: 24px;
}

.form-row label {
    display: block;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-row input,
.form-row select {
    width: 100%;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0 24px;
    color: #fff;
    font-size: 16px;
    transition: all 0.2s;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.1);
}

.form-actions { display: flex; justify-content: center; }
.form-actions .btn { width: 100%; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 80px 0;
    background: #0a0c10;
}

.footer-wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: nowrap; white-space: nowrap; }
.footer-links { display: inline-flex; align-items: center; gap: 20px; flex-wrap: nowrap; }
.footer-links a { margin-left: 0; white-space: nowrap; }
.site-footer .container { overflow-x: auto; }

.sticky-bar { background: rgba(255,255,255,0.03); border-top: 1px solid var(--border); padding: 16px 0; }
.sticky-wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; white-space: nowrap; min-height: 64px; }
.sticky-text { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.sticky-bar .container { overflow-x: auto; }

/* Floating WhatsApp Button */
.floating-wa { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--primary-gradient); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(0,0,0,0.4); z-index: 120; }
.floating-wa:hover { transform: translateY(-2px); box-shadow: 0 16px 24px rgba(0,0,0,0.5); }
.floating-wa svg { display: block; }

/* CRM Specific */
.crm {
    padding: 64px 0;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: var(--surface);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.pill {
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.pill:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Table Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

select.status-badge {
    /* Revert to standard appearance for reliability */
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    
    padding: 4px 24px 4px 12px; /* Standard padding */
    cursor: pointer;
    height: auto;
    line-height: normal;
    border: 1px solid transparent;
    background-image: none; /* Remove custom arrow */
    
    /* Ensure it sits on top */
    position: relative;
    z-index: 10;
}

.status-novo { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.status-contactado { background: rgba(234, 179, 8, 0.2); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.status-fechado { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.status-perdido { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Improved Table */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
}

.table th {
    text-align: left;
    padding: 16px 20px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: #e2e8f0;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, 0.03); }

/* Column adjustments */
.table td.col-actions { text-align: right; }
.table td.col-status { text-align: center; }

/* Truncate long text */
.truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scrollbar for table */
.table-container::-webkit-scrollbar { height: 8px; }
.table-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }
.table-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.table-container::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Remove old fixed widths if they conflict, or keep as min-width */
.table th, .table td { min-width: auto; }


/* Popup */
.popup-overlay { position: fixed; inset: 0; background: rgba(10,12,16,0.6); backdrop-filter: blur(8px); z-index: 200; display: none; align-items: center; justify-content: center; }
.popup-overlay.show { display: flex; animation: mmfade .2s ease forwards; }
.popup-card { background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 24px; padding: 24px; max-width: 440px; width: calc(100% - 48px); box-shadow: var(--shadow-lg); }
.popup-message { font-size: 16px; color: #fff; }
.popup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Responsive */
@media (max-width: 1024px) {

    .hero-grid,
    .badges,
    .stats,
    .steps,
    .cards,
    .trust,
    .features,
    .testimonials {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .hero-grid,
    .badges,
    .stats,
    .steps,
    .cards,
    .trust,
    .features,
    .testimonials {
        grid-template-columns: 1fr;
    }

    .footer-wrap { flex-direction: row; text-align: left; }
    .footer-links { justify-content: flex-end; }
    .sticky-bar { padding: 12px 0; }
    .sticky-wrap { justify-content: space-between; gap: 12px; min-height: 56px; }
    .sticky-text { white-space: nowrap; }
    .hero-text h1 { font-size: 40px; }
    .header-wrap { display: flex; justify-content: center; align-items: center; height: 72px; padding: 0 16px; gap: 12px; }
    .logo { font-size: 22px; }
    .nav { display: none; }
    .header-actions { display: none; }
    .menu-toggle { display: inline-flex; }
    .hero { background-position: center 15%; }
}
