:root {
    --yellow: #d6c70a;
    --green: #38580f;
    --ink: #121212;
    --paper: #fdfcf7;
    --paper-warm: #f6f3e8;
    --white: #ffffff;
    --rule: rgba(18, 18, 18, 0.12);
    --rule-strong: rgba(18, 18, 18, 0.25);

    --status-intake: #6b7280;
    --status-quoted: #2563eb;
    --status-won: #059669;
    --status-in-build: #d6c70a;
    --status-review: #7c3aed;
    --status-revising: #ea580c;
    --status-delivered: #16a34a;
    --status-lost: #9ca3af;
    --status-paused: #92400e;

    --urgency-soon: #ea580c;
    --urgency-overdue: #dc2626;

    --font-display: 'Poppins', system-ui, -apple-system, sans-serif;
    --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--green); }

/* ========== Layout ========== */

.shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
}

.topbar {
    border-bottom: 1px solid var(--rule);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.brand em {
    font-style: normal;
    color: var(--green);
}

.brand-tag {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--green);
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--rule);
}

.timestamp {
    font-size: 12px;
    color: var(--ink);
    opacity: 0.55;
    letter-spacing: 0.04em;
}

/* ========== Page header ========== */

.page-header {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 40px;
}

.page-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 48px;
    letter-spacing: -0.035em;
    line-height: 1;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--ink);
    opacity: 0.6;
    letter-spacing: 0.04em;
}

/* ========== Metrics bar ========== */

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    margin-bottom: 48px;
}

.metric,
.metric-card {
    background: var(--white);
    padding: 24px 28px;
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 12px;
}

.metric-value {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 32px;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ink);
}

.metric-value-sub,
.metric-sub {
    font-size: 13px;
    color: var(--ink);
    opacity: 0.6;
    margin-top: 6px;
}

/* ========== Section headings ========== */

.section {
    margin-bottom: 56px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.section-count {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.55;
}

/* ========== Attention (v1 names) ========== */

.attention {
    background: rgba(220, 38, 38, 0.04);
    border-left: 3px solid var(--urgency-overdue);
    padding: 24px 28px;
    margin-bottom: 48px;
}

.attention-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.005em;
    margin-bottom: 16px;
    color: var(--urgency-overdue);
}

.attention-empty {
    color: var(--green);
    font-weight: 500;
}

.attention-item {
    padding: 12px 0;
    border-top: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.attention-item:first-of-type { border-top: none; padding-top: 0; }

.attention-business {
    font-weight: 600;
    font-size: 14px;
}

.attention-flags {
    font-size: 13px;
    color: var(--ink);
    opacity: 0.75;
    margin-top: 4px;
}

.attention-flag {
    display: block;
    margin-top: 2px;
}

/* ========== Attention (v2 names from pipeline.html Drop 2) ========== */

.attention-block {
    background: rgba(220, 38, 38, 0.04);
    border-left: 3px solid var(--urgency-overdue);
    padding: 24px 28px;
    margin: 32px 0 40px;
    border-radius: 4px;
}

.attention-head {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.005em;
    margin-bottom: 16px;
    color: var(--urgency-overdue);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
}

.attention-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.attention-list li {
    padding: 12px 0;
    border-top: 1px solid var(--rule);
    font-size: 14px;
    line-height: 1.5;
}

.attention-list li:first-child {
    border-top: none;
    padding-top: 0;
}

.attention-list a {
    color: var(--ink);
    font-weight: 600;
}

.attention-list a:hover {
    color: var(--green);
}

.attention-clear {
    background: rgba(56, 88, 15, 0.06);
    border-left: 3px solid var(--green);
    padding: 18px 24px;
    margin: 32px 0 40px;
    border-radius: 4px;
}

.attention-clear strong {
    color: var(--green);
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 4px;
}

.attention-clear p {
    font-size: 13px;
    color: var(--ink);
    opacity: 0.7;
    margin: 0;
}

.flag-item {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 10px;
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
    font-size: 12px;
    font-weight: 500;
    border-radius: 100px;
    vertical-align: middle;
}

/* ========== Project table (v1 name) ========== */

.project-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--rule);
    background: var(--white);
}

.project-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green);
    background: var(--paper-warm);
    border-bottom: 1px solid var(--rule);
}

.project-table td {
    padding: 16px;
    border-bottom: 1px solid var(--rule);
    vertical-align: middle;
}

.project-table tr:last-child td { border-bottom: none; }

.project-table tr {
    transition: background 0.15s ease;
}

