:root {
    --ld-bg: #f5f7fb;
    --ld-bg-soft: #f8fafc;
    --ld-surface: #ffffff;
    --ld-surface-strong: #f8fbff;
    --ld-text: #101828;
    --ld-muted: #667085;
    --ld-muted-strong: #475467;
    --ld-border: #e4e7ec;
    --ld-border-strong: #d0d5dd;
    --ld-primary: #2563eb;
    --ld-primary-dark: #1d4ed8;
    --ld-primary-soft: #eef4ff;
    --ld-success: #079455;
    --ld-success-soft: #ecfdf3;
    --ld-warning: #dc6803;
    --ld-warning-soft: #fff8e8;
    --ld-danger-bg: #fff1f2;
    --ld-danger-border: #fecdd3;
    --ld-danger-text: #9f1239;
    --ld-shadow-soft: 0 18px 45px rgba(16, 24, 40, .06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ld-text);
    background: var(--ld-bg);
}

a {
    color: inherit;
}

.ld-auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.ld-auth-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 28px;
    align-items: stretch;
}

.ld-auth-brand,
.ld-auth-card,
.ld-panel-hero,
.ld-info-card,
.ld-hero-card,
.ld-metric-card,
.ld-section-card {
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 28px;
}

.ld-auth-brand {
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
}

.ld-brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--ld-primary);
    color: #fff;
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 28px;
}

.ld-brand-mark-small {
    width: 42px;
    height: 42px;
    min-width: 42px;
    margin-bottom: 0;
    border-radius: 14px;
    font-size: 19px;
}

.ld-eyebrow {
    margin: 0 0 10px;
    color: var(--ld-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 800;
}

.ld-auth-brand h1,
.ld-panel-hero h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1;
    letter-spacing: -0.05em;
}

.ld-auth-brand p:not(.ld-eyebrow),
.ld-panel-hero p,
.ld-info-card p,
.ld-card-header p,
.ld-auth-link,
.ld-hero-card p,
.ld-metric-card p,
.ld-section-card p {
    color: var(--ld-muted);
    line-height: 1.6;
}

.ld-auth-card {
    padding: 32px;
}

.ld-card-header h2 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.04em;
}

.ld-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.ld-form label {
    display: grid;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
}

.ld-form input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    font: inherit;
    color: var(--ld-text);
    background: #fff;
}

.ld-form input:focus {
    outline: 3px solid rgba(37, 99, 235, .14);
    border-color: var(--ld-primary);
}

.ld-input-suffix {
    display: flex;
    align-items: center;
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.ld-input-suffix input {
    border: 0;
    border-radius: 0;
}

.ld-input-suffix em {
    padding-right: 14px;
    color: var(--ld-muted);
    font-style: normal;
    white-space: nowrap;
}

.ld-button {
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ld-primary);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.ld-button:hover {
    background: var(--ld-primary-dark);
}

.ld-button-ghost {
    background: #eef4ff;
    color: var(--ld-primary);
}

.ld-button-ghost:hover {
    background: #dbeafe;
}

.ld-button-secondary {
    background: #fff;
    color: var(--ld-text);
    border: 1px solid var(--ld-border-strong);
}

.ld-button-secondary:hover {
    background: var(--ld-bg-soft);
}

.ld-alert {
    border-radius: 16px;
    padding: 12px 14px;
    margin-top: 18px;
    font-size: 14px;
}

.ld-alert p {
    margin: 0;
}

.ld-alert p + p {
    margin-top: 6px;
}

.ld-alert-error {
    background: var(--ld-danger-bg);
    border: 1px solid var(--ld-danger-border);
    color: var(--ld-danger-text);
}

.ld-auth-link a {
    color: var(--ld-primary);
    font-weight: 800;
    text-decoration: none;
}

.ld-dashboard-page {
    min-height: 100vh;
}

.ld-topbar {
    height: 72px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid var(--ld-border);
}

.ld-topbar div {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.ld-topbar span {
    color: var(--ld-muted);
}

.ld-dashboard {
    width: min(1120px, calc(100% - 40px));
    margin: 32px auto;
}

.ld-panel-hero {
    padding: 36px;
    margin-bottom: 24px;
}

.ld-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.ld-info-card {
    padding: 24px;
}

.ld-info-card span {
    display: block;
    color: var(--ld-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.ld-info-card strong {
    display: block;
    font-size: 20px;
    word-break: break-word;
}

/* Tenant app shell */
.ld-app-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .10), transparent 32%),
        var(--ld-bg);
}

.ld-app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.ld-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    color: #fff;
}

.ld-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.ld-sidebar-brand strong {
    font-size: 20px;
    letter-spacing: -0.03em;
}

.ld-sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}

.ld-sidebar-nav a {
    min-height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    border-radius: 14px;
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    font-size: 14px;
    font-weight: 750;
}

.ld-sidebar-nav a.is-active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.ld-sidebar-nav a.is-disabled {
    opacity: .56;
    cursor: not-allowed;
}

.ld-sidebar-foot {
    margin-top: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 22px;
    background: rgba(255, 255, 255, .08);
}

.ld-sidebar-foot span,
.ld-sidebar-foot p {
    color: rgba(255, 255, 255, .68);
}

.ld-sidebar-foot span {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .10em;
}

.ld-sidebar-foot strong {
    display: block;
    margin-top: 7px;
    font-size: 20px;
}

.ld-sidebar-foot p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.ld-app-main {
    min-width: 0;
}

.ld-app-header {
    min-height: 92px;
    padding: 22px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid var(--ld-border);
    backdrop-filter: blur(16px);
}

.ld-app-header h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.05em;
}

.ld-app-header span {
    display: block;
    margin-top: 5px;
    color: var(--ld-muted);
}

