﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #e2e8f0;
}

body {
    background: radial-gradient(circle at top, #16213e, #0b1026);
    line-height: 1.6;
    min-height: 100vh;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth {
    width: min(420px, 100%);
}

.auth__card {
    background: linear-gradient(160deg, rgba(31, 41, 55, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(124, 204, 63, 0.45);
    border-radius: 12px;
    box-shadow: 0 40px 80px -60px rgba(124, 204, 63, 0.4);
    overflow: hidden;
}

.auth__header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth__logo-wrap {
    align-self: center;
    display: inline-flex;
    max-width: 100%;
}

.auth__logo {
    height: 38px;
    width: auto;
    max-width: 100%;
    align-self: center;
}

.auth__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 2rem 2rem;
}

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

.form-label {
    font-size: 0.95rem;
    font-weight: 500;
}

.form-input {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 0.98rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: rgba(124, 204, 63, 0.9);
    box-shadow: 0 0 0 4px rgba(124, 204, 63, 0.12);
}

.form-error {
    color: #f87171;
    font-size: 0.85rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    padding: 0.7rem 1.4rem;
    font-size: 0.95rem;
    background: linear-gradient(90deg, #5EA82C, #7CCC3F);
    color: #0b1026;
    cursor: pointer;
    text-decoration: none;
}

.btn--block {
    width: 100%;
}

.btn--ghost {
    background: transparent;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.6);
}

.btn--sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
}

.alert {
    margin: 1rem 2rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.8);
}

.alert--success {
    border-color: rgba(74, 222, 128, 0.8);
}

.alert--error {
    border-color: rgba(248, 113, 113, 0.9);
}

.header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
    border-bottom: 1px solid rgba(124, 204, 63, 0.35);
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.8rem 2rem;
}

.header__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    cursor: pointer;
}

.menu-toggle:hover {
    border-color: rgba(124, 204, 63, 0.8);
    color: #7CCC3F;
}

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

.header__logo {
    display: inline-flex;
    flex: 0 0 auto;
}

.header__logo img {
    height: 32px;
    width: auto;
    max-width: 100%;
}

.header__title {
    min-width: 0;
}

.header__title h1,
.header__title span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header__title h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.header__title span {
    font-size: 0.88rem;
    color: #cbd5f5;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.header__user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: radial-gradient(circle, #7CCC3F, #5EA82C);
    color: #0b1026;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.sidebar__brand {
    display: none;
}

.sidebar__logo {
    display: inline-flex;
    padding: 0.8rem 1.4rem 0.2rem;
}

.sidebar__logo img {
    height: 32px;
    width: auto;
    max-width: 100%;
}

.sidebar__search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.4rem 0.4rem;
}

.sidebar__search .form-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
}

.sidebar__filters {
    margin: 0.5rem 0 0.2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.sidebar__filters > summary {
    cursor: pointer;
    padding: 0.7rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5f5;
}

.sidebar__filters > form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0 1.4rem 1rem;
}

.sidebar__filters .form-label {
    font-size: 0.8rem;
}

.sidebar__filters .form-input,
.sidebar__filters .form-select {
    padding: 0.45rem 0.6rem;
    font-size: 0.88rem;
}

.sidebar__filters-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.sidebar-backdrop {
    display: none;
}

.sidebar {
    position: fixed;
    top: 84px;
    left: 0;
    bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.4);
    overflow-y: auto;
}

.sidebar__menu {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 1rem 0;
    gap: 0.4rem;
}

.sidebar__link {
    display: block;
    padding: 0.6rem 1.8rem;
    text-decoration: none;
    color: #cbd5f5;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar__link:hover {
    background: rgba(124, 204, 63, 0.12);
    color: #7CCC3F;
}

.main {
    margin-left: 260px;
    padding: 2rem;
    min-height: calc(100vh - 140px);
}

.container {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 600;
}

.page-actions {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.order-toggle {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
}

.page-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
}

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