.project-table tbody tr:hover {
    background: var(--paper-warm);
    cursor: pointer;
}

.row-business {
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 14px;
}

.row-business a { display: block; }

.row-slug {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink);
    opacity: 0.5;
    margin-top: 2px;
}

.row-platform {
    font-size: 12px;
    color: var(--ink);
    opacity: 0.7;
}

.row-price {
    font-family: var(--font-display);
    font-weight: 500;
    text-align: right;
}

.row-meta {
    font-size: 12px;
    color: var(--ink);
    opacity: 0.6;
}

/* ========== Pipeline table (v2 name from Drop 2) ========== */

.pipeline-block {
    margin: 40px 0;
}

.pipeline-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule);
}

.pipeline-block-head h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 20px;
    letter-spacing: -0.01em;
    margin: 0;
}

.pipeline-block-count {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.55;
}

.pipeline-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--rule);
    background: var(--white);
}

.pipeline-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green);
    background: var(--paper-warm);
    border-bottom: 1px solid var(--rule);
}

.pipeline-table td {
    padding: 16px;
    border-bottom: 1px solid var(--rule);
    vertical-align: middle;
    font-size: 14px;
}

.pipeline-table tr:last-child td { border-bottom: none; }

.pipeline-table tr {
    transition: background 0.15s ease;
}

.pipeline-table tbody tr:hover {
    background: var(--paper-warm);
}

.pipeline-table tbody tr.urgency-soon {
    background: rgba(234, 88, 12, 0.04);
}

.pipeline-table tbody tr.urgency-overdue {
    background: rgba(220, 38, 38, 0.05);
}

.pipeline-table strong {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
}

.pipeline-table a {
    color: var(--ink);
}

.pipeline-table a:hover {
    color: var(--green);
}

.pipeline-row-slug {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink);
    opacity: 0.55;
    margin-top: 4px;
    line-height: 1.4;
}

/* ========== Status pills ========== */

.status-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(0,0,0,0.06);
    color: var(--ink);
}

.status-intake     { background: rgba(107, 114, 128, 0.15); color: #4b5563; }
.status-quoted     { background: rgba(37, 99, 235, 0.12);  color: #1d4ed8; }
.status-won        { background: rgba(5, 150, 105, 0.12);  color: #047857; }
.status-in-build   { background: rgba(214, 199, 10, 0.20); color: #856e00; }
.status-review     { background: rgba(124, 58, 237, 0.12); color: #6d28d9; }
.status-revising   { background: rgba(234, 88, 12, 0.12);  color: #c2410c; }
.status-delivered  { background: rgba(22, 163, 74, 0.12);  color: #15803d; }
.status-lost       { background: rgba(156, 163, 175, 0.20); color: #6b7280; }
.status-paused     { background: rgba(146, 64, 14, 0.12);  color: #92400e; }

/* ========== Progress bar ========== */

.progress {
    width: 120px;
    height: 6px;
    background: var(--rule);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 100px;
    transition: width 0.3s ease;
}

.progress-fill.urgency-soon { background: var(--urgency-soon); }
.progress-fill.urgency-overdue { background: var(--urgency-overdue); }

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--ink);
    opacity: 0.7;
    margin-top: 4px;
}

/* ========== Project detail ========== */

.project-detail .page-header {
    border-bottom: 1px solid var(--rule);
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
}

@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.detail-meta {
    background: var(--paper-warm);
    padding: 24px 28px;
    border: 1px solid var(--rule);
}

.detail-meta dt {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green);
    margin-top: 16px;
}

.detail-meta dt:first-child { margin-top: 0; }

.detail-meta dd {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    margin-top: 4px;
}

.detail-meta dd.muted {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--ink);
    opacity: 0.7;
}

.detail-section {
    margin-bottom: 40px;
}

.detail-section-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.005em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rule);
}

.detail-section ul {
    list-style: none;
    padding: 0;
}

.detail-section li {
    padding: 8px 0 8px 24px;
    position: relative;
    font-size: 14px;
}

.detail-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    width: 12px;
    height: 1px;
    background: var(--green);
}

.draft-card {
    border: 1px solid var(--rule);
    background: var(--white);
    padding: 20px 24px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s ease;
}

.draft-card:hover { border-color: var(--green); }

.draft-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
}

.draft-meta {
    font-size: 12px;
    color: var(--ink);
    opacity: 0.6;
    margin-top: 4px;
}

.activity-list {
    list-style: none;
    font-size: 13px;
}

.activity-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
}

