/* =========================================================
   Ferrão Prospect v0.29.4
   Fundação visual · identidade Ferrão Soluções
   ========================================================= */

:root {
    --brand-primary: #318B36;
    --brand-primary-dark: #155A26;
    --brand-primary-deep: #114716;
    --brand-accent: #FED639;
    --brand-accent-ink: #201D1F;
    --serveasy-blue: var(--brand-primary);
    --serveasy-blue-dark: var(--brand-primary-dark);
    --ink: #0f172a;
    --muted: #64748b;
    --soft: #f6f8fb;
    --card: #ffffff;
    --line: #e5eaf0;
    --line-strong: #d8e1ec;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --purple: #7c3aed;
    --shadow: 0 20px 50px rgba(15, 23, 42, .08);
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, .06);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --sidebar-width: 286px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--soft);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Auth */
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(49, 139, 54, .16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, .08), transparent 36%),
        #f6f8fb;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-card {
    width: min(100%, 460px);
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(229, 234, 240, .9);
    box-shadow: var(--shadow);
    border-radius: 30px;
    padding: 34px;
    backdrop-filter: blur(16px);
}

.auth-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-logo {
    width: 230px;
    height: auto;
}

.auth-heading {
    text-align: center;
    margin-bottom: 26px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--serveasy-blue-dark);
    background: rgba(49,139,54,.1);
    border: 1px solid rgba(49,139,54,.16);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.auth-heading h1 {
    margin: 18px 0 8px;
    font-size: 30px;
    line-height: 1.08;
}

.auth-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 8px;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    padding: 14px 15px;
    outline: none;
    transition: border .2s ease, box-shadow .2s ease;
}

.auth-form input:focus {
    border-color: rgba(49,139,54,.75);
    box-shadow: 0 0 0 4px rgba(49,139,54,.12);
}

.alert {
    border-radius: 15px;
    padding: 13px 15px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 650;
}

.alert-danger {
    background: rgba(220,38,38,.08);
    color: #991b1b;
    border: 1px solid rgba(220,38,38,.18);
}

