/* Grawlr Sales — ink, lime, and thick shadows on top of Bootstrap 5. */

:root {
    --ink: #14110e;
    --ink-soft: #2a241c;
    --paper: #fff8ec;
    --lime: #d6ff4a;
    --lime-deep: #b6e000;
    --rose: #ff5d73;
    --line: #14110e;
    --shadow: 6px 6px 0 var(--line);
}

* {
    box-sizing: border-box;
}

body.sales-app {
    margin: 0;
    min-height: 100vh;
    color: #1c1917;
    background: #f4f1ea;
    font-family: "Public Sans", "Segoe UI", sans-serif;
    font-weight: 500;
}

body.page-login {
    background: #f4f1ea;
    color: #1c1917;
}

a {
    color: inherit;
}

.sales-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--ink);
    color: var(--paper);
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 4px solid var(--lime);
}

.sales-mark {
    display: inline-block;
    margin: 0;
    color: var(--paper);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.sales-mark span {
    color: var(--lime);
}

.sales-mark-plain {
    color: var(--ink);
    font-size: 2.4rem;
}

.sales-mark-plain span {
    color: #3f6212;
}

.sales-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sales-nav a {
    color: var(--paper);
    text-decoration: none;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.sales-nav a.is-active,
.sales-nav a:hover {
    background: var(--lime);
    color: var(--ink);
}

.sales-who {
    opacity: 0.8;
    font-size: 0.92rem;
}

.sales-logout,
.sales-btn,
.sales-btn-ghost,
.sales-btn-danger {
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-weight: 700;
    box-shadow: none;
}

.sales-btn,
.sales-logout {
    background: var(--lime);
    color: var(--ink);
}

.sales-btn:hover,
.sales-logout:hover,
.sales-btn-ghost:hover {
    background: var(--lime-deep);
    color: var(--ink);
}

.sales-btn-ghost {
    background: #fff;
    color: var(--ink);
    border-color: #d5d0c8;
}

.sales-btn-danger {
    background: var(--rose);
    color: #fff;
    border-color: transparent;
}

.sales-main {
    padding: 1.25rem;
}

.login-stage {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.login-card,
.setup-card,
.missing-card,
.lead-panel,
.side-block,
.sales-modal {
    background: #fff;
    color: var(--ink);
    border: 1px solid #e6e1d8;
    box-shadow: 0 10px 30px rgba(20, 17, 14, 0.06);
}

.login-card {
    width: min(440px, 100%);
    padding: 1.75rem;
}

.login-kicker,
.lead-kicker {
    margin: 0 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
}

.login-lead {
    margin: 0.4rem 0 1rem;
}

.login-form .form-control,
.sales-app .form-control,
.sales-app .form-select {
    border: 1px solid #d5d0c8;
    border-radius: 0.5rem;
    background-color: #fff;
    font-weight: 500;
}

.sales-app .form-select {
    background-image: var(--bs-form-select-bg-img);
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

.form-alert {
    margin: 0.8rem 0 0;
    padding: 0.55rem 0.7rem;
    background: #ffe1e6;
    border: 2px solid var(--line);
}

.login-form .sales-btn,
.board-toolbar .sales-btn {
    margin-top: 0.4rem;
}

.board-toolbar,
.archive-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.board-toolbar h1,
.archive-head h1,
.lead-panel h1,
.setup-card h1,
.missing-card h1 {
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0;
}

.board-toolbar p,
.archive-head p {
    margin: 0.25rem 0 0;
    max-width: 40rem;
}

.board-scroll {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding: 0.2rem 0.2rem 1.2rem;
    align-items: flex-start;
}

.lane {
    flex: 0 0 280px;
    background: #fff;
    border: 1px solid #e6e1d8;
    border-top: 4px solid var(--lane);
    border-radius: 0.85rem;
    min-height: 70vh;
    box-shadow: 0 8px 20px rgba(20, 17, 14, 0.04);
}

.lane-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.8rem 0.35rem;
}

.lane-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.lane-value {
    margin: 0.15rem 0 0;
    color: #5c5348;
    font-size: 0.82rem;
    font-weight: 700;
}

.board-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 0.85rem;
}

.funnel {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.funnel-stage {
    display: grid;
    grid-template-columns: minmax(12rem, 18rem) 1fr;
    gap: 0.75rem;
    align-items: center;
}

.funnel-copy {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    min-width: 0;
}

.funnel-label,
.funnel-meta {
    font-size: 0.82rem;
    font-weight: 700;
}

.funnel-meta {
    color: #5c5348;
    white-space: nowrap;
}

.funnel-track {
    height: 0.7rem;
    background: #fff;
    border: 1px solid #e6e1d8;
    border-radius: 999px;
    overflow: hidden;
}

.funnel-bar {
    height: 100%;
    border-radius: 999px;
}

.board-stats > div {
    background: #fff;
    border: 1px solid #e6e1d8;
    border-radius: 0.85rem;
    padding: 0.7rem 0.85rem;
}

.stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.stat-label {
    display: block;
    margin-top: 0.15rem;
    color: #5c5348;
    font-size: 0.78rem;
    font-weight: 700;
}

.lead-card.is-last-opened {
    border-color: #1c1917;
    box-shadow: 0 0 0 3px #d6ff4a;
}

.last-opened-flag {
    display: none;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #d6ff4a;
    color: #1c1917;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.lead-card.is-last-opened .last-opened-flag {
    display: inline-block;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    align-items: center;
    padding: 0.45rem 0.6rem;
    background: #fff;
    border: 1px solid #e6e1d8;
    border-radius: 0.7rem;
}

.action-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-weight: 700;
}

.action-extra {
    display: none;
    align-items: center;
    gap: 0.7rem;
}

.action-row.is-open .action-extra {
    display: flex;
}

.action-due {
    width: 11rem;
}

.analysis-panel {
    margin-top: 1rem;
    padding: 1.1rem 1.15rem 1.25rem;
    background: #fff;
    border: 1px solid #e6e1d8;
    border-radius: 1.1rem;
}

.analysis-head h2,
.analysis-grid h3 {
    margin: 0 0 0.35rem;
    font-weight: 800;
}

.analysis-grid h3 {
    font-size: 0.95rem;
}

.analysis-facts p,
.analysis-grid p,
.analysis-grid li {
    margin: 0.25rem 0 0;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.2rem;
    margin-top: 0.9rem;
}

.analysis-tech {
    margin-top: 0.7rem;
}

.lane-count {
    min-width: 1.7rem;
    height: 1.7rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    color: var(--lime);
    font-size: 0.8rem;
}

.lane-cards {
    min-height: 12rem;
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.lead-card,
.archive-row {
    background: #fff;
    border: 1px solid #ece7df;
    border-radius: 0.7rem;
    box-shadow: none;
    padding: 0.75rem 0.8rem;
}

.lead-card {
    cursor: grab;
}

.lead-card:hover {
    border-color: #c9c3b8;
}

.lead-card a,
.archive-row a {
    font-weight: 800;
    text-decoration: none;
}

.lead-contact,
.lead-host,
.archive-row p,
.thread-route,
.side-note,
.analysis-meta {
    margin: 0.15rem 0 0;
    font-size: 0.86rem;
    font-weight: 600;
}

.lead-host,
.thread-route,
.side-note,
.analysis-meta {
    color: #5c5348;
}

.lead-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.55rem;
}

.lead-chips span {
    background: #f3f0e8;
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-size: 0.75rem;
}

.lead-placeholder {
    border: 2px dashed var(--line);
    border-radius: 0.9rem;
    min-height: 4.5rem;
    background: rgba(255, 255, 255, 0.45);
}

.sales-modal .modal-header,
.sales-modal .modal-footer {
    border-color: var(--line);
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.archive-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #faf8f4;
}

.archive-empty,
.thread-empty {
    padding: 1rem;
    border: 2px dashed var(--line);
    border-radius: 0.8rem;
}

.setup-card,
.missing-card {
    max-width: 40rem;
    padding: 1.5rem;
}

.lead-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.lead-panel,
.side-block {
    padding: 1.1rem 1.15rem 1.25rem;
    border-radius: 1.1rem;
}

.lead-side {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.lead-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-top: 1rem;
}

.assign-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.assign-row .form-select {
    flex: 1;
}

.analysis-status {
    display: inline-block;
    margin: 0;
    padding: 0.15rem 0.5rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--lime);
    font-size: 0.8rem;
}

.analysis-score {
    margin: 0.6rem 0 0;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
}

.analysis-link {
    display: inline-block;
    margin-top: 0.4rem;
    font-weight: 800;
}

.thread {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.thread-item {
    border: 2px solid var(--line);
    border-radius: 0.8rem;
    padding: 0.6rem 0.7rem;
    background: #fff;
}

.thread-outbound {
    border-left: 8px solid var(--lime-deep);
}

.thread-inbound {
    border-left: 8px solid #7dd3fc;
}

.thread-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.thread-body {
    white-space: pre-wrap;
    margin: 0.35rem 0 0;
    font-weight: 500;
}

.paste-form {
    margin: 0.75rem 0 1rem;
}

.paste-form .sales-btn {
    margin-top: 0.7rem;
}

.side-block h2 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
}

@media (max-width: 900px) {
    .lead-layout,
    .board-toolbar,
    .archive-head,
    .archive-row,
    .sales-top {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .lane {
        flex-basis: 85vw;
        min-height: 0;
    }

    .board-stats,
    .analysis-grid,
    .funnel-stage {
        grid-template-columns: 1fr;
    }

    .login-card {
        box-shadow: none;
    }
}
