/* ==========================================================================
   zap4me — tema sobre Bootstrap 5 (identidade ssOtica)
   Azul #0E9AEF · Roxo #7509AF · Montserrat (display) + Open Sans (texto)
   ========================================================================== */

:root {
    --z-blue: #0E9AEF;
    --z-blue-600: #0b86d1;
    --z-blue-050: #e8f6fe;
    --z-purple: #7509AF;
    --z-purple-050: #f3e9fb;
    --z-grad: linear-gradient(135deg, #0E9AEF 0%, #7509AF 100%);
    --z-ink: #1b2333;
    --z-muted: #6b7689;
    --z-line: #e9edf3;
    --z-bg: #f4f6fb;
    --z-sidebar-w: 248px;

    --bs-body-font-family: 'Open Sans', system-ui, sans-serif;
    --bs-body-color: var(--z-ink);
    --bs-primary: var(--z-blue);
    --bs-primary-rgb: 14, 154, 239;
    --bs-border-color: var(--z-line);
    --bs-body-bg: var(--z-bg);
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--bs-body-font-family);
    background: var(--z-bg);
    color: var(--z-ink);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.display-font, .navbar-brand {
    font-family: 'Montserrat', system-ui, sans-serif;
    letter-spacing: -0.01em;
}

/* ---------- Layout shell ---------- */
.z-shell { display: flex; min-height: 100vh; }

.z-sidebar {
    width: var(--z-sidebar-w);
    flex: 0 0 var(--z-sidebar-w);
    background: #0d1422;
    color: #c3cad8;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.z-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.15rem 1.25rem;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
}
.z-brand .z-logo {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--z-grad);
    display: grid; place-items: center;
    color: #fff; font-size: 1rem; font-weight: 800;
    box-shadow: 0 4px 14px rgba(117, 9, 175, .45);
}
.z-brand small { color: var(--z-blue); font-weight: 700; }

.z-nav { padding: .5rem .6rem; flex: 1; }
.z-nav-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
    color: #5b6680; padding: 1rem .8rem .35rem; font-weight: 700;
}
.z-nav a {
    display: flex; align-items: center; gap: .75rem;
    padding: .62rem .8rem; margin-bottom: 2px;
    border-radius: 10px;
    color: #c3cad8; text-decoration: none;
    font-size: .92rem; font-weight: 600;
    transition: background .15s, color .15s;
}
.z-nav a i { font-size: 1.1rem; width: 20px; text-align: center; }
.z-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.z-nav a.active {
    background: var(--z-grad);
    color: #fff;
    box-shadow: 0 6px 16px rgba(14, 154, 239, .35);
}
.z-nav a .badge { margin-left: auto; }

.z-sidebar-user {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .9rem 1rem; display: flex; align-items: center; gap: .65rem;
}
.z-sidebar-user .z-avatar { width: 38px; height: 38px; font-size: .85rem; }
.z-sidebar-user .nm { color: #fff; font-weight: 700; font-size: .85rem; line-height: 1.1; }
.z-sidebar-user .rl { color: #6f7a92; font-size: .72rem; }

.z-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Topbar ---------- */
.z-topbar {
    background: #fff;
    border-bottom: 1px solid var(--z-line);
    padding: .85rem 1.6rem;
    display: flex; align-items: center; gap: 1rem;
    position: sticky; top: 0; z-index: 20;
}
.z-topbar h1 { font-size: 1.25rem; font-weight: 800; margin: 0; }
.z-topbar .z-sub { color: var(--z-muted); font-size: .82rem; }
.z-search {
    margin-left: auto; max-width: 320px; flex: 1;
    position: relative;
}
.z-search input {
    border-radius: 999px; border: 1px solid var(--z-line);
    padding-left: 2.4rem; background: var(--z-bg);
}
.z-search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--z-muted); }

.z-content { padding: 1.6rem; }

/* ---------- Avatares ---------- */
.z-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: .9rem;
    font-family: 'Montserrat', sans-serif;
    flex-shrink: 0;
}

/* ---------- Cards ---------- */
.z-card {
    background: #fff; border: 1px solid var(--z-line);
    border-radius: 16px; padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(27,35,51,.04);
}
.z-card-title { font-weight: 800; font-size: 1rem; margin-bottom: 1rem; }