/* App shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    inset: 0 auto 0 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 22px;
    z-index: 50;
}

.sidebar-brand {
    margin-bottom: 28px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    padding: 4px;
}

.brand-text {
    font-weight: 850;
    font-size: 18px;
    letter-spacing: -.03em;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 11px 13px;
    color: #435267;
    border-radius: 15px;
    font-weight: 700;
    font-size: 14px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.nav-item:hover {
    background: rgba(49,139,54,.08);
    color: var(--serveasy-blue-dark);
}

.nav-item.is-active {
    background: linear-gradient(135deg, rgba(49,139,54,.14), rgba(49,139,54,.07));
    color: var(--serveasy-blue-dark);
    box-shadow: inset 0 0 0 1px rgba(49,139,54,.18);
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(15,23,42,.05);
    color: inherit;
    font-weight: 900;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--serveasy-blue);
    color: #fff;
    font-weight: 900;
}

.user-mini strong,
.user-mini span {
    display: block;
}

.user-mini strong {
    font-size: 13px;
}

.user-mini span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.logout-link {
    color: #9f1239;
}

.main-content {
    width: 100%;
    margin-left: var(--sidebar-width);
    padding: 28px;
}

.topbar {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: -.045em;
    line-height: 1.05;
}

.topbar p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    display: none;
    border: 0;
    background: #fff;
    border-radius: 14px;
    width: 44px;
    height: 44px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-weight: 900;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 14px;
    padding: 0 16px;
    border: 1px solid transparent;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--serveasy-blue), #4F9F4B);
    color: #fff;
    box-shadow: 0 12px 22px rgba(49,139,54,.25);
}

.btn-secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.btn-full {
    width: 100%;
    margin-top: 14px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.metric-card::after {
    content: '';
    position: absolute;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    right: -34px;
    top: -36px;
    opacity: .12;
    background: currentColor;
}

.metric-card span,
.metric-card small {
    display: block;
    color: var(--muted);
}

.metric-card span {
    font-size: 13px;
    font-weight: 800;
}

.metric-card strong {
    display: block;
    font-size: 36px;
    letter-spacing: -.045em;
    margin: 10px 0 6px;
}

.metric-card small {
    font-size: 12px;
    line-height: 1.4;
}

.metric-blue { color: var(--serveasy-blue-dark); }
.metric-warning { color: #b45309; }
.metric-info { color: #155A26; }
.metric-purple { color: var(--purple); }
.metric-success { color: var(--success); }
.metric-dark { color: var(--ink); }
.metric-danger { color: var(--danger); }
.metric-slate { color: #475569; }

.content-grid {
    display: grid;
    gap: 20px;
}

.two-columns {
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, .8fr);
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 22px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-header h2,
.hero-panel h2 {
    margin: 0;
    letter-spacing: -.035em;
    font-size: 22px;
}

.panel-header p,
.hero-panel p {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.compact-header {
    margin-bottom: 12px;
}

.empty-state {
    border: 1px dashed var(--line-strong);
    border-radius: 22px;
    padding: 44px 24px;
    text-align: center;
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(49,139,54,.1);
    color: var(--serveasy-blue-dark);
    font-size: 22px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 20px;
    letter-spacing: -.02em;
}

.empty-state p {
    color: var(--muted);
    margin: 0 auto 20px;
    max-width: 470px;
    line-height: 1.55;
}

.prospect-list {
    display: grid;
    gap: 10px;
}

.prospect-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 15px;
    background: #fff;
    transition: border .2s ease, transform .2s ease, box-shadow .2s ease;
}

.prospect-row:hover {
    border-color: rgba(49,139,54,.36);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.prospect-row strong,
.prospect-row span {
    display: block;
}

.prospect-row strong {
    font-size: 15px;
}

.prospect-row span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.fit-pill,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.fit-pill {
    background: rgba(15,23,42,.06);
    color: var(--ink);
}

.badge-warning { background: rgba(245,158,11,.12); color: #92400e; }
.badge-muted { background: rgba(100,116,139,.12); color: #475569; }
.badge-info { background: rgba(49,139,54,.12); color: var(--serveasy-blue-dark); }
.badge-purple { background: rgba(124,58,237,.11); color: #6d28d9; }
.badge-blue { background: rgba(49,139,54,.1); color: #155A26; }
.badge-success { background: rgba(22,163,74,.11); color: #15803d; }
.badge-dark { background: rgba(15,23,42,.11); color: var(--ink); }
.badge-danger { background: rgba(220,38,38,.10); color: #b91c1c; }

.rule-card {
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(49,139,54,.1), rgba(49,139,54,.03));
    border: 1px solid rgba(49,139,54,.15);
}

.rule-card strong {
    display: block;
    font-size: 17px;
    letter-spacing: -.02em;
}

.rule-card p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.status-stack {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.hero-panel {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at top right, rgba(49,139,54,.13), transparent 32%),
        #fff;
}

.hero-panel h2 {
    margin-top: 18px;
    font-size: clamp(26px, 4vw, 40px);
    max-width: 760px;
}

.hero-panel p {
    max-width: 720px;
    font-size: 16px;
}

.placeholder-actions {
    margin-top: 24px;
}

@media (max-width: 1180px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: var(--shadow);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    .topbar {
        align-items: flex-start;
    }

    .topbar-actions {
        display: none;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .panel-header,
    .prospect-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .row-meta {
        justify-content: flex-start;
    }

    .auth-shell {
        padding: 18px;
    }

    .auth-card {
        padding: 26px;
        border-radius: 24px;
    }
}

/* =========================================================
   Serveasy Prospect Desk v0.2.0
   Pré-contactos + Inter global
   ========================================================= */

.alert-success {
    background: rgba(22,163,74,.09);
    color: #166534;
    border: 1px solid rgba(22,163,74,.18);
}

.alert-warning {
    background: rgba(245,158,11,.10);
    color: #92400e;
    border: 1px solid rgba(245,158,11,.20);
}

