/* ZapPro - Estilos SaaS */

:root {
    --sidebar-width: 260px;
    --primary: #25D366;
    --primary-dark: #128C7E;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #2d3139;
    --topbar-height: 60px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f4f6f9;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

/* Topbar */
.topbar {
    min-height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1d23;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-menu {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    color: #1a1d23;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.btn-menu:hover,
.btn-menu:focus {
    background: #eef1f4;
    color: #1a1d23;
}

.plan-badge {
    background: rgba(37, 211, 102, 0.15);
    color: var(--primary-dark);
    font-weight: 600;
}

.content-area {
    padding: 1.5rem;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-close {
    margin-left: auto;
    color: rgba(255,255,255,0.75) !important;
    font-size: 1.1rem;
    padding: 0.25rem;
    text-decoration: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 25, 0.55);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-hover);
    border-left: 3px solid var(--primary);
}

.sidebar-divider {
    border-color: rgba(255,255,255,0.1);
    margin: 0.5rem 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Auth Pages */
.auth-wrapper {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-card .card-header {
    background: transparent;
    border: none;
    text-align: center;
    padding-top: 2rem;
}

.auth-logo {
    font-size: 2.5rem;
    color: var(--primary);
}

/* QR Code */
.qr-container {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.qr-container img {
    max-width: 256px;
    border-radius: 8px;
}

/* Status badges */
.status-conectado { color: #198754; }
.status-desconectado { color: #dc3545; }
.status-aguardando_qr { color: #ffc107; }

/* Tables */
.table-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* Plan cards */
.plan-card {
    border: 2px solid #e9ecef;
    border-radius: 16px;
    transition: all 0.3s;
    height: 100%;
}

.plan-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(37,211,102,0.15);
}

.plan-card.featured {
    border-color: var(--primary);
    position: relative;
}

.plan-card .plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: min(86vw, 300px);
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .app-body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
    .content-area {
        padding: 1rem;
    }
    .topbar {
        padding: 0.55rem 0.85rem;
        padding-top: max(0.55rem, env(safe-area-inset-top));
    }
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
    .whatsapp-float {
        right: 1rem;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        padding: 0.9rem;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        justify-content: center;
    }
    .landing-hero {
        padding: 2.25rem 0 2.75rem;
    }
    .landing-section,
    .landing-cta {
        padding: 2.5rem 0;
    }
    .landing-title {
        font-size: 1.7rem;
    }
    .landing-lead {
        font-size: 1rem;
    }
    .landing-hero .btn-lg {
        width: 100%;
    }
    .auth-wrapper {
        padding: 1.25rem 0.85rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    .qr-container {
        padding: 1.25rem;
    }
    .qr-container img {
        max-width: min(240px, 70vw);
        width: 100%;
        height: auto;
    }
}

/* Bottom navigation (mobile app feel) */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #fff;
    border-top: 1px solid #e6eaef;
    box-shadow: 0 -6px 24px rgba(16, 24, 40, 0.08);
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}

.mbnav-item {
    appearance: none;
    border: 0;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 56px;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 12px;
    padding: 0.25rem 0.15rem;
    -webkit-tap-highlight-color: transparent;
}

.mbnav-item i {
    font-size: 1.25rem;
    line-height: 1;
}

.mbnav-item.active,
.mbnav-item:hover {
    color: var(--primary-dark);
}

.mbnav-item.active {
    background: rgba(37, 211, 102, 0.12);
}

/* Page headers / mobile lists */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-item-card {
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.mobile-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    background: #eef8f1;
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.mobile-item-text {
    color: #495057;
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    line-height: 1.45;
}

.mobile-item-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.empty-state i {
    font-size: 2rem;
    color: var(--primary);
    display: block;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Touch-friendly buttons on small screens */
@media (max-width: 575.98px) {
    .btn {
        min-height: 44px;
    }
    .btn-sm {
        min-height: 38px;
    }
    .stat-card .card-body {
        padding: 1rem;
    }
    .onboarding-card .card-body {
        padding: 1.1rem !important;
    }
}

/* Public nav mobile polish */
@media (max-width: 991.98px) {
    .public-nav .navbar-collapse {
        background: #fff;
        border: 1px solid #e9ecef;
        border-radius: 14px;
        margin-top: 0.75rem;
        padding: 0.75rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }
    .public-nav .nav-link {
        padding: 0.75rem 0.5rem;
        border-radius: 10px;
    }
}

/* Buttons */
.btn-whatsapp {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-whatsapp:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

/* Public nav */
.public-nav {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.public-nav .navbar-brand {
    font-weight: 700;
    color: var(--primary-dark);
}

.public-nav .navbar-brand i {
    color: var(--primary);
}

.public-nav .nav-link {
    color: #495057;
    font-weight: 500;
}

.public-nav .nav-link:hover {
    color: var(--primary-dark);
}

.guest-main {
    min-height: calc(100vh - 72px);
}

/* Floating WhatsApp support */
.whatsapp-float {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #fff !important;
    text-decoration: none;
    padding: 0.85rem 1.1rem;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(18, 140, 126, 0.35);
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
}

.whatsapp-float i {
    font-size: 1.4rem;
}

.whatsapp-float:hover {
    background: var(--primary-dark);
    color: #fff !important;
    transform: translateY(-2px);
}

.nav-link-support {
    color: var(--primary) !important;
}

/* Landing */
.landing-hero {
    background: linear-gradient(145deg, #0f3d34 0%, #128C7E 45%, #25D366 100%);
    color: #fff;
    padding: 4.5rem 0 5rem;
}

.landing-eyebrow {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.landing-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.landing-hero .btn-outline-light {
    border-width: 2px;
}

@media (max-width: 991.98px) {
    .landing-cta-buttons {
        flex-direction: column;
    }
}

/* Quick actions bigger thumbs */
.app-body .btn-whatsapp,
.app-body .card .btn {
    border-radius: 12px;
}

.landing-lead {
    font-size: 1.1rem;
    opacity: 0.92;
    max-width: 34rem;
}

.landing-note {
    font-size: 0.9rem;
    opacity: 0.8;
}

.landing-visual {
    display: flex;
    justify-content: center;
}

.landing-chat {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-bubble.in {
    background: #fff;
    color: #212529;
    border-bottom-left-radius: 4px;
}

.chat-bubble.out {
    background: #dcf8c6;
    color: #212529;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-meta {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.5rem;
}

.landing-section {
    padding: 4rem 0;
    background: #fff;
}

.landing-section-alt {
    background: #f4f6f9;
}

.landing-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1d23;
}

.landing-step,
.landing-benefit {
    height: 100%;
    padding: 1.5rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e9ecef;
}

.landing-section-alt .landing-benefit {
    background: #fff;
}

.landing-step-num {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
}

.landing-step h3,
.landing-benefit h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.landing-step p,
.landing-benefit p {
    color: #6c757d;
    margin-bottom: 0;
}

.landing-benefit i {
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    display: block;
}

.landing-cta {
    background: linear-gradient(135deg, var(--primary-dark), #0f3d34);
    padding: 4rem 0;
}

.landing-cta-text {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.landing-footer {
    background: #1a1d23;
    color: rgba(255, 255, 255, 0.7);
    padding: 1.25rem 0;
    font-size: 0.9rem;
}

.landing-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.landing-footer a:hover {
    color: #fff;
}

/* Onboarding */
.onboarding-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--primary);
}

.onboarding-step {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
}

.onboarding-step.done {
    background: #e8f8ef;
}

/* Ajuda */
.ajuda-accordion .accordion-item {
    border: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
    border-radius: 12px !important;
    overflow: hidden;
}

.ajuda-accordion .accordion-button:not(.collapsed) {
    background: #e8f8ef;
    color: var(--primary-dark);
    box-shadow: none;
}

.ajuda-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