.ld-app-content {
    width: min(1240px, calc(100% - 48px));
    margin: 28px auto 48px;
}

.ld-hero-card {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    box-shadow: var(--ld-shadow-soft);
}

.ld-hero-card h2 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.02;
    letter-spacing: -0.06em;
}

.ld-hero-card p:not(.ld-eyebrow) {
    max-width: 720px;
    margin-bottom: 0;
}

.ld-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.ld-metric-card {
    padding: 20px;
}

.ld-metric-card span {
    display: block;
    color: var(--ld-muted);
    font-size: 13px;
    font-weight: 750;
}

.ld-metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    letter-spacing: -0.05em;
}

.ld-metric-card p {
    margin: 8px 0 0;
    font-size: 13px;
}

.ld-app-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr);
    gap: 18px;
    margin-top: 18px;
}

.ld-app-column {
    display: grid;
    gap: 18px;
    align-content: start;
}

.ld-section-card {
    padding: 24px;
}

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

.ld-section-header h3 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.04em;
}

.ld-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}

.ld-status-active,
.ld-status-done {
    background: var(--ld-success-soft);
    color: var(--ld-success);
}

.ld-status-draft,
.ld-status-pending {
    background: var(--ld-warning-soft);
    color: var(--ld-warning);
}

.ld-project-list,
.ld-domain-list,
.ld-step-list {
    display: grid;
    gap: 12px;
}

.ld-project-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--ld-border);
    border-radius: 20px;
    background: var(--ld-bg-soft);
}

.ld-project-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--ld-primary);
    color: #fff;
    font-weight: 900;
}

.ld-project-titleline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ld-project-titleline strong {
    font-size: 16px;
}

.ld-project-titleline span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--ld-border);
    color: var(--ld-muted);
    font-size: 12px;
    font-weight: 800;
}

.ld-project-body p {
    margin: 6px 0 0;
    font-size: 13px;
}

.ld-project-actions {
    display: flex;
    gap: 10px;
}

.ld-project-actions a {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--ld-border);
    color: var(--ld-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    cursor: not-allowed;
}

.ld-empty-state {
    padding: 18px;
    border-radius: 18px;
    background: var(--ld-bg-soft);
    border: 1px dashed var(--ld-border-strong);
}

.ld-empty-state p {
    margin-bottom: 0;
}

.ld-step-item {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--ld-border);
    border-radius: 18px;
}

.ld-step-item p {
    margin: 4px 0 0;
    font-size: 13px;
}

.ld-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-top: 5px;
    background: var(--ld-warning);
}

.ld-step-done {
    background: var(--ld-success);
}

.ld-step-blocked {
    background: var(--ld-border-strong);
}

.ld-domain-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: var(--ld-bg-soft);
    border: 1px solid var(--ld-border);
}

.ld-domain-row strong {
    word-break: break-word;
}

.ld-domain-row p {
    margin: 5px 0 0;
    font-size: 13px;
}

.ld-detail-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.ld-detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ld-border);
}

.ld-detail-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ld-detail-list dt {
    color: var(--ld-muted);
    font-size: 13px;
    font-weight: 750;
}

.ld-detail-list dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .ld-app-shell {
        grid-template-columns: 1fr;
    }

    .ld-sidebar {
        position: relative;
        height: auto;
    }

    .ld-sidebar-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ld-sidebar-foot {
        margin-top: 24px;
    }

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

    .ld-app-column-main {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .ld-auth-shell,
    .ld-grid,
    .ld-metrics-grid,
    .ld-app-grid {
        grid-template-columns: 1fr;
    }

    .ld-auth-brand {
        padding: 34px;
    }

    .ld-hero-card,
    .ld-app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ld-project-row {
        grid-template-columns: 48px 1fr;
    }

    .ld-project-actions {
        grid-column: 2;
    }
}

@media (max-width: 620px) {
    .ld-app-content {
        width: min(100% - 28px, 1240px);
    }

    .ld-app-header {
        padding: 20px;
    }

    .ld-sidebar-nav {
        grid-template-columns: 1fr;
    }
}

/* 0H — Leads / Inbox inicial */
.ld-section-link {
    color: #5b35f5;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.ld-section-link:hover {
    text-decoration: underline;
}

.ld-panel-feedback {
    border-radius: 18px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid transparent;
}

.ld-panel-feedback-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.ld-panel-feedback-error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.ld-hero-card-compact {
    min-height: auto;
}

.ld-mini-lead-list,
.ld-lead-table {
    display: grid;
    gap: 12px;
}

.ld-mini-lead-row,
.ld-lead-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    background: #ffffff;
}

.ld-mini-lead-row strong,
.ld-lead-row strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.ld-mini-lead-row p,
.ld-lead-row p,
.ld-lead-row small {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.ld-lead-main {
    min-width: 0;
}

.ld-lead-titleline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ld-lead-status-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ld-lead-status-form select {
    min-width: 150px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, .14);
    background: #ffffff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    padding: 0 10px;
}

.ld-button-small {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 13px;
}

.ld-lead-status-new {
    background: #eef2ff;
    color: #4338ca;
}

.ld-lead-status-seen {
    background: #f1f5f9;
    color: #475569;
}

.ld-lead-status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.ld-lead-status-converted {
    background: #dcfce7;
    color: #166534;
}

.ld-lead-status-archived {
    background: #f8fafc;
    color: #64748b;
}

@media (max-width: 760px) {
    .ld-lead-row,
    .ld-lead-status-form {
        align-items: stretch;
        flex-direction: column;
    }

    .ld-lead-status-form select,
    .ld-lead-status-form .ld-button-small {
        width: 100%;
    }
}