.alert-list {
    margin: 8px 0 0 18px;
    padding: 0;
}

.filter-panel {
    margin-bottom: 18px;
}

.filters-form {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) minmax(170px, .7fr) minmax(170px, .7fr) minmax(130px, .45fr) auto auto;
    align-items: end;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    padding: 13px 14px;
    color: var(--ink);
    outline: none;
    transition: border .2s ease, box-shadow .2s ease;
}

.field textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(49,139,54,.75);
    box-shadow: 0 0 0 4px rgba(49,139,54,.11);
}

.filter-check {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

.filter-actions {
    display: flex;
    gap: 9px;
}

.prospects-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 920px;
}

.premium-table th,
.premium-table td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

.premium-table th {
    background: #f8fbfe;
    color: #526176;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .035em;
    font-weight: 850;
}

.premium-table tr:last-child td {
    border-bottom: 0;
}

.table-title {
    display: grid;
    gap: 4px;
}

.table-title strong {
    color: var(--ink);
    font-size: 14px;
    letter-spacing: -.015em;
}

.table-title span {
    color: var(--muted);
    font-size: 12px;
}

.actions-col {
    width: 130px;
    text-align: right !important;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 11px;
    padding: 0 10px;
    background: rgba(15,23,42,.05);
    color: #334155;
    font-size: 12px;
    font-weight: 850;
}

.icon-btn:hover {
    background: rgba(49,139,54,.10);
    color: var(--serveasy-blue-dark);
}

.form-layout,
.detail-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .62fr);
}

.prospect-form {
    display: grid;
    gap: 18px;
}

