/* Leads extends the existing visual system without changing the login layout. */
.secondary {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--green);
}
.text-link, .back-link, .row-actions a {
    color: var(--green);
    font-weight: 600;
    font-size: 12px;
}
.text-link:hover, .back-link:hover, .row-actions a:hover {
    text-decoration: underline;
}
.back-link {
    display: inline-block;
    margin-bottom: 23px;
}
.page-heading h1, .plain-text, .lead-name {
    overflow-wrap: anywhere;
}
.page-heading > div {
    min-width: 0;
}
.page-heading > .button {
    flex-shrink: 0;
    font-size: 12px;
}
.filters {
    padding: 20px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
}
.filters > div {
    min-width: 170px;
}
.filters .filter-search {
    flex: 1;
}
.filters label, .field label, .note-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 9px;
}
.filters input, .filters select, .field input, .field select, .field textarea, .note-form textarea {
    width: 100%;
    border: 1px solid #d6dfd7;
    border-radius: 8px;
    background: white;
    color: var(--ink);
    font: inherit;
    padding: 12px;
    min-height: 45px;
}
textarea {
    resize: vertical;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--mint);
    border-color: var(--green);
}
.filters .text-link {
    padding: 14px 0;
}
.lead-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
    font-size: 12px;
}
.lead-table th {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-align: left;
    padding: 17px;
    border-bottom: 1px solid var(--border);
    background: #fafcf9;
}
.lead-table td {
    padding: 18px 17px;
    border-bottom: 1px solid #edf1eb;
    vertical-align: middle;
    overflow-wrap: anywhere;
}
.lead-table tr:last-child td {
    border-bottom: 0;
}
.lead-table th:first-child {
    width: 23%;
}
.lead-table th:nth-child(2) {
    width: 28%;
}
.lead-table th:last-child {
    width: 17%;
}
.lead-name {
    font-weight: 600;
}
.contact-cell span {
    display: block;
    line-height: 1.6;
    color: var(--muted);
}
.row-actions a {
    font-size: 11px;
    display: inline-block;
    margin: 4px 8px 4px 0;
}
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    color: var(--muted);
    font-size: 11px;
}
.pagination > div {
    display: flex;
    gap: 9px;
}
.pagination .button {
    font-size: 11px;
    padding: 10px 14px;
    min-height: 38px;
}
.lead-form {
    padding: 30px;
    max-width: 820px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.full-width {
    grid-column: 1 / -1;
}
.field-help, .field-error {
    display: block;
    font-size: 11px;
    line-height: 1.6;
    margin-top: 7px;
    color: var(--muted);
}
.field-error {
    color: #9a392a;
}
[aria-invalid="true"] {
    border-color: #b56152 !important;
}
.form-footer {
    border-top: 1px solid var(--border);
    padding-top: 23px;
    margin-top: 26px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.form-footer .button, .note-form .button {
    font-size: 12px;
}
button:disabled {
    opacity: .7;
    cursor: wait;
}
.duplicate-card {
    padding: 20px;
    margin: 18px 0;
    border-color: #e1d5ba;
}
.duplicate-card p {
    font-size: 12px;
}
.duplicate-card ul {
    padding-left: 20px;
    line-height: 2;
}
.success-notice {
    background: #eaf4ed;
    color: var(--green);
    border: 1px solid #cfe1d3;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 0 0 20px;
}
.lead-data, .notes-card, .history-card {
    padding: 27px;
}
.lead-data h2, .notes-card h2, .history-card h2 {
    font-size: 17px;
    margin-bottom: 8px;
}
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 30px;
    margin-top: 20px;
}
.detail-grid div {
    font-size: 12px;
    padding: 14px 0;
}
.detail-grid dd {
    overflow-wrap: anywhere;
    max-width: 65%;
}
.observation {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 12px;
}
.observation h3 {
    font-size: 12px;
    margin-bottom: 10px;
}
.plain-text {
    white-space: pre-wrap;
    font-size: 12px;
    line-height: 1.8;
}
.lead-detail-columns {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    margin-top: 22px;
    align-items: start;
}
.notes-card > p, .history-card > p {
    font-size: 11px;
}
.note-form {
    margin: 22px 0;
}
.note-form .button {
    margin-top: 15px;
}
.note {
    padding: 20px 0;
    border-top: 1px solid var(--border);
}
.entry-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 10px;
    margin-bottom: 9px;
}
.entry-meta time {
    color: var(--muted);
}
.notes-list > p {
    font-size: 12px;
}
.history-list {
    padding-left: 18px;
    margin: 23px 0 0;
    list-style: circle;
}
.history-list li {
    padding: 0 0 23px 9px;
    color: var(--green);
}
.history-list strong {
    color: var(--ink);
    font-size: 12px;
}
.history-list p, .history-list small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 18px;
}
.stat-card {
    padding: 25px;
}
.stat-card strong {
    display: block;
    font-size: 37px;
    font-weight: 600;
    margin: 14px 0 6px;
}
.stat-card p {
    color: var(--muted);
    font-size: 11px;
}
.operational-welcome {
    background: var(--green);
    color: white;
    padding: 25px;
    border-radius: 10px;
}
.operational-welcome h2 {
    font-size: 23px;
    margin: 14px 0 10px;
}
.operational-welcome p {
    font-size: 11px;
    color: #c2d6cb;
}
.company-summary {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 13px;
}
.company-summary img {
    width: 40px;
}
.company-summary p {
    font-size: 11px;
    margin-top: 4px;
}
.company-summary > span {
    margin-left: auto;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@media (max-width: 1050px) {
    .filters {
        flex-wrap: wrap;
    }
    .filters .filter-search {
        flex-basis: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .operational-welcome {
        grid-column: 1 / -1;
    }
    .lead-detail-columns {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }
    .page-heading > .button {
        min-height: 42px;
    }
    .filters {
        padding: 18px;
        gap: 12px;
    }
    .filters > div {
        flex-basis: 100%;
        min-width: 0;
    }
    .lead-table, .lead-table tbody, .lead-table tr, .lead-table td {
        display: block;
        width: 100%;
    }
    .lead-table thead {
        display: none;
    }
    .lead-table tr {
        padding: 16px 18px;
        border-bottom: 1px solid var(--border);
    }
    .lead-table tr:last-child {
        border: 0;
    }
    .lead-table td {
        border: 0;
        padding: 7px 0;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 18px;
        text-align: right;
    }
    .lead-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 10px;
        flex-shrink: 0;
    }
    .lead-table .contact-cell {
        display: block;
        position: relative;
        padding-left: 70px;
    }
    .contact-cell::before {
        position: absolute;
        left: 0;
        top: 9px;
    }
    .lead-table .row-actions {
        display: flex;
        justify-content: flex-end;
    }
    .row-actions::before {
        display: none;
    }
    .row-actions a {
        padding: 7px;
        margin: 0;
    }
    .form-grid, .detail-grid {
        grid-template-columns: 1fr;
    }
    .lead-form, .lead-data, .notes-card, .history-card {
        padding: 20px;
    }
    .stats-grid {
        gap: 12px;
    }
    .stat-card {
        padding: 18px;
    }
    .stat-card .eyebrow {
        font-size: 8px;
        letter-spacing: 1px;
    }
    .stat-card strong {
        font-size: 32px;
    }
    .company-summary {
        flex-wrap: wrap;
    }
    .company-summary > span {
        margin-left: 53px;
    }
    .pagination {
        flex-wrap: wrap;
        gap: 14px;
    }
}
