/* =====================================================
   Opdrachten — pipeline-tracker
   Brand: Petrol #3B8E8D · Cream #FBF5E9 · Ochre #B8862F · Espresso #2D2620
   ===================================================== */

:root {
    --color-bg: #fbf5e9;
    --color-primary: #3b8e8d;
    --color-primary-dark: #2f7372;
    --color-primary-soft: #d7e8e7;
    --color-accent: #b8862f;
    --color-ink: #2d2620;
    --color-ink-soft: #5a4f44;
    --color-muted: #8c7e72;
    --color-line: #e8dcc4;
    --color-surface: #ffffff;
    --color-danger: #b13a30;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 3px rgba(45, 38, 32, 0.05);
    --shadow-md: 0 4px 14px rgba(45, 38, 32, 0.10);
    --shadow-lg: 0 16px 40px rgba(45, 38, 32, 0.18);

    --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* ---------- Header ---------- */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 32px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-line);
}
.header-left h1 {
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.75rem; margin: 0;
    letter-spacing: -0.01em;
}
.header-sub {
    margin: 2px 0 0; font-size: 0.85rem; color: var(--color-muted);
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.92rem; font-weight: 600;
    border: 2px solid transparent;
    transition: all .15s;
    text-decoration: none;
    line-height: 1;
}
.btn-primary {
    background: var(--color-primary); color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(59, 142, 141, 0.25);
}
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.btn-ghost {
    background: transparent; color: var(--color-ink);
    border-color: var(--color-line);
}
.btn-ghost:hover { border-color: var(--color-ink); }
.btn-danger {
    background: transparent; color: var(--color-danger);
    border-color: var(--color-danger);
}
.btn-danger:hover { background: var(--color-danger); color: #fff; }

/* ---------- Filters ---------- */
.filters {
    display: flex; gap: 12px;
    padding: 14px 32px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-line);
    flex-wrap: wrap;
}
.filters input, .filters select {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-line);
    background: #fff;
    color: var(--color-ink);
}
.filters input { flex: 1; min-width: 240px; }
.filters input:focus, .filters select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    border-color: var(--color-primary);
}

/* ---------- List ---------- */
.list {
    padding: 24px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.empty {
    grid-column: 1/-1;
    padding: 80px 24px 96px; text-align: center;
    color: var(--color-ink-soft);
}
.empty h2 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.6rem, 3vw + 1rem, 2.2rem);
    margin: 0 0 12px; color: var(--color-ink);
    letter-spacing: -0.01em;
}
.empty p { margin: 0 auto 24px; font-size: 1.05rem; line-height: 1.6; max-width: 48ch; }
.empty .btn { font-size: 1rem; }

/* ---------- Site footer ---------- */
.site-footer {
    padding: 28px 32px 32px;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--color-line);
    margin-top: 32px;
}
.site-footer p { margin: 0; }
.site-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer .dot { margin: 0 8px; color: var(--color-line); }
@media (max-width: 600px) {
    .site-footer .dot { display: block; height: 0; margin: 4px 0; visibility: hidden; }
}