.form-section {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.form-section-head {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.section-kicker {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: rgba(49,139,54,.10);
    color: var(--serveasy-blue-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 12px;
}

.form-section-head h2,
.side-note-panel h2,
.profile-hero h2 {
    margin: 0;
    letter-spacing: -.035em;
}

.form-section-head p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid rgba(220,38,38,.14);
    background: rgba(220,38,38,.04);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 14px;
}

.check-card input {
    margin-top: 3px;
}

.check-card strong,
.check-card small {
    display: block;
}

.check-card small {
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.45;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.sticky-actions {
    position: sticky;
    bottom: 18px;
    background: rgba(246,248,251,.86);
    border: 1px solid rgba(229,234,240,.8);
    box-shadow: var(--shadow-soft);
    border-radius: 18px;
    padding: 12px;
    backdrop-filter: blur(10px);
}

.side-note-panel {
    align-self: start;
    display: grid;
    gap: 16px;
}

.mini-checklist {
    display: grid;
    gap: 9px;
}

.mini-checklist span {
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: #334155;
    font-weight: 750;
    background: #fff;
}

.duplicate-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.duplicate-item {
    display: grid;
    gap: 3px;
    border-radius: 13px;
    padding: 10px 12px;
    background: rgba(255,255,255,.68);
    border: 1px solid rgba(245,158,11,.20);
}

.duplicate-item span {
    font-weight: 850;
}

.duplicate-item small {
    color: #92400e;
}

.profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    background:
        radial-gradient(circle at top right, rgba(49,139,54,.12), transparent 34%),
        #fff;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--serveasy-blue), #4F9F4B);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    box-shadow: 0 16px 28px rgba(49,139,54,.22);
}

.profile-hero h2 {
    margin-top: 8px;
    font-size: clamp(26px, 4vw, 38px);
}

.profile-hero p {
    color: var(--muted);
    margin: 6px 0 0;
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.info-item {
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 14px;
    background: #fff;
}

.info-item span,
.info-item strong {
    display: block;
}

.info-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.info-item strong {
    margin-top: 6px;
    font-size: 14px;
}

.text-block {
    border-top: 1px solid var(--line);
    padding-top: 18px;
    margin-top: 18px;
}

.text-block h3 {
    margin: 0 0 8px;
    font-size: 16px;
    letter-spacing: -.02em;
}

.text-block p {
    margin: 0;
    color: #475569;
    line-height: 1.65;
}

.danger-block {
    border-top-color: rgba(220,38,38,.20);
}

.empty-mini {
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    padding: 18px;
    color: var(--muted);
    background: #fbfdff;
}

.timeline-list {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--serveasy-blue);
    box-shadow: 0 0 0 6px rgba(49,139,54,.10);
}

.timeline-item strong,
.timeline-item small {
    display: block;
}

.timeline-item small {
    color: var(--muted);
    margin-top: 3px;
}

.timeline-item p {
    margin: 6px 0 0;
    color: #475569;
}

.data-stack {
    display: grid;
    gap: 10px;
}

.data-stack span {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 12px;
    color: #475569;
    background: #fff;
}

.data-stack strong {
    color: var(--ink);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .035em;
}

@media (max-width: 1180px) {
    .filters-form,
    .form-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .filters-form,
    .form-grid.two,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions,
    .form-actions,
    .profile-actions {
        width: 100%;
        justify-content: stretch;
    }

    .filter-actions .btn,
    .form-actions .btn,
    .profile-actions .btn {
        flex: 1;
    }

    .profile-hero,
    .profile-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .sticky-actions {
        position: static;
    }
}

/* =========================================================
   Contactos e Fontes v0.3.2
   ========================================================= */

.mini-stat {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 9px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.table-subnote {
    display: block;
    margin-top: 5px;
    color: var(--serveasy-blue-dark);
    font-size: 12px;
    font-weight: 800;
}

.contact-list {
    display: grid;
    gap: 12px;
}

.contact-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    background:
        radial-gradient(circle at top right, rgba(49,139,54,.08), transparent 28%),
        #fff;
    box-shadow: 0 10px 24px rgba(15,23,42,.035);
}

.contact-card.is-muted {
    opacity: .68;
    background: #fbfdff;
}

.contact-card-main {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    min-width: 0;
}

.contact-type-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(49,139,54,.12);
    color: var(--serveasy-blue-dark);
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(49,139,54,.14);
}

.contact-headline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.contact-headline strong {
    font-size: 15px;
    letter-spacing: -.01em;
}

.contact-value {
    display: block;
    color: var(--ink);
    font-weight: 850;
    line-height: 1.45;
    word-break: break-word;
}

a.contact-value:hover {
    color: var(--serveasy-blue-dark);
}

.source-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.source-line a {
    color: var(--serveasy-blue-dark);
}

.source-note {
    margin: 10px 0 0;
    color: #475569;
    line-height: 1.55;
    font-size: 13px;
}

.contact-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.contact-actions form {
    margin: 0;
}

.link-action {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #475569;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
    transition: border .2s ease, color .2s ease, background .2s ease;
}

.link-action:hover {
    border-color: rgba(49,139,54,.35);
    color: var(--serveasy-blue-dark);
    background: rgba(49,139,54,.06);
}

.danger-link {
    color: #b91c1c;
}

.danger-link:hover {
    border-color: rgba(220,38,38,.25);
    color: #991b1b;
    background: rgba(220,38,38,.06);
}

.contact-form-panel {
    align-self: start;
}

.mini-form {
    display: grid;
    gap: 13px;
}

.compact-two {
    gap: 10px;
}

.slim-check {
    padding: 12px;
    border-radius: 16px;
}

@media (max-width: 980px) {
    .contact-card {
        grid-template-columns: 1fr;
    }

    .contact-actions {
        justify-content: flex-start;
    }
}

/* =========================================================
   UI Global Polish v0.3.3
   Badges centradas + respiro geral de cards
   ========================================================= */

:root {
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --panel-padding: 26px;
    --panel-gap: 24px;
}

.badge,
.fit-pill,
.mini-stat {
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    min-height: 32px;
    padding: 0 12px;
}

.status-stack {
    gap: 10px;
}

.status-stack .badge,
.status-stack .fit-pill {
    min-height: 34px;
    padding: 0 14px;
}

.panel {
    padding: var(--panel-padding);
    border-radius: 26px;
}

.content-grid {
    gap: var(--panel-gap);
    margin-bottom: var(--panel-gap);
}

.main-content > .content-grid:last-child,
.main-content > section:last-child {
    margin-bottom: 0;
}

.detail-layout {
    gap: var(--panel-gap);
    align-items: start;
    grid-template-columns: minmax(0, 1.55fr) minmax(360px, .68fr);
}

.profile-hero.panel {
    padding: 28px;
    margin-bottom: var(--panel-gap);
}

.profile-main {
    align-items: flex-start;
}

.profile-actions {
    align-self: flex-start;
    padding-top: 4px;
}

.panel-header {
    margin-bottom: 22px;
}

.compact-header {
    margin-bottom: 18px;
}

.side-note-panel,
.contact-form-panel {
    align-self: start;
    display: grid;
    gap: 20px;
}

.side-note-panel .btn-full {
    margin-top: 0;
}

.rule-card {
    padding: 22px;
}

.info-grid {
    gap: 16px;
    margin-bottom: 24px;
    align-items: stretch;
}

.info-item {
    min-height: 82px;
    padding: 17px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-block {
    padding-top: 22px;
    margin-top: 22px;
}

.empty-mini {
    min-height: 72px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
}

.contact-list {
    gap: 16px;
}

.contact-card {
    gap: 20px;
    border-radius: 22px;
    padding: 20px;
}

.contact-card-main {
    gap: 15px;
}

.contact-form-panel .mini-form {
    gap: 16px;
}

.data-stack {
    gap: 12px;
}

.data-stack span {
    min-height: 78px;
    padding: 16px;
    justify-content: center;
}

.timeline-list {
    gap: 16px;
}

.timeline-item {
    min-height: 46px;
}

@media (max-width: 1180px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .panel {
        padding: 20px;
        border-radius: 22px;
    }

    .profile-hero.panel {
        padding: 22px;
    }

    .detail-layout,
    .content-grid {
        gap: 18px;
        margin-bottom: 18px;
    }

    .status-stack .badge,
    .status-stack .fit-pill {
        min-height: 32px;
    }
}

/* =========================================================
   UI Stability Lock v0.3.4
   Ficha do pré-contacto: colunas independentes, respiro real
   ========================================================= */

.btn,
.badge,
.fit-pill,
.link-action {
    white-space: nowrap;
}

.badge,
.fit-pill,
.mini-stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}

.panel {
    padding: 24px;
}

.panel-header {
    align-items: flex-start;
}

.panel-header .btn {
    flex: 0 0 auto;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 24px;
    align-items: start;
}

.profile-column {
    display: grid;
    gap: 24px;
    align-content: start;
    min-width: 0;
}

.profile-sidebar-stack {
    min-width: 0;
}

.profile-hero.panel {
    margin-bottom: 24px;
    padding: 26px 28px;
}

.profile-hero h2 {
    margin: 10px 0 0;
    line-height: 1.08;
}

.profile-hero p {
    line-height: 1.45;
}

.profile-actions {
    align-items: center;
}

.info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.info-item {
    min-height: 76px;
    padding: 16px 18px;
    justify-content: center;
}

.contact-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 20px 22px;
}

