:root {
    color-scheme: light;
    --brand-red: #d9232e;
    --brand-red-dark: #a9151f;
    --brand-ink: #191919;
    --brand-nav: #18191b;
    --brand-muted: #68707c;
    --brand-line: #e4e6ea;
    --brand-soft: #f4f5f7;
    --brand-paper: #ffffff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--brand-ink);
    background: var(--brand-soft);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--brand-soft); }
.site-header { min-height: 82px; padding: 0 5vw; background: var(--brand-nav); color: #fff; display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--brand-red); }
.brand-group { display: flex; align-items: center; gap: .8rem; }
.brand-logo { display: block; }
.brand-logo img { display: block; width: 148px; height: 48px; object-fit: contain; border-radius: 6px; background: #fff; padding: 5px 8px; }
.brand-title { color: #fff; font-weight: 700; white-space: nowrap; }
.app-switcher { position: relative; }
.app-switcher summary { color: #fff; cursor: pointer; font-weight: 800; letter-spacing: .03em; list-style: none; white-space: nowrap; }
.app-switcher summary::-webkit-details-marker { display: none; }
.app-switcher summary::after { content: "▾"; margin-left: .45rem; color: #ef9298; }
.app-switcher-menu { position: absolute; z-index: 20; top: calc(100% + .8rem); left: 0; width: 190px; overflow: hidden; border: 1px solid #43474d; border-radius: 8px; background: #24262a; box-shadow: 0 14px 30px rgba(0,0,0,.25); }
.app-switcher-menu a { display: block; padding: .75rem .9rem; color: #fff; text-decoration: none; }
.app-switcher-menu a:hover { background: var(--brand-red); }
.account { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.account form { margin: 0; }
.main-nav { display: flex; align-items: center; gap: .35rem; }
.main-nav a { padding: .55rem .75rem; border-radius: 6px; color: #d5d5d5; text-decoration: none; font-size: .9rem; font-weight: 700; }
.main-nav a:hover, .main-nav a.active { background: var(--brand-red); color: #fff; }
.link-button { border: 0; padding: 0; color: #fff; background: transparent; cursor: pointer; text-decoration: underline; }
.page-shell { width: min(1120px, 90vw); margin: 0 auto; padding: 56px 0; }
.notice { margin: 0 0 1.25rem; padding: .85rem 1rem; border: 1px solid #efb6ba; border-radius: 8px; background: #fff1f2; color: #7f141b; }
.auth-card { width: min(480px, 100%); margin: 5vh auto; padding: 2.5rem; border: 1px solid #dfe5ed; border-radius: 14px; background: #fff; box-shadow: 0 18px 48px rgba(17, 37, 68, .08); }
.form-card { width: min(560px, 100%); margin: 0 auto; padding: 2.5rem; border: 1px solid #dfe5ed; border-radius: 14px; background: #fff; }
.wide-card { width: min(720px, 100%); }
.lead-form-card { width: min(1080px, 100%); }
.lead-form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem 1.25rem; }
.lead-form-grid > div { display: grid; align-content: start; gap: .35rem; }
.danger-card { border-color: #e7b8b8; }
.eyebrow { margin: 0 0 .6rem; color: var(--brand-red-dark); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; color: var(--brand-ink); font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.12; }
.lede { color: #5d6879; line-height: 1.65; }
.form-stack { display: grid; gap: .7rem; margin-top: 1.8rem; }
.form-stack label { margin-top: .5rem; font-size: .9rem; font-weight: 700; }
.form-stack input[type="email"], .form-stack input[type="password"], .form-stack input[type="text"], .form-stack input[type="date"], .form-stack input[type="number"], .form-stack select, .form-stack textarea { width: 100%; padding: .82rem .9rem; border: 1px solid #bec8d5; border-radius: 8px; background: #fff; font: inherit; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus { outline: 3px solid rgba(217, 35, 46, .16); border-color: var(--brand-red); }
.checkbox-row { display: flex; align-items: center; gap: .55rem; font-weight: 500 !important; }
.primary-button { margin-top: .8rem; border: 0; border-radius: 8px; padding: .9rem 1.1rem; background: var(--brand-red); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: var(--brand-red-dark); }
.primary-button.compact { margin: 0; padding: .62rem .82rem; }
.primary-link { display: inline-block; border-radius: 8px; padding: .8rem 1rem; background: var(--brand-red); color: #fff; text-decoration: none; font-weight: 800; white-space: nowrap; }
.primary-link:hover { background: var(--brand-red-dark); }
.secondary-link { color: var(--brand-red-dark); font-weight: 700; text-decoration: none; }
.danger-link { border: 0; padding: 0; background: transparent; color: #a12828; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.danger-button { border: 0; border-radius: 8px; padding: .9rem 1.1rem; background: #a12828; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.danger-text { color: #a12828; }
.field-error { margin: -.2rem 0 .3rem; color: #a12828; font-size: .86rem; }
.validation-summary { margin-top: 1.25rem; padding: .9rem 1rem; border: 1px solid #e1a5aa; border-radius: 8px; background: #fff1f2; color: #7f141b; }
.validation-summary p { margin: .3rem 0 0; font-size: .88rem; }
.field-help { margin: 0; color: #687386; font-size: .85rem; line-height: 1.5; }
.auth-help-link { justify-self: start; margin-top: .35rem; font-size: .88rem; }
.optional { color: #778294; font-weight: 500; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; margin-top: 1.1rem; }
.split-actions { justify-content: space-between; }
.split-actions > div { display: flex; align-items: center; gap: 1rem; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.task-list { display: grid; gap: .8rem; margin-top: 2rem; }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.25rem 1.4rem; border: 1px solid #dfe5ed; border-radius: 10px; background: #fff; }
.task-row h2 { margin: .35rem 0; color: var(--brand-ink); font-size: 1.08rem; }
.task-row p { margin: .3rem 0 0; color: #657084; line-height: 1.5; }
.task-meta { display: flex; gap: .5rem; color: #4f6579; font-size: .78rem; font-weight: 700; }
.task-meta span + span::before { content: "·"; margin-right: .5rem; }
.task-actions { display: flex; align-items: center; gap: .8rem; flex-shrink: 0; }
.task-actions form { margin: 0; }
.empty-state { margin-top: 2rem; padding: 2rem; border: 1px dashed #bdc8d5; border-radius: 10px; background: #fff; text-align: center; }
.empty-state h2 { margin-top: 0; color: var(--brand-ink); }
.filter-bar { display: flex; align-items: flex-end; justify-content: flex-end; gap: .8rem; margin-top: 1.5rem; }
.filter-field { display: grid; gap: .35rem; }
.filter-bar label { color: #5c6879; font-size: .86rem; font-weight: 700; }
.filter-bar select { min-width: 220px; padding: .7rem .8rem; border: 1px solid #bec8d5; border-radius: 7px; background: #fff; font: inherit; }
.lead-filters { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: .7rem; margin-top: 1.5rem; padding: 1rem; border: 1px solid #dfe5ed; border-radius: 10px; background: #fff; }
.lead-filters input, .lead-filters select { min-width: 0; padding: .7rem .75rem; border: 1px solid #bec8d5; border-radius: 7px; background: #fff; font: inherit; }
.lead-filters input[type="search"] { grid-column: span 2; }
.lead-filters .secondary-link { align-self: center; padding: .65rem; }
.secondary-button { border: 1px solid #caa3a6; border-radius: 7px; padding: .68rem .8rem; background: #fff; color: var(--brand-red-dark); font-weight: 700; }
.filter-switcher { display: inline-flex; gap: .25rem; margin-top: 1.5rem; padding: .3rem; border: 1px solid #d7dde5; border-radius: 9px; background: #fff; }
.filter-switcher a { padding: .55rem .8rem; border-radius: 6px; color: #526175; font-size: .84rem; font-weight: 800; text-decoration: none; }
.filter-switcher a:hover { background: #f5f7fa; }
.filter-switcher a.active { background: var(--brand-red); color: #fff; }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.2rem; }
.project-card { padding: 1.35rem; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.project-card-top { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.project-card h2 { margin: 1.1rem 0; font-size: 1.12rem; }
.project-card h2 a { color: var(--brand-ink); text-decoration: none; }
.project-card h2 a:hover { text-decoration: underline; }
.location-label { color: #56687a; font-size: .8rem; font-weight: 800; }
.compact-details { margin: 0; display: grid; gap: .5rem; }
.compact-details div { display: flex; justify-content: space-between; gap: 1rem; }
.compact-details dt { color: #758092; font-size: .8rem; }
.compact-details dd { margin: 0; color: #344257; font-size: .85rem; font-weight: 700; text-align: right; }
.project-table-wrap { margin-top: 1.2rem; overflow-x: auto; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.project-table { width: 100%; min-width: 950px; border-collapse: collapse; }
.project-table th, .project-table td { padding: .9rem 1rem; border-bottom: 1px solid #e7ebf0; text-align: left; vertical-align: middle; }
.project-table thead th { background: #f8fafc; color: #687386; font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.project-table tbody tr:last-child th, .project-table tbody tr:last-child td { border-bottom: 0; }
.project-table tbody tr:hover { background: #fbfcfd; }
.project-table tbody th { min-width: 185px; }
.lead-table { min-width: 1050px; table-layout: fixed; }
.lead-table th, .lead-table td { overflow-wrap: anywhere; }
.lead-table tbody th { min-width: 0; }
.compact-table { min-width: 0; }
.compact-table th, .compact-table td { padding: .75rem .7rem; }
.pagination-wrap { margin-top: 1.2rem; }
.pagination-wrap nav > div:first-child { display: none; }
.pagination-wrap nav > div:last-child { display: flex; justify-content: space-between; gap: 1rem; }
.pagination-wrap a { color: var(--brand-red-dark); }
.project-name-link { display: block; color: #24344b; font-size: .9rem; font-weight: 800; text-decoration: none; }
.project-name-link:hover { color: var(--brand-red-dark); text-decoration: underline; }
.project-table .location-label { display: block; margin-top: .28rem; font-size: .7rem; }
.inline-project-form { margin: 0; }
.status-control, .table-date-input { border: 1px solid #c6d0dc; border-radius: 7px; padding: .55rem .65rem; background: #fff; font: inherit; font-size: .8rem; font-weight: 750; }
.status-control { min-width: 168px; }
.table-date-input { width: 132px; min-width: 132px; }
.status-to-do { border-color: #b8c2cf; background: #f3f5f7; color: #364152; }
.status-in-progress { border-color: #8ab7e8; background: #eaf4ff; color: #155a96; }
.status-waiting-for-feedback { border-color: #d4af62; background: #fff7db; color: #755310; }
.status-on-hold { border-color: #bd9bda; background: #f6edfd; color: #68418a; }
.status-waiting-for-payment { border-color: #6fc0a0; background: #e8f8f1; color: #166d4b; }
.project-url { display: block; max-width: 250px; overflow: hidden; color: var(--brand-red-dark); font-size: .8rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.heading-actions { display: flex; align-items: center; gap: 1rem; }
.detail-card { margin-top: 2rem; padding: 1.5rem; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; margin: 0; }
.detail-grid div { min-width: 0; }
.detail-grid .full-width { grid-column: 1 / -1; }
.detail-grid dt { margin-bottom: .35rem; color: #758092; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.detail-grid dd { margin: 0; color: #28364a; overflow-wrap: anywhere; }
.detail-grid a { color: var(--brand-red-dark); }
.preserve-lines { white-space: pre-line; line-height: 1.6; }
.comments-section { margin-top: 2rem; }
.comments-section h2 { color: var(--brand-ink); }
.comment-form { display: grid; gap: .7rem; padding: 1rem; border: 1px solid #dfe5ed; border-radius: 10px; background: #fff; }
.comment-form textarea { width: 100%; padding: .8rem; border: 1px solid #bec8d5; border-radius: 7px; font: inherit; resize: vertical; }
.comment-form button { justify-self: end; }
.comment-list { display: grid; gap: .7rem; margin-top: .8rem; }
.comment { padding: 1rem; border: 1px solid #e0e5ec; border-left: 3px solid var(--brand-red); border-radius: 0 9px 9px 0; background: #fff; }
.comment > div { display: flex; justify-content: space-between; gap: 1rem; color: #435369; font-size: .82rem; }
.comment time { color: #7a8594; }
.comment p { margin: .65rem 0 0; color: #354154; white-space: pre-line; }
.system-comment { background: #fff7f7; border-color: #e7aeb2; }
.comment-label { display: inline-block; margin-left: .45rem; padding: .18rem .42rem; border-radius: 999px; background: #f7dadd; color: var(--brand-red-dark); font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: #758092; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.dashboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.status-pill { border-radius: 999px; padding: .45rem .8rem; background: #f9e9ea; color: #9c1720; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2.2rem; }
.status-card { padding: 1.5rem; border: 1px solid #dfe5ed; border-radius: 12px; background: #fff; }
.status-card h2 { margin: 1rem 0 .4rem; color: var(--brand-ink); font-size: 1.1rem; }
.status-card p { margin: 0; color: #657084; line-height: 1.55; }
.status-mark { display: inline-grid; width: 2rem; height: 2rem; place-items: center; border-radius: 7px; background: #f9e9ea; color: var(--brand-red-dark); font-weight: 800; }
.dashboard-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
.dashboard-count { display: flex; align-items: center; justify-content: space-between; padding: 1.15rem 1.3rem; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.dashboard-count span { color: #59677a; font-size: .86rem; font-weight: 800; }
.dashboard-count strong { color: var(--brand-ink); font-size: 1.8rem; }
.dashboard-count-overdue { border-color: #e4b5b5; background: #fffafa; }
.dashboard-count-overdue strong { color: #a12828; }
.dashboard-sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.dashboard-section { overflow: hidden; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.dashboard-section header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.15rem; border-bottom: 1px solid #e6eaf0; background: #f8fafc; }
.dashboard-section h2 { margin: 0; color: var(--brand-ink); font-size: 1rem; }
.dashboard-section header span { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; border-radius: 999px; background: #f9e9ea; color: var(--brand-red-dark); font-size: .78rem; font-weight: 800; }
.dashboard-item { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.15rem; border-bottom: 1px solid #edf0f4; color: #24344b; }
.dashboard-item:last-child { border-bottom: 0; }
.dashboard-item:hover { background: #f7fafc; }
.dashboard-item-link { display: grid; flex: 1; min-width: 0; grid-template-columns: auto 1fr; gap: .25rem .65rem; color: inherit; text-decoration: none; }
.dashboard-item-type { grid-row: span 2; align-self: start; border-radius: 5px; padding: .22rem .38rem; background: #f9e9ea; color: var(--brand-red-dark); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.dashboard-item strong { font-size: .88rem; }
.dashboard-item time { color: #758092; font-size: .75rem; }
.dashboard-complete-form { flex: none; margin: 0; }
.dashboard-complete-form label { display: flex; align-items: center; gap: .35rem; color: #526175; cursor: pointer; font-size: .72rem; font-weight: 750; }
.dashboard-complete-form input { width: 1rem; height: 1rem; accent-color: var(--brand-red); cursor: pointer; }
.dashboard-empty { margin: 0; padding: 1.25rem 1.15rem; color: #758092; font-size: .86rem; }
.information-warning { margin-top: 1.5rem; padding: .85rem 1rem; border: 1px solid #e2cf95; border-radius: 8px; background: #fff9e8; color: #6b5520; font-size: .86rem; line-height: 1.5; }
.information-categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.2rem; align-items: start; }
.information-category { overflow: hidden; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.information-category > header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.15rem; border-bottom: 1px solid #e6eaf0; background: #f8fafc; }
.information-category h2 { margin: 0; color: var(--brand-ink); font-size: 1rem; }
.information-category > header span { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; border-radius: 999px; background: #f9e9ea; color: var(--brand-red-dark); font-size: .78rem; font-weight: 800; }
.information-record { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid #edf0f4; color: #24344b; }
.information-record:last-child { border-bottom: 0; }
.information-record:hover { background: #f7fafc; }
.information-record-copy { display: grid; gap: .35rem; min-width: 0; }
.information-record strong { font-size: .9rem; }
.information-record span { color: #687386; font-size: .8rem; line-height: 1.45; }
.information-record-actions { display: flex; align-items: center; gap: .75rem; flex: none; }
.information-record-actions form { margin: 0; }
.delete-information-form { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--brand-line); text-align: right; }
.lead-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.lead-metrics article { display: grid; gap: .5rem; padding: 1.15rem 1.25rem; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.lead-metrics span { color: #687386; font-size: .82rem; font-weight: 700; }
.lead-metrics strong { color: var(--brand-red); font-size: 1.55rem; }
.lead-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.report-card { min-width: 0; padding: 1.2rem; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.report-card h2 { margin: 0; font-size: 1.1rem; }
.report-card .project-table-wrap { margin-top: 1rem; }

@media (max-width: 720px) {
    .site-header { padding: 0 1rem; }
    .brand-logo img { width: 92px; height: 40px; }
    .brand-title { display: none; }
    .app-switcher summary { font-size: .82rem; }
    .site-header { flex-wrap: wrap; gap: .6rem; padding-top: .65rem; padding-bottom: .65rem; }
    .main-nav { order: 3; width: 100%; overflow-x: auto; }
    .account > span { display: none; }
    .page-shell { width: min(92vw, 560px); padding: 32px 0; }
    .auth-card { padding: 1.5rem; }
    .dashboard-heading { display: grid; }
    .card-grid { grid-template-columns: 1fr; }
    .dashboard-counts, .dashboard-sections { grid-template-columns: 1fr; }
    .information-categories { grid-template-columns: 1fr; }
    .project-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .page-heading, .task-row { display: grid; }
    .task-actions { flex-wrap: wrap; }
    .two-columns { grid-template-columns: 1fr; }
    .split-actions { align-items: flex-start; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-switcher { display: grid; grid-template-columns: 1fr 1fr; }
    .filter-switcher a { text-align: center; }
    .heading-actions { align-items: flex-start; flex-direction: column; }
    .lead-form-grid, .lead-metrics, .lead-report-grid { grid-template-columns: 1fr; }
    .lead-filters { grid-template-columns: 1fr; }
    .lead-filters input[type="search"] { grid-column: auto; }
}