/* ---------- Stat cards ---------- */
.z-stat { position: relative; overflow: hidden; }
.z-stat .ic {
    width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.3rem; margin-bottom: .85rem;
}
.z-stat .val { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.85rem; line-height: 1; }
.z-stat .lbl { color: var(--z-muted); font-size: .85rem; margin-top: .35rem; }
.z-stat .trend { font-size: .78rem; font-weight: 700; }
.bg-soft-blue { background: var(--z-blue-050); color: var(--z-blue); }
.bg-soft-purple { background: var(--z-purple-050); color: var(--z-purple); }
.bg-soft-green { background: #e7f6ed; color: #16a34a; }
.bg-soft-amber { background: #fdf3e2; color: #d97706; }
.bg-soft-red { background: #fdeaea; color: #dc2626; }

.text-purple { color: var(--z-purple) !important; }
.bg-grad { background: var(--z-grad) !important; color: #fff; }

/* ---------- Pills / badges ---------- */
.z-pill {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .6rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700;
}
.z-tag {
    display: inline-block; padding: .12rem .55rem; border-radius: 6px;
    font-size: .7rem; font-weight: 700; color: #fff;
}

/* ---------- Inbox 3 colunas ---------- */
.z-inbox {
    display: grid;
    grid-template-columns: 340px 1fr 300px;
    height: calc(100vh - 64px);
    background: #fff;
}
.z-inbox-col { border-right: 1px solid var(--z-line); display: flex; flex-direction: column; min-height: 0; }
.z-inbox-col:last-child { border-right: 0; }
.z-inbox-head { padding: 1rem; border-bottom: 1px solid var(--z-line); }

.z-conv-list { overflow-y: auto; flex: 1; }
.z-conv {
    display: flex; gap: .7rem; padding: .85rem 1rem;
    border-bottom: 1px solid var(--z-line); cursor: pointer; text-decoration: none; color: inherit;
    transition: background .12s;
}
.z-conv:hover { background: var(--z-bg); }
.z-conv.active { background: var(--z-blue-050); box-shadow: inset 3px 0 0 var(--z-blue); }
.z-conv .meta { min-width: 0; flex: 1; }
.z-conv .nm { font-weight: 700; font-size: .9rem; display: flex; justify-content: space-between; gap: .4rem; }
.z-conv .nm .tm { color: var(--z-muted); font-size: .72rem; font-weight: 600; white-space: nowrap; }
.z-conv .pv { color: var(--z-muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-conv .ch { font-size: .72rem; color: var(--z-muted); margin-top: .15rem; }

/* thread */
.z-thread { flex: 1; overflow-y: auto; padding: 1.25rem; background: #f7f9fc; }
.z-bubble {
    max-width: 70%; padding: .6rem .85rem; border-radius: 14px;
    margin-bottom: .7rem; font-size: .9rem; line-height: 1.35;
    box-shadow: 0 1px 1px rgba(0,0,0,.05);
}
.z-bubble .t { display: block; font-size: .68rem; color: var(--z-muted); margin-top: .25rem; text-align: right; }
.z-in { background: #fff; border: 1px solid var(--z-line); border-bottom-left-radius: 4px; }
.z-out { background: var(--z-blue-050); margin-left: auto; border-bottom-right-radius: 4px; }
.z-note { background: #fff7e6; border: 1px dashed #f0c46b; max-width: 80%; margin: 0 auto .7rem; font-style: italic; }
.z-composer { border-top: 1px solid var(--z-line); padding: .85rem 1rem; background: #fff; }
.z-window-warn {
    background: #fdf3e2; color: #92560a; border: 1px solid #f3d39a;
    border-radius: 10px; padding: .55rem .8rem; font-size: .8rem; margin-bottom: .6rem;
}

/* ---------- Funil kanban ---------- */
.z-kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.z-kcol { flex: 0 0 290px; background: #fff; border: 1px solid var(--z-line); border-radius: 14px; }
.z-kcol-head {
    padding: .8rem 1rem; border-bottom: 1px solid var(--z-line);
    display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: .9rem;
    border-radius: 14px 14px 0 0;
}
.z-kcol-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.z-kcol-head .cnt { margin-left: auto; color: var(--z-muted); font-weight: 700; font-size: .8rem; }
.z-kcol-body { padding: .75rem; display: flex; flex-direction: column; gap: .65rem; min-height: 80px; }
.z-deal {
    background: #fff; border: 1px solid var(--z-line); border-left: 3px solid var(--z-blue);
    border-radius: 10px; padding: .7rem .8rem; box-shadow: 0 1px 2px rgba(27,35,51,.05);
}
.z-deal .ti { font-weight: 700; font-size: .85rem; }
.z-deal .vl { font-family: 'Montserrat', sans-serif; font-weight: 800; color: #16a34a; font-size: .9rem; }
.z-deal .ct { color: var(--z-muted); font-size: .78rem; }

/* ---------- Tables ---------- */
.z-table { width: 100%; }
.z-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--z-muted); font-weight: 700; padding: .7rem 1rem; border-bottom: 1px solid var(--z-line); }
.z-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--z-line); font-size: .9rem; vertical-align: middle; }
.z-table tr:hover td { background: var(--z-bg); }

/* ---------- Timeline ---------- */
.z-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.z-timeline::before { content: ''; position: absolute; left: 13px; top: 4px; bottom: 4px; width: 2px; background: var(--z-line); }
.z-timeline li { position: relative; padding: 0 0 1.1rem 2.4rem; }
.z-timeline .dot {
    position: absolute; left: 4px; top: 2px; width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center; font-size: .65rem; color: #fff; z-index: 1;
}
.z-timeline .tx { font-size: .88rem; }
.z-timeline .tm { font-size: .74rem; color: var(--z-muted); }

/* utilities */
.z-scroll { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
a.z-plain { color: inherit; text-decoration: none; }
a.z-plain:hover { color: var(--z-blue); }

@media (max-width: 992px) {
    .z-sidebar { display: none; }
    .z-inbox { grid-template-columns: 1fr; }
    .z-inbox-col:nth-child(3) { display: none; }
}