/* ---------- Card ---------- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    display: flex; flex-direction: column; gap: 8px;
    text-align: left;
    width: 100%;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card.is-closed { opacity: 0.7; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card h3 {
    font-family: var(--font-display); font-weight: 600;
    margin: 0; font-size: 1.1rem; line-height: 1.3;
    flex: 1;
}
.card .meta { color: var(--color-ink-soft); font-size: 0.92rem; line-height: 1.4; }
.card .meta strong { color: var(--color-ink); font-weight: 600; }
.card .detail { color: var(--color-ink-soft); font-size: 0.85rem; }
.card .footer {
    color: var(--color-muted); font-size: 0.78rem;
    padding-top: 8px;
    border-top: 1px solid var(--color-line);
    display: flex; justify-content: space-between; align-items: center;
}
.card .progress { color: var(--color-primary); font-weight: 600; }
.card .progress.complete { color: var(--color-ink-soft); }

/* ---------- Status badge ---------- */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    white-space: nowrap;
}
.badge-nieuw      { background: #fdf3d4; color: #8a6c1f; }
.badge-aangemeld  { background: #d7e8e7; color: #2f7372; }
.badge-gesprek    { background: #e6dcf2; color: #5d3c8c; }
.badge-aanbod     { background: #f3e2c1; color: #8a5e1d; }
.badge-gewonnen   { background: #d4eed4; color: #2f7340; }
.badge-afgebroken { background: #f4dcd0; color: #8a4830; }
.badge-afgesloten { background: #ede6dd; color: #5a4f44; }
.badge-hold       { background: #e0d8cf; color: #5a4f44; }

/* ---------- Modal ---------- */
.modal {
    position: fixed; inset: 0;
    background: rgba(45, 38, 32, 0.55);
    display: grid; place-items: center;
    z-index: 100;
    padding: 24px;
    overflow-y: auto;
}
.modal.hidden { display: none; }
.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%; max-width: 640px;
    box-shadow: var(--shadow-lg);
    position: relative;
    margin: 24px 0;
}
.modal-close {
    position: absolute; top: 12px; right: 16px;
    background: transparent; border: 0;
    font-size: 1.8rem; color: var(--color-ink-soft);
    line-height: 1;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--color-bg); color: var(--color-ink); }
.modal h2 {
    font-family: var(--font-display); font-weight: 700;
    margin: 0 0 24px; font-size: 1.5rem;
    letter-spacing: -0.01em;
}
.modal h3 {
    font-family: var(--font-display); font-weight: 600;
    margin: 24px 0 12px;
    font-size: 1.05rem;
    color: var(--color-ink);
}
.modal label {
    display: block; margin-bottom: 14px;
    font-size: 0.82rem; font-weight: 600; color: var(--color-ink-soft);
    letter-spacing: 0.02em;
}
.modal label .req { color: var(--color-danger); }
.modal input, .modal textarea, .modal select {
    display: block; width: 100%; margin-top: 5px;
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-ink);
    font-weight: 400;
    font-family: inherit;
}
.modal textarea { font-family: var(--font-sans); resize: vertical; min-height: 80px; }
.modal input:focus, .modal textarea:focus, .modal select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    border-color: var(--color-primary);
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.row-2 label, .row-3 label { margin-bottom: 14px; }

/* ---------- Actions checklist ---------- */
.actions-section ul {
    border-top: 1px solid var(--color-line);
    margin-bottom: 12px;
}
.actions-section li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--color-line);
}
.actions-section li label {
    margin: 0; flex: 1; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    font-weight: 400; color: var(--color-ink); font-size: 0.95rem;
    text-transform: none; letter-spacing: 0;
}
.actions-section li input[type="checkbox"] {
    width: 18px; height: 18px;
    margin: 0; padding: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.actions-section li input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    color: var(--color-muted);
}
.action-remove {
    background: transparent; border: 0;
    color: var(--color-muted);
    font-size: 1.1rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}
.action-remove:hover { background: var(--color-bg); color: var(--color-danger); }
.action-add {
    display: flex; gap: 8px;
}
.action-add input { flex: 1; margin: 0; }
.action-add button {
    background: var(--color-primary); color: #fff;
    border: 0; border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-weight: 600;
}
.action-add button:hover { background: var(--color-primary-dark); }

/* ---------- Form buttons ---------- */
.form-buttons {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--color-line);
    flex-wrap: wrap;
}
.form-buttons .btn-danger { margin-right: auto; }
.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .header { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 20px; }
    .actions { justify-content: stretch; }
    .actions .btn { flex: 1; }
    .filters { padding: 12px 20px; flex-direction: column; }
    .filters input { min-width: 0; }
    .list { padding: 18px 20px; grid-template-columns: 1fr; }
    .modal-content { padding: 24px 20px; }
    .row-2, .row-3 { grid-template-columns: 1fr; }
    .form-buttons { flex-direction: column-reverse; }
    .form-buttons .btn-danger { margin-right: 0; }
    .form-buttons .btn { width: 100%; }
}