.activity-action {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--green);
}

.activity-detail {
    color: var(--ink);
    opacity: 0.75;
    flex-grow: 1;
    padding-left: 16px;
}

.activity-time {
    font-size: 12px;
    color: var(--ink);
    opacity: 0.5;
}

/* ========== Buttons ========== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--paper) !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn:hover { background: var(--green); }

.btn-secondary {
    background: var(--paper-warm);
    color: var(--ink) !important;
    border: 1px solid var(--rule);
}

.btn-secondary:hover { background: var(--white); border-color: var(--green); }

.btn-success {
    background: #15803d;
}
.btn-success:hover { background: #166534; }

.btn-inline {
    padding: 9px 14px;
    font-size: 11px;
}

/* ========== Empty states ========== */

.empty {
    padding: 40px;
    text-align: center;
    color: var(--ink);
    opacity: 0.5;
    background: var(--white);
    border: 1px dashed var(--rule);
}

/* ========== Draft viewer ========== */

.draft-viewer h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    margin: 32px 0 12px;
}

.draft-viewer .headline-options {
    background: var(--paper-warm);
    padding: 20px 24px;
    border-left: 3px solid var(--yellow);
    margin-bottom: 16px;
}

.draft-viewer .headline-options li {
    list-style: none;
    padding: 6px 0;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 16px;
}

.draft-viewer .body-section {
    background: var(--white);
    border: 1px solid var(--rule);
    padding: 20px 24px;
    margin-bottom: 12px;
}

.draft-viewer .body-section h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
}

.draft-viewer .section-intent {
    font-size: 12px;
    color: var(--green);
    font-style: italic;
    margin-bottom: 12px;
}

.draft-viewer .body-section p {
    margin: 0 0 12px;
}

.draft-viewer .faq-item {
    border-bottom: 1px solid var(--rule);
    padding: 16px 0;
}

.draft-viewer .faq-q {
    font-weight: 600;
    margin-bottom: 6px;
}

.draft-viewer .meta-tags {
    background: var(--paper-warm);
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    border: 1px solid var(--rule);
}

/* ========== Forms + Flash messages ========== */

.flash-container {
    margin: 20px 0;
}

.flash {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-success {
    background: rgba(22, 163, 74, 0.1);
    border-left: 3px solid #15803d;
    color: #15803d;
}

.flash-error {
    background: rgba(220, 38, 38, 0.08);
    border-left: 3px solid #dc2626;
    color: #b91c1c;
}

.flash-info {
    background: rgba(37, 99, 235, 0.08);
    border-left: 3px solid #2563eb;
    color: #1d4ed8;
}

/* ========== Action panel on project page ========== */

.action-panel {
    background: var(--white);
    border: 1px solid var(--rule);
    margin-top: 24px;
}

.action-panel-head {
    background: var(--paper-warm);
    padding: 14px 24px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green);
    border-bottom: 1px solid var(--rule);
}

.action-row {
    padding: 18px 24px;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.action-row:last-child { border-bottom: none; }

.action-row label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.7;
    min-width: 110px;
}

.action-row form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    flex-wrap: wrap;
}

/* ========== Inputs ========== */

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
select,
textarea {
    font-family: var(--font-body);
    font-size: 14px;
    padding: 9px 12px;
    border: 1px solid var(--rule-strong);
    border-radius: 4px;
    background: var(--white);
    color: var(--ink);
    transition: border-color 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--green);
}

input[type="date"],
input[type="time"] {
    min-width: 120px;
}

select {
    min-width: 140px;
    cursor: pointer;
}

textarea {
    width: 100%;
    font-family: var(--font-body);
    line-height: 1.6;
    resize: vertical;
}

/* ========== New project page ========== */

.new-project-form {
    background: var(--white);
    border: 1px solid var(--rule);
    padding: 32px;
    margin-bottom: 40px;
}

.new-project-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 8px;
}

.new-project-help {
    font-size: 13px;
    color: var(--ink);
    opacity: 0.7;
    margin-bottom: 16px;
    line-height: 1.5;
}

.new-project-form .btn {
    margin-top: 16px;
}

.processing-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--ink);
    opacity: 0.6;
    font-style: italic;
}

/* ========== Pipeline page CTA ========== */

.pipeline-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

/* ========== Meeting type radio cards ========== */

.type-label {
    transition: all 0.15s ease;
}

.type-label:hover {
    border-color: var(--green) !important;
    background: var(--paper-warm);
}

.type-label input[type="radio"]:checked + div {
    color: var(--green);
}