.contact-actions {
    max-width: 340px;
}

.contact-form-panel .check-card {
    border-color: rgba(49, 139, 54, .18);
    background: rgba(49, 139, 54, .045);
    margin-bottom: 0;
}

.contact-form-panel .btn-full {
    margin-top: 4px;
}

.data-stack span {
    min-height: 74px;
    align-items: start;
    text-align: left;
}

.timeline-list {
    min-height: 0;
}

@media (max-width: 1180px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-column {
        gap: 20px;
    }

    .profile-sidebar-stack {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .contact-card {
        grid-template-columns: 1fr;
    }

    .contact-actions {
        max-width: none;
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .profile-hero.panel {
        padding: 22px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Badge Alignment Lock v0.3.5
   Corrige interferência de .prospect-row span nas badges/tags.
   ========================================================= */

.prospect-row .row-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.prospect-row .row-meta .badge,
.prospect-row .row-meta .fit-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    height: 34px;
    padding: 0 16px;
    margin: 0;
    border-radius: 999px;
    line-height: 1;
    font-size: 13px;
    font-weight: 850;
    text-align: center;
    white-space: nowrap;
}

.prospect-row .row-meta .fit-pill {
    background: rgba(15,23,42,.06);
    color: var(--ink);
}

.prospect-row .row-meta .badge-warning { background: rgba(245,158,11,.12); color: #92400e; }
.prospect-row .row-meta .badge-muted { background: rgba(100,116,139,.12); color: #475569; }
.prospect-row .row-meta .badge-info { background: rgba(49,139,54,.12); color: var(--serveasy-blue-dark); }
.prospect-row .row-meta .badge-purple { background: rgba(124,58,237,.11); color: #6d28d9; }
.prospect-row .row-meta .badge-blue { background: rgba(49,139,54,.1); color: #155A26; }
.prospect-row .row-meta .badge-success { background: rgba(22,163,74,.11); color: #15803d; }
.prospect-row .row-meta .badge-dark { background: rgba(15,23,42,.11); color: var(--ink); }
.prospect-row .row-meta .badge-danger { background: rgba(220,38,38,.10); color: #b91c1c; }

.status-stack .badge,
.status-stack .fit-pill,
.contact-actions .badge,
.contact-actions .fit-pill,
.profile-hero .badge,
.profile-hero .fit-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}

/* =========================================================
   List Row Alignment Lock v0.3.6
   Remove ruído redundante e centra conteúdo da tabela premium.
   ========================================================= */

.premium-table th.cell-center,
.premium-table td.cell-center {
    text-align: center;
    vertical-align: middle;
}

.premium-table td.cell-fit,
.premium-table td.cell-status,
.premium-table td.cell-contacts,
.premium-table td.cell-date,
.premium-table td.cell-actions,
.premium-table td.actions-col {
    text-align: center !important;
    vertical-align: middle;
}

.premium-table .cell-fit .fit-pill,
.premium-table .cell-status .badge,
.premium-table .cell-contacts .mini-stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    height: 34px;
    min-height: 34px;
    padding: 0 16px;
    margin: 0 auto;
    white-space: nowrap;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}

.premium-table .cell-contacts {
    color: var(--muted);
}

.premium-table .cell-contacts .mini-stat {
    background: #fff;
    color: #475569;
    border-color: var(--line);
}

.premium-table .table-actions {
    justify-content: center;
    align-items: center;
}

.premium-table .cell-date {
    color: var(--ink);
    line-height: 1.35;
    white-space: nowrap;
}

.table-subnote {
    display: none !important;
}

.muted-dash {
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 980px) {
    .premium-table {
        min-width: 980px;
    }
}

/* =========================================================
   Compact Density Lock v0.3.7
   Regra global: premium compacto, sem cartões gigantes.
   ========================================================= */

:root {
    --sidebar-width: 252px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --shadow: 0 14px 34px rgba(15, 23, 42, .07);
    --shadow-soft: 0 8px 20px rgba(15, 23, 42, .055);
    --panel-padding: 18px;
    --panel-gap: 16px;
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 14px;
    --space-lg: 18px;
    --space-xl: 24px;
}

body {
    font-size: 14px;
}

/* Shell mais compacto */
.sidebar {
    padding: 16px;
}

.sidebar-brand {
    margin-bottom: 20px;
}

.brand-link {
    gap: 10px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.brand-text {
    font-size: 16px;
}

.sidebar-nav {
    gap: 6px;
}

.nav-item {
    min-height: 40px;
    padding: 9px 11px;
    border-radius: 13px;
    font-size: 13px;
    gap: 10px;
}

.nav-icon {
    width: 22px;
    height: 22px;
    border-radius: 8px;
}

.sidebar-footer {
    gap: 10px;
}

.user-card {
    padding: 12px;
    border-radius: 16px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.main-content {
    padding: 20px 22px;
}

.topbar {
    min-height: 58px;
    margin-bottom: 16px;
    gap: 14px;
}

.topbar h1 {
    font-size: clamp(26px, 2.5vw, 34px);
    line-height: 1.02;
}

.topbar p {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.45;
}

/* Botões e badges */
.btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 13px;
    gap: 7px;
}

.btn-full {
    margin-top: 10px;
}

.icon-btn {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 12px;
}

.badge,
.fit-pill,
.mini-stat,
.prospect-row .row-meta .badge,
.prospect-row .row-meta .fit-pill,
.premium-table .cell-fit .fit-pill,
.premium-table .cell-status .badge,
.premium-table .cell-contacts .mini-stat {
    min-height: 30px;
    height: 30px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Painéis e grelhas */
.metrics-grid {
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    padding: 16px;
    border-radius: 16px;
}

.metric-card::after {
    width: 78px;
    height: 78px;
    right: -30px;
    top: -32px;
}

.metric-card span {
    font-size: 12px;
}

.metric-card strong {
    font-size: 30px;
    margin: 7px 0 4px;
}

.metric-card small {
    font-size: 11px;
}

.content-grid,
.profile-column {
    gap: 16px;
    margin-bottom: 16px;
}

.panel,
.profile-hero.panel {
    padding: 18px;
    border-radius: 20px;
}

.panel-header {
    margin-bottom: 14px;
    gap: 12px;
}

.panel-header h2,
.hero-panel h2,
.side-note-panel h2,
.profile-hero h2 {
    font-size: 20px;
    line-height: 1.12;
}

.panel-header p,
.hero-panel p,
.side-note-panel p,
.profile-hero p {
    margin-top: 5px;
    line-height: 1.45;
}

.empty-state {
    padding: 28px 18px;
    border-radius: 18px;
}

.empty-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    border-radius: 15px;
}

.empty-state h3 {
    font-size: 18px;
}

/* Dashboard/listas */
.prospect-list {
    gap: 8px;
}

.prospect-row {
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
}

.prospect-row strong {
    font-size: 14px;
}

.prospect-row span {
    font-size: 12px;
    margin-top: 3px;
}

.row-meta {
    gap: 8px;
}

.rule-card {
    padding: 16px;
    border-radius: 16px;
}

.rule-card strong {
    font-size: 16px;
}

.rule-card p {
    margin-top: 6px;
    line-height: 1.45;
}

/* Filtros, formulários e tabelas */
.filter-panel {
    margin-bottom: 14px;
}

.filters-form {
    gap: 10px;
}

.field {
    gap: 6px;
}

.field span,
.form-section label,
.mini-form label {
    font-size: 12px;
}

.field input,
.field select,
.field textarea {
    padding: 10px 12px;
    border-radius: 13px;
    font-size: 14px;
}

.field textarea {
    min-height: 86px;
    line-height: 1.45;
}

.filter-check {
    min-height: 38px;
}

.prospects-table-wrap {
    border-radius: 18px;
}

.premium-table th,
.premium-table td {
    padding: 11px 12px;
    font-size: 12px;
}

.premium-table th {
    font-size: 11px;
}

.table-title {
    gap: 2px;
}

.table-title strong {
    font-size: 13px;
}

.table-title span {
    font-size: 12px;
    line-height: 1.3;
}

/* Ficha de pré-contacto */
.profile-layout {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
    gap: 16px;
}

.profile-hero.panel {
    margin-bottom: 16px;
    padding: 18px 20px;
}

.profile-main {
    gap: 14px;
}

.profile-avatar {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    font-size: 26px;
}

.profile-hero h2 {
    font-size: clamp(26px, 3vw, 36px);
    margin-top: 8px;
}

.profile-hero .status-stack {
    margin-top: 12px;
}

.profile-actions {
    gap: 8px;
}

.info-grid {
    gap: 10px;
    margin-bottom: 16px;
}

.info-item {
    min-height: 62px;
    padding: 12px 14px;
    border-radius: 15px;
}

.info-item span,
.data-stack small {
    font-size: 11px;
    margin-bottom: 4px;
}

.info-item strong,
.data-stack strong {
    font-size: 14px;
}

.text-block {
    padding-top: 16px;
    margin-top: 16px;
}

.text-block h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

.text-block p {
    line-height: 1.55;
}

.side-note-panel,
.contact-form-panel {
    gap: 14px;
}

.data-stack {
    gap: 10px;
}

.data-stack span {
    min-height: 58px;
    padding: 12px 14px;
    border-radius: 14px;
}

.contact-list {
    gap: 12px;
}

.contact-card {
    padding: 14px 16px;
    border-radius: 18px;
    gap: 14px;
}

.contact-card-main {
    gap: 12px;
}

.contact-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.contact-body h3 {
    font-size: 15px;
}

.contact-value {
    font-size: 16px;
    margin-top: 6px;
}

.contact-note,
.contact-source {
    line-height: 1.45;
}

.contact-actions {
    gap: 7px;
}

.contact-form-panel .mini-form {
    gap: 12px;
}

.contact-form-panel .check-card,
.check-card {
    padding: 12px;
    border-radius: 15px;
    gap: 10px;
}

.timeline-list {
    gap: 12px;
}

.timeline-item {
    min-height: 38px;
}

.timeline-dot {
    width: 22px;
    height: 22px;
}

/* Responsivo compacto */
@media (max-width: 1180px) {
    .profile-layout,
    .detail-layout,
    .two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    :root {
        --panel-padding: 16px;
        --panel-gap: 14px;
    }

    .main-content {
        padding: 16px;
    }

    .topbar {
        min-height: 0;
        align-items: flex-start;
    }

    .panel,
    .profile-hero.panel {
        padding: 16px;
        border-radius: 18px;
    }

    .metrics-grid {
        gap: 10px;
    }

    .profile-main {
        align-items: flex-start;
    }

    .profile-actions {
        width: 100%;
    }

    .profile-actions .btn {
        flex: 1;
    }

    .contact-card {
        padding: 14px;
    }
}

/* =========================================================
   v0.3.9 · Metadata Compact Lock
   Compactação específica do bloco Metadados na ficha.
   ========================================================= */
.profile-sidebar .data-stack {
    gap: 8px;
}

.profile-sidebar .data-stack span {
    min-height: 0 !important;
    padding: 10px 12px !important;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    line-height: 1.2;
}

.profile-sidebar .data-stack strong {
    margin: 0;
    font-size: 10.5px;
    line-height: 1;
    letter-spacing: .04em;
    white-space: nowrap;
}

.profile-sidebar .data-stack span,
.profile-sidebar .data-stack span > *:not(strong) {
    font-size: 13px;
}

.profile-sidebar .data-stack span {
    color: var(--ink);
    font-weight: 700;
}

@media (max-width: 760px) {
    .profile-sidebar .data-stack span {
        padding: 9px 11px !important;
    }
}

/* =========================================================
   v0.3.10 · Metadata Compact Selector Fix · NO SQL
   Corrige selector errado: a coluna lateral da ficha usa
   .profile-sidebar-stack, não .profile-sidebar.
   ========================================================= */
.profile-sidebar-stack .data-stack {
    gap: 6px !important;
}

.profile-sidebar-stack .data-stack span {
    min-height: 0 !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    display: grid !important;
    grid-template-columns: 120px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    text-align: left !important;
    line-height: 1.15 !important;
}

.profile-sidebar-stack .data-stack strong {
    margin: 0 !important;
    font-size: 10px !important;
    line-height: 1 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    color: var(--muted) !important;
}

.profile-sidebar-stack .data-stack span,
.profile-sidebar-stack .data-stack span > *:not(strong) {
    font-size: 12.5px !important;
}

.profile-sidebar-stack .data-stack span {
    color: var(--ink) !important;
    font-weight: 700 !important;
}

@media (max-width: 760px) {
    .profile-sidebar-stack .data-stack span {
        grid-template-columns: 105px minmax(0, 1fr) !important;
        padding: 8px 9px !important;
    }
}