.stat-card {
    background: linear-gradient(160deg, rgba(31, 41, 55, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 30px 60px -50px rgba(15, 23, 42, 0.9);
}

.stat-card strong {
    font-size: 2rem;
    font-weight: 700;
}

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

.card {
    background: linear-gradient(160deg, rgba(31, 41, 55, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.card__body {
    padding: 1rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.list__item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.text-muted {
    color: #94a3b8;
    font-size: 0.9rem;
}

.empty-state {
    color: #94a3b8;
    font-size: 0.95rem;
}

.footer {
    margin-left: 260px;
    padding: 1.2rem 2rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.link {
    color: #7CCC3F;
    text-decoration: none;
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: inline-flex;
    }

    .header__content {
        gap: 1rem;
        padding: 0.7rem 1.25rem;
    }

    .header__title span {
        display: none;
    }

    .header__title h1 {
        font-size: 1rem;
    }

    .sidebar {
        position: fixed;
        z-index: 60;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 86vw;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
    }

    .sidebar.is-open {
        transform: none;
    }

    .sidebar__brand {
        display: block;
    }

    .sidebar-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(2, 6, 23, 0.65);
    }

    body.menu-open {
        overflow: hidden;
    }

    .main,
    .footer {
        margin-left: 0;
    }
}

.btn--primary {
    background: linear-gradient(90deg, #5EA82C, #7CCC3F);
    color: #0b1026;
    border-color: transparent;
}

.card > h3 {
    padding: 1rem 1.4rem 0;
    font-size: 1.05rem;
}

.card > p,
.card > .list {
    padding: 0.8rem 1.4rem;
}

.card > form {
    padding: 1rem 1.4rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.card > table.table {
    padding: 0;
}

.card > .btn {
    margin: 0.4rem 1.4rem 1.4rem;
    align-self: flex-start;
}

.card > div {
    padding: 0 1.4rem 1rem;
}

.card > div:first-of-type {
    padding-top: 0.8rem;
}

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

.form-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 0.98rem;
    color: #e2e8f0;
}

.form-select:focus {
    outline: none;
    border-color: rgba(124, 204, 63, 0.9);
    box-shadow: 0 0 0 4px rgba(124, 204, 63, 0.12);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th,
.table td {
    text-align: left;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    vertical-align: top;
}

.table th {
    font-weight: 600;
    color: #cbd5f5;
    background: rgba(15, 23, 42, 0.5);
}

.table a {
    color: #7CCC3F;
    text-decoration: none;
}

.table tr:hover td {
    background: rgba(124, 204, 63, 0.05);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    align-items: start;
}

.contact-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
    margin-top: 0.7rem;
}

.contact-strip__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 999px;
    padding: 0.3rem 0.35rem 0.3rem 0.8rem;
    font-size: 0.85rem;
    max-width: 100%;
}

.contact-strip__label {
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.contact-strip__value {
    color: #e2e8f0;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover {
    background: rgba(124, 204, 63, 0.18);
    border-color: rgba(124, 204, 63, 0.8);
    color: #7CCC3F;
}

.copy-btn__icon--ok {
    display: none;
}

.copy-btn.is-copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.8);
    color: #4ade80;
}

.copy-btn.is-copied .copy-btn__icon--copy {
    display: none;
}

.copy-btn.is-copied .copy-btn__icon--ok {
    display: inline-block;
}

.lead-phone {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 0;
}

.lead-phone__value {
    word-break: break-word;
}

.status-quick {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.status-text {
    display: none;
}

.status-quick__select {
    min-width: 0;
    max-width: 200px;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.status-quick__btn {
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

.table--leads .lead-cell--actions .btn {
    background: linear-gradient(90deg, #5EA82C, #7CCC3F);
    border-color: #7CCC3F;
    color: #ffffff;
}

/* Lista de leads em cards (vale no celular e no computador) */
.table--leads thead {
    display: none;
}

.table--leads,
.table--leads tbody {
    display: block;
    width: 100%;
}

.table--leads tbody {
    padding: 0.2rem 0;
}

.table--leads tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 0.15rem;
    margin: 0.6rem 0.7rem;
    padding: 0.3rem 0.2rem 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
}

.table--leads tr:hover td {
    background: transparent;
}

.table--leads td {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
    padding: 0.2rem 0.5rem;
    border-bottom: 0;
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.3;
    word-break: break-word;
}

.table--leads td::before {
    content: attr(data-label);
    color: #94a3b8;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table--leads .lead-cell--number,
.table--leads .lead-cell--company,
.table--leads .lead-cell--actions,
.table--leads td.empty-state {
    grid-column: 1 / -1;
}

.table--leads .lead-cell--number {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 0.3rem;
    margin-bottom: 0.1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.table--leads .lead-cell--number strong {
    font-size: 1.05rem;
    color: #7CCC3F;
}

.table--leads .lead-cell--actions {
    flex-direction: row;
    justify-content: flex-end;
    margin-top: 0.2rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.table--leads .lead-cell--actions::before {
    content: none;
}

.table--leads .lead-cell--actions .btn {
    width: 100%;
}

.table--leads td.empty-state {
    text-align: center;
}

.table--leads td.empty-state::before {
    content: none;
}

.table--leads .status-quick__select {
    flex: 1 1 100%;
    max-width: none;
}

.table--leads .status-quick__btn {
    flex: 1 1 100%;
}

/* Computador: card mais largo, campos e controles lado a lado */
@media (min-width: 769px) {
    .table--leads tr {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .table--leads td[data-label="Status"] {
        grid-column: span 2;
    }

    .table--leads .status-quick__select {
        flex: 1 1 auto;
        max-width: 200px;
    }

    .table--leads .status-quick__btn {
        flex: 0 0 auto;
    }

    .table--leads .lead-cell--actions .btn {
        width: auto;
        min-width: 150px;
    }
}

@media (max-width: 640px) {
    .container {
        gap: 1.1rem;
    }

    .main {
        padding: 1.1rem 0.9rem;
    }

    .footer {
        padding: 1rem 0.9rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1 1 auto;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .header__content {
        gap: 0.6rem;
        padding: 0.55rem 0.85rem;
    }

    .header__left {
        gap: 0.6rem;
        flex: 1 1 auto;
        min-width: 0;
    }

    .header__brand {
        gap: 0.6rem;
        min-width: 0;
    }

    .header__logo img {
        height: 26px;
    }

    .header__title h1 {
        font-size: 0.95rem;
    }

    .header__user-info {
        display: none;
    }

    .header__user .avatar {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
    }

    .contact-strip__value {
        max-width: 140px;
    }
}

@media (max-width: 480px) {
    .header__title {
        display: none;
    }

    .menu-toggle {
        width: 38px;
        height: 38px;
    }
}

