:root {
    --ink: #1d2c35;
    --muted: #5e6d75;
    --muted-2: #6e7d84;
    --line: #e8eceb;
    --paper: #ffffff;
    --canvas: #f4f7f6;
    --navy: #182a35;
    --navy-soft: #233b47;
    --green: #138269;
    --green-dark: #0d6c57;
    --green-pale: #e9f6f1;
    --amber: #ba8338;
    --amber-pale: #fff4df;
    --red: #bd5a5a;
    --red-pale: #fff0ee;
    --blue-pale: #eef5ff;
    --shadow: 0 12px 32px rgba(27, 48, 58, .055);
    font-family: 'Lato', 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { touch-action: manipulation; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 252px; flex-direction: column; padding: 25px 17px 18px; color: #e7eeee; background: var(--navy); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 28px; }
.brand-mark { display: none; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; overflow: hidden; border-radius: 12px; background: #000; box-shadow: none; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { min-width: 0; display: grid; align-items: center; flex: 1; padding: 0; background: transparent; }
.brand-copy .brand-logo { display: block; width: auto; max-width: 56px; height: 56px; object-fit: contain; object-position: left center; border-radius: 14px; }
.brand-copy strong { display: block; font: 800 17px 'Lato', 'Segoe UI', sans-serif; letter-spacing: -.55px; }
.brand-copy small { display: block; margin-top: 2px; color: #9fb1b8; font-size: 10px; letter-spacing: .95px; text-transform: uppercase; }
.nav-label { padding: 13px 12px 9px; color: #82969d; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #c0ced2; font-size: 13px; font-weight: 600; transition: .16s ease; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-nav a.active { color: #fff; background: #263f49; box-shadow: inset 3px 0 #38b899; }
.nav-icon { display: grid; width: 20px; place-items: center; color: #9eb2b6; }
.side-nav a.active .nav-icon { color: #58d1ae; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-spacer { flex: 1; }
.side-help { margin: 14px 3px 18px; padding: 14px 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 13px; background: rgba(255,255,255,.035); }
.side-help strong { display: block; margin-bottom: 5px; color: #edf4f3; font: 700 12px 'Lato', 'Segoe UI', sans-serif; }
.side-help p { margin: 0; color: #98aeb2; font-size: 11px; line-height: 1.55; }
.profile-row { display: flex; align-items: center; gap: 10px; padding: 14px 7px 2px; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #176d5b; background: #d4efe6; font-size: 12px; font-weight: 800; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy strong { display: block; overflow: hidden; color: #edf4f3; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { display: block; overflow: hidden; margin-top: 3px; color: #9aaeb3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 8px; color: #a9bdc0; background: transparent; cursor: pointer; }
.logout-button:hover { color: white; background: rgba(255,255,255,.09); }
.logout-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.main-area { min-height: 100vh; margin-left: 252px; }
.topbar { display: flex; height: 64px; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 clamp(16px, 2.2vw, 28px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); }
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { margin: 0; font: 800 19px 'Lato', 'Segoe UI', sans-serif; letter-spacing: -.55px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.topbar-actions .btn-sm { min-height: 40px; height: 40px; }
.user-edit { border-top: 1px solid #eef1f0; }
.user-edit summary { cursor: pointer; padding: 10px 18px; color: #176d59; font-size: 12px; font-weight: 600; list-style: none; }
.user-edit summary::-webkit-details-marker { display: none; }
.user-edit-panel { display: grid; gap: 12px; padding-top: 4px; }
.user-edit-form .form-actions { margin-top: 8px; }
.pwa-install-btn[hidden],
[data-enable-notifications][hidden] { display: none !important; }
.pwa-notify-card {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid #d9ebe4;
    border-radius: 16px;
    background: linear-gradient(135deg, #edf8f3 0%, #ffffff 52%, #e9f5f0 100%);
    box-shadow: 0 10px 24px rgba(38, 91, 72, .08);
}
.pwa-notify-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
}
.pwa-notify-copy { min-width: 0; flex: 1 1 auto; }
.pwa-notify-copy h3 { margin: 0; font: 600 15px 'Lato', 'Segoe UI', sans-serif; }
.pwa-notify-copy p { margin: 5px 0 0; color: #54646c; font-size: 12px; line-height: 1.5; }
.pwa-notify-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}
.pwa-notify-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 12px;
    white-space: nowrap;
}
.pwa-notify-actions .btn svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.pwa-notify-actions [data-enable-notifications] {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #1aa57f 0%, #138269 48%, #0d6c57 100%);
    box-shadow: 0 8px 18px rgba(19, 130, 105, .28);
}
.pwa-notify-actions [data-enable-notifications]:hover {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #1db388 0%, #149372 48%, #0f7a62 100%);
    box-shadow: 0 10px 20px rgba(19, 130, 105, .34);
    transform: translateY(-1px);
}
@media (max-width: 820px) {
    .pwa-notify-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 12px;
        padding: 14px 15px;
    }
    .pwa-notify-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
    }
    .pwa-notify-actions:has(> :not([hidden]) + :not([hidden])) {
        grid-template-columns: 1fr 1fr;
    }
    .pwa-notify-actions .btn {
        width: 100%;
        min-width: 0;
        padding: 0 10px;
        font-size: 12px;
    }
    .pwa-notify-copy h3 { font-size: 14px; }
    .pwa-notify-copy p { font-size: 11px; }
}
.sidebar-toggle { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.sidebar-toggle:hover { color: var(--green-dark); border-color: #b8ded1; background: #fbfefd; }
.sidebar-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top-search { display: flex; width: min(280px, 29vw); height: 40px; min-height: 40px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-sizing: border-box; }
.top-search-spacer { visibility: hidden; pointer-events: none; border-color: transparent; background: transparent; }
.top-search svg { width: 16px; height: 16px; color: var(--muted-2); fill: none; stroke: currentColor; stroke-width: 1.8; }
.top-search input { width: 100%; padding: 0; border: 0; outline: none; color: var(--ink); font-size: 12px; }
.content { width: min(1440px, 100%); margin: 0 auto; padding: 18px clamp(16px, 2.2vw, 28px) 40px; }
.mobile-menu { display: none; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; cursor: pointer; }
.mobile-menu svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.mobile-back { display: none; }
.mobile-header-logo { display: none; }
.mobile-top-actions,
.mobile-notifications,
.mobile-logout { display: none; }
.mobile-scrim { display: none; }
.show-mobile { display: none; }
.hide-mobile { display: inline; }
.remember-line { display: flex; align-items: center; gap: 8px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.remember-line input { accent-color: var(--green); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 22px; }
.page-heading h2 { margin: 0; font: 800 25px 'Lato', 'Segoe UI', sans-serif; letter-spacing: -.8px; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; color: white; background: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); background: var(--green-dark); box-shadow: 0 5px 14px rgba(19,130,105,.18); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-secondary { color: var(--ink); border-color: var(--line); background: white; }
.btn-secondary:hover { color: var(--green-dark); border-color: #b8ded1; background: #fbfefd; box-shadow: none; }
.btn-quiet { color: var(--muted); border-color: transparent; background: transparent; }
.btn-quiet:hover { color: var(--ink); background: #f3f6f5; box-shadow: none; }
.btn-danger { background: var(--red); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 11px; }
.btn-block { width: 100%; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font: 750 14px 'Lato', 'Segoe UI', sans-serif; letter-spacing: -.2px; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; align-items: stretch; }
.chart-card { display: flex; flex-direction: column; box-sizing: border-box; min-width: 0; min-height: 126px; height: 126px; padding: 12px 14px 10px; overflow: hidden; }
.chart-card .card-head { flex: 0 0 auto; padding: 0; border-bottom: 0; }
.chart-card .card-head h3 { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.chart-card .card-head p { display: none; }
.chart-body { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding: 0; }
.chart-body canvas { display: block; flex: 1 1 auto; width: 100%; min-height: 0; }
.chart-legend { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); flex: 0 0 auto; gap: 0; margin-top: 4px; color: #839097; font-size: 9px; font-weight: 600; line-height: 1.2; text-align: center; }
.chart-legend span { min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.stat-card { position: relative; box-sizing: border-box; min-height: 126px; height: 126px; padding: 18px 19px; overflow: hidden; }
.stat-card::after { position: absolute; right: -22px; bottom: -42px; width: 105px; height: 105px; border-radius: 50%; background: var(--green-pale); content: ''; opacity: .65; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-pale); }
.stat-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.stat-value { position: relative; z-index: 1; margin-top: 15px; font: 800 26px 'Lato', 'Segoe UI', sans-serif; letter-spacing: -1px; }
.stat-note { position: relative; z-index: 1; margin-top: 3px; color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.lead-mobile-list { display: none; }
.project-mobile-list { display: none; }
.dashboard-enquiry-mobile-list { display: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 8px 10px; color: #839097; background: #fbfcfc; font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
td { padding: 9px 10px; border-top: 1px solid #eef1f0; color: #495860; font-size: 11px; vertical-align: middle; }
tbody tr:hover { background: #fcfdfd; }
.table-primary { color: var(--ink); font-size: 12px; font-weight: 700; }
.table-secondary { margin-top: 4px; color: var(--muted); font-size: 10px; }
.table-link:hover .table-primary { color: var(--green); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; color: #537068; background: #edf4f1; font-size: 9px; font-weight: 800; letter-spacing: .15px; text-transform: capitalize; white-space: nowrap; }
.badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ''; }
.badge-new, .badge-contacted { color: #517191; background: #edf4fc; }
.badge-qualified, .badge-scoping, .badge-in_progress { color: #147b62; background: #eaf7f1; }
.badge-proposal_sent, .badge-decision_pending, .badge-review { color: #a16c23; background: #fff5e2; }
.badge-won, .badge-completed, .badge-paid, .badge-accepted { color: #13775f; background: #e5f5ee; }
.badge-lost, .badge-declined, .badge-overdue { color: #b4524d; background: #fff0ee; }
.badge-nurture, .badge-waiting_on_client, .badge-partial { color: #745b9e; background: #f2effb; }
.badge-not_started, .badge-unpaid, .badge-draft { color: #66737b; background: #f0f3f4; }
.due-list { display: grid; }
.due-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #eef1f0; }
.due-item:last-child { border-bottom: 0; }
.due-date { display: grid; width: 43px; height: 46px; flex: 0 0 auto; align-content: center; justify-items: center; border-radius: 10px; color: var(--green-dark); background: var(--green-pale); }
.due-date strong { font: 800 14px 'Lato', 'Segoe UI', sans-serif; }
.due-date small { margin-top: 1px; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.due-copy { min-width: 0; flex: 1; }
.due-copy strong { display: block; overflow: hidden; margin: 2px 0 4px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.due-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.due-copy .late { color: var(--red); font-weight: 700; }
.empty-state { padding: 32px 22px; text-align: center; }
.empty-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 11px; place-items: center; border-radius: 14px; color: var(--green); background: var(--green-pale); }
.empty-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.empty-state h3 { margin: 0; font: 750 13px 'Lato', 'Segoe UI', sans-serif; }
.empty-state p { max-width: 280px; margin: 6px auto 15px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.inline-link { color: var(--green); font-size: 11px; font-weight: 700; }
.inline-link:hover { color: var(--green-dark); text-decoration: underline; }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.text-small { font-size: 10px; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-form { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.input, .select, .textarea { width: 100%; min-height: 40px; padding: 10px 12px; border: 1px solid #dfe6e3; border-radius: 8px; outline: none; color: var(--ink); background: #fff; font-size: 12px; transition: .15s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: #75bda5; box-shadow: 0 0 0 3px rgba(19,130,105,.1); }
.input::placeholder, .textarea::placeholder { color: #a2acb0; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.filter-form .input,
.filter-form .filter-search { flex: 1 1 420px; width: auto; min-width: 260px; max-width: none; }
.filter-form .select { width: auto; min-width: 150px; flex: 0 0 auto; }
.leads-card-head { gap: 10px; }
.leads-card-head .filter-form { width: 100%; }
.leads-index-table { min-width: 980px; }
.leads-index-table td,
.leads-index-table th { padding-right: 8px; padding-left: 8px; }
.leads-index-table .table-primary,
.leads-index-table .table-secondary { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; align-content: start; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #53616a; font-size: 11px; font-weight: 700; }
.field .hint { margin-top: -2px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.proposal-create-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.proposal-create-tools {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.proposal-create-tools .btn {
    position: relative;
    display: inline-flex;
    min-width: 44px;
    align-items: center;
    gap: 7px;
}
.proposal-create-tools .btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.proposal-live-preview-dialog {
    position: fixed;
    width: min(760px, calc(100% - 24px));
    max-width: none;
    max-height: min(92vh, 900px);
    padding: 18px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    background: #f4f7f6;
    box-shadow: 0 24px 80px rgba(17, 35, 43, .24);
}
.proposal-live-preview-dialog::backdrop { background: rgba(17, 35, 43, .45); }
.proposal-live-preview-dialog:not([open]) { display: none; }
.proposal-live-preview-close-form { position: absolute; top: 12px; right: 12px; }
.proposal-live-preview-head { padding-right: 40px; margin-bottom: 12px; }
.proposal-live-preview-head h2 { margin: 0; font-size: 20px; }
.proposal-live-preview-body { min-width: 0; }
.proposal-live-preview-body .proposal-sheet { margin: 0; }
.proposal-live-preview-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.proposal-send-dialog {
    position: fixed;
    width: min(460px, calc(100% - 24px));
    max-width: none;
    max-height: min(90vh, 640px);
    padding: 22px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 24px 80px rgba(17, 35, 43, .24);
}
.proposal-send-dialog::backdrop { background: rgba(17, 35, 43, .45); }
.proposal-send-dialog:not([open]) { display: none; }
.proposal-send-close-form { position: absolute; top: 12px; right: 12px; }
.proposal-send-heading { padding-right: 36px; }
.proposal-send-heading h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.proposal-send-intro { margin: 10px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.proposal-send-options { display: grid; gap: 10px; }
.proposal-send-option {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    justify-content: start !important;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 12px 14px !important;
    text-align: left;
}
.proposal-send-option svg {
    width: 22px;
    height: 22px;
    justify-self: center;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.proposal-send-option span { display: grid; gap: 3px; min-width: 0; }
.proposal-send-option strong { font-size: 14px; line-height: 1.3; }
.proposal-send-option small { color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.proposal-send-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.swipe-row {
    position: relative;
    overflow: hidden;
    border-top: 1px solid #eef1f0;
}
.lead-proposals-card .swipe-row:first-of-type,
.lead-proposals-card .card-head + .swipe-row,
.dashboard-enquiry-mobile-list .swipe-row:first-child,
.lead-mobile-list .swipe-row:first-child,
.project-mobile-list .swipe-row:first-child,
.follow-ups-scheduled-stack .follow-up-swipe { border-top: 0; }
.swipe-row-actions {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 0;
    display: none;
    width: 88px;
    align-items: stretch;
    justify-content: stretch;
    background: var(--red);
}
.swipe-row-actions form,
.swipe-delete-btn {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.swipe-row-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    transition: transform .18s ease;
    touch-action: pan-y;
}
a.swipe-row-content {
    color: inherit;
    text-decoration: none;
}
.swipe-row-link {
    min-width: 0;
    flex: 1;
    color: inherit;
    text-decoration: none;
}
.swipe-row-link strong,
.swipe-row-link small { display: block; }
.swipe-delete-desktop,
.proposal-delete-desktop { display: inline-flex; flex: 0 0 auto; }
.swipe-delete-desktop .btn,
.proposal-delete-desktop .btn { color: var(--red); border-color: #f0d4d0; background: #fff7f6; }
.swipe-delete-desktop .btn:hover,
.proposal-delete-desktop .btn:hover { color: #fff; border-color: var(--red); background: var(--red); }
.table-actions { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.proposal-actions form { margin: 0; }
.proposal-delete-btn { color: var(--red) !important; }
.form-section-title { grid-column: 1 / -1; margin: 7px 0 -4px; padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--green-dark); font: 800 11px 'Lato', 'Segoe UI', sans-serif; letter-spacing: .7px; text-transform: uppercase; }
.required { color: var(--red); }
.error { color: var(--red); font-size: 10px; }
.form-note { padding: 11px 13px; border: 1px solid #d9ece5; border-radius: 9px; color: #4d6e63; background: #f4fbf8; font-size: 11px; line-height: 1.55; }
.notice { margin-bottom: 17px; padding: 12px 15px; border: 1px solid #cfe9dc; border-radius: 9px; color: #216d56; background: #eefaf4; font-size: 12px; }
.notice-error { border-color: #f0d1ce; color: #a24843; background: #fff4f2; }
.notice-trial { border-color: #ead7a8; color: #8a641f; background: #fff8e8; }
.platform-account-row { flex-wrap: wrap; align-items: flex-start; }
.platform-account-row .list-row-copy { flex: 1 1 220px; }
.platform-account-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.notice ul { margin: 5px 0 0; padding-left: 17px; }
.page-shell { max-width: 900px; margin: 0 auto; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .8fr); gap: 16px; align-items: start; }
.todos-layout {
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.todos-side {
    display: grid;
    gap: 16px;
    align-content: start;
    min-width: 0;
}
.todo-compose-card {
    width: 100%;
    max-width: 440px;
}
.todo-compose-form .field { margin-top: 12px; min-width: 0; }
.todo-compose-form .field:first-child { margin-top: 0; }
.todo-compose-form .split-fields { margin-top: 0; }
.todo-compose-form .split-fields .field { margin-top: 12px; min-width: 0; }
.todo-compose-form .input,
.todo-compose-form .select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.todo-compose-form input[type="datetime-local"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.todo-compose-form input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}
.todo-calendar-option {
    margin-top: 14px;
    color: #53636b;
    font-size: 13px;
}
.todo-compose-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 16px;
}
.todo-compose-actions .btn {
    min-width: 168px;
    width: auto;
}
.todo-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.lead-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 18px 20px;
    border: 1px solid #d9ebe4;
    border-radius: 16px;
    background: linear-gradient(135deg, #edf8f3 0%, #ffffff 52%, #e9f5f0 100%);
    box-shadow: 0 10px 24px rgba(38, 91, 72, .08);
}
.lead-hero-main { display: grid; min-width: 0; flex: 1; gap: 10px; }
.lead-identity { display: flex; align-items: center; gap: 14px; }
.lead-identity-copy { min-width: 0; flex: 1; }
.lead-hero-actions { display: grid; justify-items: end; align-content: center; gap: 8px; flex: 0 0 auto; }
.lead-source-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #cfe6dc;
    border-radius: 999px;
    color: #176d59;
    background: rgba(255, 255, 255, .72);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    text-transform: capitalize;
}
.lead-source-action svg { display: block; width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; shape-rendering: geometricPrecision; }
.lead-source-label { line-height: 1; white-space: nowrap; }
.lead-avatar {
    display: grid;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #c9e8dc;
    border-radius: 15px;
    color: #16765f;
    background: linear-gradient(145deg, #e7f6ef, #cceadd);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
    font: 800 17px 'Lato', 'Segoe UI', sans-serif;
}
.lead-identity h2 { margin: 0; font: 800 22px 'Lato', 'Segoe UI', sans-serif; letter-spacing: -.7px; }
.lead-identity p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.lead-contact-line { display: block; margin-top: 3px; color: #176d59; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; text-decoration: none; }
.lead-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.contact-item small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .75px; text-transform: uppercase; }
.contact-item strong { font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 0 0 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before { position: absolute; top: 17px; bottom: -1px; left: 7px; width: 1px; background: #e3ebe8; content: ''; }
.timeline-dot { position: relative; z-index: 1; width: 15px; height: 15px; margin-top: 2px; border: 4px solid #d7f0e7; border-radius: 50%; background: var(--green); }
.timeline-copy strong { display: block; font-size: 11px; }
.timeline-copy p { margin: 4px 0 0; color: #66757c; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.timeline-copy small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.follow-ups-grid { align-items: start; }
.follow-ups-scheduled-stack,
.follow-ups-completed-stack { display: grid; gap: 12px; min-width: 0; align-content: start; }
.follow-ups-section-head {
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 0 2px;
}
.follow-ups-section-head h3 {
    margin: 0;
    color: var(--ink);
    font: 800 15px 'Lato', 'Segoe UI', sans-serif;
    letter-spacing: -.2px;
}
.follow-up-swipe {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
}
.follow-up-swipe .swipe-row-content.follow-up-item-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    background: var(--paper);
}
.follow-up-item-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding: 16px 18px;
}
.follow-up-item-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.follow-up-item-title {
    margin: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.follow-up-item-copy > small,
.follow-up-item-meta {
    display: block;
    color: #5e6d75;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.follow-up-item-copy .inline-link { color: var(--green-dark); font-weight: 600; }
.follow-up-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
    flex: 0 0 auto;
}
.follow-up-item-actions .badge {
    justify-content: center;
    white-space: nowrap;
}
.follow-up-form { display: grid; gap: 11px; }
.follow-up-outcome {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    border-top: 1px solid var(--line);
}
.follow-up-outcome-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    min-height: 46px;
    gap: 12px;
    padding: 0 18px;
    box-sizing: border-box;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    background: #f7fbf9;
}
.follow-up-outcome-toggle span {
    min-width: 0;
}
.follow-up-outcome-toggle svg {
    width: 18px;
    height: 18px;
    justify-self: end;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .18s ease;
}
.follow-up-outcome[open] .follow-up-outcome-toggle {
    border-bottom: 1px solid var(--line);
}
.follow-up-outcome[open] .follow-up-outcome-toggle svg {
    transform: rotate(180deg);
}
.follow-up-outcome-toggle::-webkit-details-marker { display: none; }
.follow-up-outcome-form {
    display: grid;
    margin: 0;
    padding: 16px 18px 18px;
    border: 0;
    border-radius: 0;
    background: #fff;
    gap: 12px;
}
.follow-up-outcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.follow-up-outcome-form .field { min-width: 0; }
.follow-up-outcome-form .field label { color: #3f5159; font-size: 12px; font-weight: 700; }
.follow-up-outcome-form .input,
.follow-up-outcome-form .select,
.follow-up-outcome-form .textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.follow-up-outcome-form input[type="datetime-local"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.follow-up-outcome-form .btn { width: 100%; min-height: 44px; }
.follow-ups-completed-card .card-head { display: none; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.divider { height: 1px; margin: 17px 0; background: var(--line); }
.section-gap { margin-top: 18px; }
.stage-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 16px; }
.lead-opportunity-card .stage-form { margin-top: 16px; padding: 0; border: 0; background: transparent; }
.stage-form > label { grid-column: 1 / -1; }
.stage-form .select { grid-column: 1; width: 100%; min-width: 0; }
.stage-form .btn-stage-confirm { grid-column: 2; justify-self: end; }
.stage-form .stage-lost-reason { grid-column: 1 / -1; }
.stage-form .stage-lost-reason[hidden] { display: none !important; }
.stage-form .stage-lost-reason .input { width: 100%; }
.btn.btn-stage-confirm { display: inline-grid; width: 40px; min-width: 40px; height: 40px; min-height: 40px; flex: 0 0 40px; place-items: center; gap: 0; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--green); box-shadow: 0 6px 14px rgba(19, 130, 105, .22); }
.btn.btn-stage-confirm:hover { color: #fff; transform: translateY(-1px); background: var(--green-dark); box-shadow: 0 8px 18px rgba(19, 130, 105, .28); }
.btn.btn-stage-confirm svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.callout { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border-radius: 9px; color: #805e29; background: var(--amber-pale); font-size: 10px; line-height: 1.55; }
.callout svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 18px; border-top: 1px solid #eef1f0; }
.list-row:first-child { border-top: 0; }
.list-row-copy { min-width: 0; }
.list-row-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.list-row-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.project-milestone-form {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) 40px;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-width: 280px;
}
.project-milestone-form .select {
    grid-column: auto;
    width: 100%;
    min-width: 0;
}
.project-milestone-form .project-milestone-save {
    display: grid;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--green);
    box-shadow: 0 4px 11px rgba(19, 130, 105, .2);
}
.project-milestone-form .project-milestone-save svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.project-milestones-card .list-row-copy .badge { margin-top: 7px; }
.progress-track { width: 75px; height: 5px; overflow: hidden; border-radius: 5px; background: #edf0ef; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--green); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proposal-sheet { max-width: 760px; margin: 0 auto; padding: clamp(24px, 5vw, 56px); border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); }
.proposal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.proposal-brand-block { display: grid; gap: 6px; margin-bottom: 8px; }
.proposal-logo { display: block; width: auto; max-width: min(220px, 55vw); max-height: 56px; object-fit: contain; object-position: left center; }
.proposal-brand { color: var(--green-dark); font: 800 12px 'Lato', 'Segoe UI', sans-serif; letter-spacing: 1.4px; text-transform: uppercase; }
.proposal-brand-meta { display: grid; gap: 2px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.proposal-brand-meta span { display: block; }
.settings-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.settings-fieldset:disabled { opacity: .78; }
.settings-logo-preview { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfc; }
.settings-logo-preview img { display: block; width: auto; max-width: 180px; max-height: 56px; object-fit: contain; }
.settings-logo-input { padding: 10px 12px; }
.turnstile-field { margin: 4px 0 14px; min-height: 65px; }
.settings-check { display: flex; align-items: center; gap: 9px; margin-top: 12px; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.settings-check input { width: 16px; height: 16px; accent-color: var(--green); }
.settings-check-danger { color: var(--red); }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.proposal-number { margin-top: 6px; color: var(--muted); font-size: 10px; }
.proposal-intro { margin-top: 27px; }
.proposal-intro .eyebrow { margin-bottom: 10px; }
.proposal-sheet h1 { margin: 0 0 8px; font: 800 27px 'Lato', 'Segoe UI', sans-serif; letter-spacing: -.8px; }
.proposal-sheet .proposal-summary { margin: 0; color: #66757c; font-size: 12px; line-height: 1.7; }
.proposal-meta { margin: 23px 0 21px; }
.proposal-scope-label { display: none; }
.proposal-terms { margin-top: 25px; }
.proposal-terms .divider { margin-bottom: 18px; }
.proposal-decision-card { max-width: 760px; margin: 16px auto 0; }
.proposal-items table { table-layout: fixed; }
.proposal-items th:nth-child(1),
.proposal-items td.proposal-item-desc { width: 52%; }
.proposal-items th:nth-child(2),
.proposal-items td.proposal-item-meta { width: 28%; }
.proposal-items th:nth-child(3),
.proposal-items td.proposal-item-amount { width: 20%; }
.proposal-items td.proposal-item-meta { color: #65737b; white-space: nowrap; }
.line-item-list { display: grid; gap: 9px; }
.line-item { display: grid; grid-template-columns: minmax(0, 1fr) 100px 130px 30px; gap: 8px; align-items: center; }
.line-item .input { min-width: 0; }
.line-item .remove-row { width: 30px; height: 34px; border: 0; border-radius: 7px; color: var(--red); background: var(--red-pale); cursor: pointer; }
.line-item-header { display: grid; grid-template-columns: minmax(0, 1fr) 100px 130px 30px; gap: 8px; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.proposal-total { width: min(100%, 300px); margin: 15px 0 0 auto; }
.total-row { display: flex; justify-content: space-between; gap: 15px; padding: 7px 0; color: #65737b; font-size: 11px; }
.total-row.grand { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); font: 800 16px 'Lato', 'Segoe UI', sans-serif; }
.proposal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.proposal-actions,
.proposal-status-actions,
.proposal-tools { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.proposal-actions-start { flex: 0 0 auto; }
.proposal-actions-end { margin-left: auto; }
.proposal-actions .btn,
.proposal-status-actions .btn { flex: 0 0 auto; }
.proposal-status-actions { width: 100%; }
.proposal-status-actions form { display: contents; }
.public-page { min-height: 100vh; padding: 32px 18px; background: #f3f7f5; }
.public-page .proposal-sheet { margin: 10px auto; }
.team-code { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border: 1px dashed #badacf; border-radius: 9px; color: var(--green-dark); background: #f2faf6; font: 700 13px 'Lato', 'Segoe UI', sans-serif; letter-spacing: 1px; }
.pagination { display: flex; justify-content: center; gap: 5px; padding: 16px; }
.pagination a, .pagination span { display: grid; min-width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: #617079; background: white; font-size: 10px; }
.pagination .active { color: white; border-color: var(--green); background: var(--green); }
html.auth-html,
html.auth-html body.auth-page {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}
body.auth-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    color: var(--ink);
    background: #f4f7f6;
    touch-action: manipulation;
}
.auth-shell {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background-color: #f4f7f6;
    background-image: url('../images/auth-bg.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}
.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, .9fr);
    gap: clamp(20px, 3vw, 40px);
    align-items: center;
    height: 100%;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 18px 0;
} 
.auth-showcase {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    color: #fff;
}
.auth-showcase-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    margin: 0 auto;
    color: #fff;
    text-decoration: none;
}
.auth-showcase-brand img {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}
.auth-showcase-brand span {
    color: #fff;
    font: 800 28px/1 'Lato', 'Segoe UI', sans-serif;
    letter-spacing: -.4px;
}
.auth-showcase-copy {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: 100%;
    max-width: 560px;
    flex: 0 0 auto;
    text-align: center;
}
.auth-devices {
    width: min(100%, 560px);
    margin: 0;
    min-height: 0;
}
.auth-devices img {
    display: block;
    width: 100%;
    max-height: min(320px, 38vh);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 18px 32px rgba(8, 48, 40, .26));
}
.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(8, 68, 55, .55);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
}
.auth-badge svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.auth-showcase-copy h1 {
    margin: 0;
    max-width: 14em;
    font: 700 clamp(22px, 2.6vw, 32px)/1.2 'Lato', 'Segoe UI', sans-serif;
    letter-spacing: -.4px;
    text-align: center;
}
.auth-showcase-copy p {
    max-width: 460px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .84);
    font-size: 14px;
    line-height: 1.55;
}
.auth-panel {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
}
.auth-mobile-stack {
    width: min(420px, 100%);
    max-height: 100%;
    min-height: 0;
}
.auth-hero-mobile { display: none; }
.auth-brand-mobile { display: none; }
.auth-card {
    width: 100%;
    max-height: 100%;
    padding: 22px 24px 18px;
    overflow: auto;
    border: 1px solid rgba(232, 236, 235, .95);
    border-radius: 20px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 60px rgba(17, 45, 38, .12);
    backdrop-filter: blur(10px);
}
.auth-card-head { margin-bottom: 14px; }
.auth-card-head h2 {
    margin: 0;
    color: #1d2c35;
    font: 800 23px/1.2 'Lato', 'Segoe UI', sans-serif;
    letter-spacing: -.5px;
}
.auth-card-head p {
    margin: 6px 0 0;
    color: #5e6d75;
    font-size: 12px;
    line-height: 1.45;
}
.auth-form .field { margin-top: 10px; }
.auth-form > .field:first-child { margin-top: 0; }
.auth-form .field > label { display: none; }
.auth-input { position: relative; }
.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    display: grid;
    place-items: center;
    color: #8a989f;
    transform: translateY(-50%);
    pointer-events: none;
}
.auth-input-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.auth-form .input,
.auth-form .select {
    min-height: 42px;
    padding: 9px 12px 9px 38px;
    border: 1px solid #e4ebe8;
    border-radius: 11px;
    color: #243640;
    background: #f7faf8;
    box-shadow: none;
}
.auth-form .select {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 40px 9px 12px;
    background-color: #f7faf8;
    background-position: right 12px center;
    background-size: 16px;
}
.auth-form .input:hover,
.auth-form .select:hover { border-color: #d0ddd6; background-color: #f3f8f5; }
.auth-form .input:focus,
.auth-form .select:focus {
    border-color: #8fc9b4;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(19, 130, 105, .12);
}
.auth-form .select:invalid,
.auth-form .select option[value=""] { color: #8a989f; }
.password-field { position: relative; }
.password-field .input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    color: #7a8991;
    background: transparent;
    cursor: pointer;
}
.password-toggle:hover { color: var(--green-dark); background: #eef6f2; }
.password-toggle:focus-visible { outline: 2px solid rgba(19,130,105,.35); outline-offset: 1px; }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }
.auth-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}
.auth-form .remember-line { margin-top: 0; color: #5e6d75; font-size: 12px; }
.auth-forgot {
    color: #01814f;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.auth-company-row,
.auth-pass-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}
.auth-company-row .field,
.auth-pass-row .field { min-width: 0; }
.auth-company-row .field { margin-top: 0; }
.auth-pass-row .field,
.auth-form .auth-pass-row > .field:first-child { margin-top: 10px; }
.auth-pass-row .auth-input-icon { display: none; }
.auth-pass-row .password-field .input {
    padding-left: 12px;
    padding-right: 42px;
}
.auth-company-row .select,
.auth-pass-row .input {
    width: 100%;
    min-width: 0;
}
.auth-submit {
    margin-top: 14px;
    min-height: 44px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #1aa57f 0%, #138269 52%, #0d6c57 100%);
    box-shadow: 0 10px 22px rgba(19, 130, 105, .28);
    font-size: 13px;
}
.auth-submit:hover {
    background: linear-gradient(135deg, #1db388 0%, #149372 52%, #0f7a62 100%);
    box-shadow: 0 12px 24px rgba(19, 130, 105, .34);
}
.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 12px 0 10px;
    color: #8a989f;
    font-size: 11px;
    font-weight: 700;
    text-transform: lowercase;
}
.auth-divider::before,
.auth-divider::after {
    height: 1px;
    background: #e6ece9;
    content: '';
}
.auth-secondary {
    min-height: 42px;
    border-radius: 11px;
    color: #33454e;
    border-color: #dde5e1;
    background: #fff;
    font-size: 12px;
}
.auth-secondary:hover {
    color: var(--green-dark);
    border-color: #b8ded1;
    background: #fbfefd;
}
.auth-secondary svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.auth-foot {
    margin: 12px 0 0;
    color: #5e6d75;
    font-size: 12px;
    text-align: center;
}
@media (min-width: 821px) and (max-height: 820px) {
    .auth-showcase-copy h1 { font-size: 28px; }
    .auth-showcase-copy p { font-size: 13px; }
    .auth-devices img { max-height: min(240px, 30vh); }
    .auth-card { padding: 18px 20px 14px; }
    .auth-card-head { margin-bottom: 10px; }
    .auth-card-head h2 { font-size: 21px; }
    .auth-form .field { margin-top: 8px; }
    .auth-pass-row .field { margin-top: 8px; }
    .auth-form .input,
    .auth-form .select { min-height: 38px; }
    .auth-submit { min-height: 40px; margin-top: 12px; }
    .auth-secondary { min-height: 38px; }
}
@media (min-width: 821px) and (max-height: 700px) {
    .auth-devices { display: none; }
}
.auth-foot a { color: var(--green); font-weight: 700; }
.auth-hint { display: block; margin-top: 6px; color: #718087; font-size: 11px; line-height: 1.4; }
.print-only { display: none; }
details summary::marker { color: var(--green); }

.btn.is-loading {
    position: relative !important;
    color: transparent !important;
    border-color: transparent !important;
    background: var(--green) !important;
    box-shadow: 0 8px 18px rgba(19, 130, 105, .28) !important;
    cursor: wait;
    pointer-events: none;
    transform: none !important;
}
.btn.is-loading > *:not(.btn-spinner) {
    opacity: 0 !important;
    visibility: hidden !important;
}
.btn.is-loading:disabled,
.btn:disabled.is-loading { cursor: wait; opacity: 1; }
.btn:disabled { cursor: wait; }
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin .65s linear infinite;
}
.btn.is-loading > .btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    margin-top: -8px;
    margin-left: -8px;
    opacity: 1 !important;
    visibility: visible !important;
    color: #fff;
}
.page-heading .btn-icon-circle.is-loading,
.lead-actions .btn.is-loading,
.proposal-status-actions .btn.is-loading {
    color: transparent !important;
    background: var(--green) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 18px rgba(19, 130, 105, .22) !important;
}
.page-heading .btn-icon-circle.is-loading > .btn-spinner,
.lead-actions .btn.is-loading > .btn-spinner,
.proposal-status-actions .btn.is-loading > .btn-spinner {
    width: 18px;
    height: 18px;
    margin-top: -9px;
    margin-left: -9px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.whatsapp-dialog { position: fixed; width: min(520px, calc(100% - 28px)); max-width: none; max-height: min(90vh, 760px); padding: 25px; overflow-y: auto; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(17, 35, 43, .24); }
.confirm-dialog {
    position: fixed;
    inset: 0;
    width: min(380px, calc(100% - 32px));
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 14px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: var(--shadow), 0 24px 80px rgba(17, 35, 43, .22);
    outline: none;
}
.confirm-dialog-body { padding: 22px 22px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.confirm-dialog-body h2 { margin: 0; font: 750 17px/1.25 'Lato', 'Segoe UI', sans-serif; letter-spacing: -.2px; }
.confirm-dialog-body p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 18px; }
.confirm-dialog-actions form { margin: 0; }
.whatsapp-dialog::backdrop,
.confirm-dialog::backdrop { background: rgba(17, 35, 43, .56); backdrop-filter: blur(3px); }
.whatsapp-dialog:not([open]),
.confirm-dialog:not([open]) { display: none; }
.whatsapp-dialog-close-form { position: absolute; top: 12px; right: 12px; }
.whatsapp-dialog-close { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 23px; line-height: 1; cursor: pointer; }
.whatsapp-dialog-heading { display: flex; align-items: center; gap: 13px; padding-right: 27px; }
.whatsapp-dialog-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: var(--green-dark); background: var(--green-pale); font-size: 21px; font-weight: 700; }
.whatsapp-dialog-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
.whatsapp-dialog-heading h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.whatsapp-dialog-intro { margin: 14px 0 19px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.whatsapp-dialog .field { margin-top: 14px; }
.whatsapp-dialog .field label { display: block; margin-bottom: 6px; }
.whatsapp-dialog .textarea { width: 100%; min-height: 165px; resize: vertical; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; line-height: 1.65; }
.whatsapp-dialog .textarea:focus, .whatsapp-dialog .input:focus { border-color: #8acdb7; outline: 3px solid rgba(19, 130, 105, .1); }
.whatsapp-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
@media (max-width: 620px) {
    .whatsapp-dialog { padding: 21px 17px; border-radius: 15px; }
    .whatsapp-dialog-heading h2 { font-size: 18px; }
    .whatsapp-dialog-actions .btn { flex: 1; padding: 0 10px; }
    .confirm-dialog { width: min(360px, calc(100% - 28px)); border-radius: 14px; }
    .confirm-dialog-body { padding: 18px 16px 16px; }
    .confirm-dialog-actions .btn { flex: 1; padding: 0 10px; }
    .confirm-dialog-actions form { flex: 1; display: flex; }
    .confirm-dialog-actions form .btn { width: 100%; }
}

@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .charts-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .auth-layout { width: min(100% - 36px, 980px); grid-template-columns: minmax(0, 1fr) minmax(340px, .95fr); }
    .auth-showcase-copy h1 { font-size: clamp(26px, 3.4vw, 36px); }
}
@media (max-width: 820px) {
    .sidebar { width: 260px; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 12px 0 35px rgba(13,32,41,.18); }
    .sidebar.open { transform: translateX(0); }
    .mobile-scrim { position: fixed; inset: 0; z-index: 20; display: block; visibility: hidden; background: rgba(17,35,43,.42); opacity: 0; transition: .2s ease; }
    .mobile-scrim.open { visibility: visible; opacity: 1; }
    .main-area { margin-left: 0; }
    .mobile-menu { display: grid; }
    .topbar { height: 58px; min-height: 58px; padding: 0 20px; }
    .topbar-title { margin-right: auto; }
    .top-search { display: none; }
    .content { padding: 24px 20px 42px; }
    .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    html.auth-html,
    html.auth-html body.auth-page,
    body.auth-page {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
        background: #eef8f5;
        touch-action: manipulation;
    }
    .auth-shell {
        position: relative;
        display: flex;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        background:
            radial-gradient(120% 48% at 0% -6%, rgba(1, 129, 79, .16) 0%, rgba(1, 129, 79, 0) 58%),
            radial-gradient(110% 42% at 100% 108%, rgba(1, 129, 79, .14) 0%, rgba(1, 129, 79, 0) 55%),
            linear-gradient(180deg, #f7fcfb 0%, #eaf6f2 48%, #f4fbf8 100%);
    }
    .auth-shell::before {
        position: absolute;
        inset: 0;
        z-index: 0;
        background-image: url('../images/auth-hero-art.png');
        background-position: center 18%;
        background-repeat: no-repeat;
        background-size: min(920px, 128%) auto;
        opacity: .11;
        content: '';
        pointer-events: none;
    }
    .auth-shell > * { position: relative; z-index: 1; }
    .auth-layout {
        display: flex;
        width: 100%;
        min-height: 100%;
        height: auto;
        align-items: center;
        justify-content: center;
        gap: 0;
        margin: 0 auto;
        padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
        overflow: visible;
        grid-template-columns: none;
        box-sizing: border-box;
    }
    .auth-showcase { display: none; }
    .auth-panel {
        display: flex;
        width: 100%;
        height: auto;
        min-height: 0;
        align-items: center;
        justify-content: center;
        padding: 0;
        overflow: visible;
    }
    .auth-mobile-stack {
        display: grid;
        width: min(400px, 100%);
        max-height: none;
        margin: auto 0;
        gap: 14px;
        overflow: visible;
    }
    .auth-hero-mobile {
        position: relative;
        display: grid;
        justify-items: center;
        gap: 8px;
        overflow: visible;
        padding: 0;
        border: 0;
        border-radius: 0;
        color: #1c2c33;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        text-align: center;
    }
    .auth-brand-mobile {
        position: relative;
        z-index: 1;
        display: flex;
        justify-content: center;
        margin: 2px 0 0;
        padding: 0;
    }
    .auth-brand-mobile img {
        display: block;
        width: 64px;
        height: 64px;
        margin: 0 auto;
        object-fit: contain;
        border-radius: 16px;
        box-shadow: 0 10px 22px rgba(1, 90, 60, .18);
        filter: none;
    }
    .auth-brand-name {
        position: relative;
        z-index: 1;
        margin: 2px 0 0;
        color: #1c2c33;
        font: 700 22px/1.1 'Lato', 'Segoe UI', sans-serif;
        letter-spacing: -.35px;
        text-align: center;
    }
    .auth-brand-name strong {
        color: #01814f;
        font-weight: 800;
    }
    .auth-hero-eyebrow { display: none; }
    .auth-quote {
        position: relative;
        z-index: 1;
        margin: 0;
        max-width: 18em;
        color: #6b7b83;
        font: 500 14px/1.35 'Lato', 'Segoe UI', sans-serif;
        letter-spacing: -.1px;
        text-align: center;
    }
    .auth-card {
        width: 100%;
        max-height: none;
        min-height: 0;
        padding: 20px 18px 16px;
        overflow: visible;
        border: 1px solid rgba(255, 255, 255, .95);
        border-radius: 22px;
        background: #fff;
        box-shadow: 0 18px 40px rgba(16, 52, 44, .1);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .auth-card-head { margin-bottom: 14px; }
    .auth-card-head h2 {
        color: #15252c;
        font-size: 21px;
        letter-spacing: -.35px;
        line-height: 1.15;
    }
    .auth-card-head p { display: none; }
    .auth-form .field { margin-top: 10px; }
    .auth-form .field label { font-size: 11px; font-weight: 700; }
    .auth-form .input,
    .auth-form .select {
        min-height: 46px;
        padding: 10px 12px 10px 42px;
        border-color: #e4ece8;
        border-radius: 12px;
        background: #f7faf8;
        font-size: 16px;
    }
    .auth-form .select { padding-left: 12px; }
    .auth-form .password-field .input { padding-right: 42px; }
    .auth-form .password-toggle { width: 34px; height: 34px; }
    .auth-hint { display: none; }
    .auth-company-row,
    .auth-pass-row { grid-template-columns: 1fr; gap: 0; }
    .auth-company-row .field { margin-top: 10px; }
    .auth-form > .auth-company-row:first-of-type > .field:first-child { margin-top: 0; }
    .auth-pass-row .field,
    .auth-form .auth-pass-row > .field:first-child { margin-top: 10px; }
    .auth-pass-row .auth-input-icon { display: grid; }
    .auth-pass-row .password-field .input { padding-left: 42px; }
    .auth-form .select { padding: 10px 40px 10px 12px; }
    .auth-form-meta { margin-top: 10px; }
    .auth-form .remember-line { font-size: 12px; }
    .auth-forgot { font-size: 12px; }
    .auth-submit {
        min-height: 46px;
        margin-top: 14px;
        border-radius: 12px;
        background: linear-gradient(135deg, #019865 0%, #01814f 55%, #016b42 100%);
        box-shadow: 0 12px 24px rgba(1, 129, 79, .28);
        font-size: 14px;
    }
    .auth-secondary {
        min-height: 44px;
        border-radius: 12px;
        font-size: 13px;
    }
    .auth-divider { margin: 14px 0 12px; }
    .auth-foot { margin-top: 14px; font-size: 13px; }
    .auth-foot a { color: #01814f; font-weight: 700; }
    .auth-form .notice { margin: 0 0 8px; padding: 8px 10px; font-size: 11px; }
}
@media (max-width: 620px) {
    .content { padding: 20px 15px 36px; }
    .topbar { gap: 11px; padding: 10px 14px; }
    .topbar-title h1 { font-size: 16px; }
    .topbar-actions .btn { min-height: 35px; padding: 0 10px; font-size: 10px; }
    .page-heading { align-items: flex-start; margin-bottom: 17px; }
    .page-heading h2 { font-size: 21px; }
    .page-heading p { font-size: 11px; line-height: 1.5; }
    .stats-grid { gap: 9px; margin-bottom: 12px; }
    .charts-grid { gap: 9px; margin-bottom: 12px; }
    .chart-card { min-height: 110px; height: 110px; padding: 12px 12px 8px; }
    .stat-card { min-height: 110px; height: 110px; padding: 13px 12px; }
    .stat-top { align-items: flex-start; gap: 5px; font-size: 9px; }
    .stat-icon { width: 26px; height: 26px; flex: 0 0 auto; }
    .stat-value { margin-top: 12px; font-size: 22px; }
    .card-head { padding: 15px; }
    .card-body { padding: 15px; }
    .card-head h3 { font-size: 13px; }
    .dashboard-grid { gap: 12px; }
    .page-heading .btn { min-height: 36px; padding: 0 10px; font-size: 10px; white-space: nowrap; }
    .show-mobile { display: inline; }
    .hide-mobile { display: none; }
    .filter-form { width: 100%; }
    .filter-form .input, .filter-form .select { width: 100%; }
    .form-grid { grid-template-columns: 1fr; gap: 13px; }
    .field-full, .form-section-title { grid-column: auto; }
    .contact-list { grid-template-columns: 1fr 1fr; gap: 12px; }
    .lead-hero { display: grid; }
    .lead-identity h2 { font-size: 19px; }
    .lead-actions .btn { flex: 1; }
    .split-fields { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .line-item-header, .line-item { grid-template-columns: minmax(0, 1fr) 64px 86px 27px; gap: 5px; }
    .line-item .input { padding: 9px 6px; font-size: 10px; }
    .line-item-header { font-size: 7px; }
    .line-item .remove-row { width: 26px; }
    .proposal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
    .proposal-actions-start,
    .proposal-actions-end { display: flex; align-items: center; gap: 2px; width: auto; margin: 0; }
    .proposal-actions-end { margin-left: auto; }
    .proposal-status-actions { display: grid; width: 100%; gap: 8px; }
    .proposal-status-actions.action-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .proposal-status-actions.action-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .proposal-actions .btn,
    .proposal-status-actions .btn { position: relative; display: grid; min-width: 44px; min-height: 44px; flex: none; place-items: center; padding: 0; border: 0; border-radius: 0; color: #176d59; background: transparent !important; box-shadow: none !important; }
    .proposal-actions .btn-secondary,
    .proposal-actions .btn:not(.btn-secondary),
    .proposal-status-actions .btn-secondary,
    .proposal-status-actions .btn:not(.btn-secondary) { border: 0 !important; color: #176d59; background: transparent !important; box-shadow: none !important; }
    .proposal-actions .btn:hover,
    .proposal-actions .btn:active,
    .proposal-actions .btn:focus,
    .proposal-actions .btn:focus-visible,
    .proposal-status-actions .btn:hover,
    .proposal-status-actions .btn:active,
    .proposal-status-actions .btn:focus,
    .proposal-status-actions .btn:focus-visible { transform: none; border-color: transparent; outline: 0; background: transparent !important; box-shadow: none !important; -webkit-tap-highlight-color: transparent; }
    .proposal-actions .btn svg,
    .proposal-status-actions .btn svg { display: block; width: 22px; height: 22px; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; shape-rendering: geometricPrecision; }
    .proposal-actions .action-label,
    .proposal-status-actions .action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
    .stage-form { align-items: stretch; }
    .stage-form .select { width: 100%; }
    .text-right.mobile-left { text-align: left; }
}
@media print {
    :root { background: white; }
    html, body { background: white !important; }
    body.proposal-printing .app-shell,
    body.proposal-printing .main-area,
    body.proposal-printing .content {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    .sidebar,
    .topbar,
    .mobile-bottom-nav,
    .mobile-scrim,
    .mobile-splash,
    .proposal-toolbar,
    .proposal-preview-note,
    .proposal-decision-card,
    .proposal-send-dialog,
    .proposal-live-preview-dialog,
    .whatsapp-dialog,
    .confirm-dialog,
    .notice,
    .form-note,
    .pwa-notify-banner,
    .public-page .site-header {
        display: none !important;
    }
    .main-area { margin: 0 !important; padding: 0 !important; }
    .content, .public-page { padding: 0 !important; background: white !important; }
    .proposal-sheet {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: white !important;
    }
    .print-only { display: block; }
}


/* Keep table values on separate readable lines and prevent dashboard cards from crowding. */
.table-primary, .table-secondary { display: block; }
.dashboard-grid > .stack, .dashboard-grid > .card { min-width: 0; }
@media (min-width: 1121px) and (max-width: 1320px) {
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}

.project-heading { justify-content: flex-start; align-items: center; gap: 30px; padding-bottom: 15px; border-bottom: 1px solid #dce5e2; margin-bottom: 18px; }
.project-heading > div { min-width: 0; }
.project-heading > .badge { flex: 0 0 auto; margin-top: 0; padding: 9px 14px; font-size: 13px; }
.select { padding-right: 48px; appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='m5 7.5 5 5 5-5' fill='none' stroke='%23465760' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; background-size: 16px; }
@media (max-width: 620px) {
    .project-heading { align-items: flex-start; gap: 12px; }
    .project-heading > .badge { margin-top: 0; padding: 7px 10px; font-size: 12px; }
}

/* Readability scale */
:root {
    font-family: 'Lato', 'Segoe UI', sans-serif;
    color: #243640;
}
body { font-size: 15px; line-height: 1.55; }
.nav-label { color: #a4b5bb; font-size: 11px; letter-spacing: 1px; }
.side-nav a { font-size: 14px; }
.side-help strong { font-size: 13px; }
.side-help p { color: #b4c3c6; font-size: 12px; line-height: 1.6; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { font-size: 11px; }
.topbar-title h1 { font-size: 21px; line-height: 1.25; }
.topbar-title p { font-size: 13px; line-height: 1.45; }
.top-search input { font-size: 14px; }
.remember-line { font-size: 12px; }
.page-heading h2 { font-size: clamp(25px, 2vw, 30px); line-height: 1.2; letter-spacing: -.45px; }
.page-heading p { font-size: 15px; line-height: 1.6; }
.eyebrow { font-size: 11px; letter-spacing: 1.15px; }
.btn { min-height: 44px; font-size: 14px; }
.btn-sm { min-height: 38px; font-size: 13px; }
.card-head h3 { font-size: 16px; line-height: 1.35; letter-spacing: 0; }
.card-head p { font-size: 13px; line-height: 1.5; }
.stat-top { color: #586a72; font-size: 13px; line-height: 1.4; }
.stat-value { font-size: 30px; letter-spacing: -.5px; }
.stat-note { color: #5e6d75; font-size: 12px; line-height: 1.45; }
th { color: #52636b; font-size: 11px; letter-spacing: .55px; }
td { color: #3d5059; font-size: 13px; line-height: 1.5; }
.table-primary { font-size: 14px; line-height: 1.4; }
.table-secondary { color: #5e6d75; font-size: 12px; line-height: 1.45; }
.badge { font-size: 11px; }
.due-date strong { font-size: 15px; }
.due-date small { font-size: 10px; }
.due-copy strong { font-size: 14px; line-height: 1.4; }
.due-copy p { color: #5e6d75; font-size: 12px; line-height: 1.5; }
.empty-state h3 { font-size: 16px; line-height: 1.35; }
.empty-state p { max-width: 390px; color: #5e6d75; font-size: 13px; line-height: 1.65; }
.inline-link { font-size: 13px; }
.text-small { font-size: 12px; }
.input, .select, .textarea { min-height: 44px; font-size: 14px; }
.input::placeholder, .textarea::placeholder { color: #718087; }
.textarea { line-height: 1.6; }
.field { gap: 8px; }
.field label { color: #344850; font-size: 13px; font-weight: 700; line-height: 1.4; }
.field .hint { color: #596970; font-size: 12px; line-height: 1.55; }
.form-section-title { font-size: 12px; letter-spacing: .55px; }
.error { font-size: 12px; }
.form-note, .notice { font-size: 13px; line-height: 1.6; }
.lead-identity h2 { font-size: 25px; line-height: 1.2; letter-spacing: -.4px; }
.lead-identity p { color: #5e6d75; font-size: 13px; line-height: 1.5; }
.contact-item small { color: #52636b; font-size: 12px; font-weight: 700; letter-spacing: .45px; }
.contact-item strong { font-size: 14px; font-weight: 600; line-height: 1.5; }
.timeline-copy strong { font-size: 13px; line-height: 1.45; }
.timeline-copy p { color: #52636b; font-size: 13px; line-height: 1.6; }
.timeline-copy small { color: #65747b; font-size: 11px; line-height: 1.45; }
.callout { font-size: 12px; line-height: 1.65; }
.list-row-copy strong { font-size: 13px; line-height: 1.4; }
.list-row-copy small { color: #5e6d75; font-size: 12px; line-height: 1.45; }
.proposal-brand { font-size: 13px; }
.proposal-number { font-size: 12px; }
.proposal-sheet h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.45px; }
.proposal-sheet .proposal-summary { color: #53636b; font-size: 14px; line-height: 1.75; }
.line-item-header { color: #52636b; font-size: 11px; line-height: 1.35; }
.total-row { color: #53636b; font-size: 13px; }
.total-row.grand { font-size: 18px; }
.team-code { font-size: 14px; }
.pagination a, .pagination span { font-size: 13px; }
.auth-showcase-copy h1 { letter-spacing: -.8px; }
.auth-foot { font-size: 12px; }
.whatsapp-dialog-intro { color: #53636b; font-size: 14px; }
.whatsapp-dialog-heading h2 { font-size: 22px; }
.whatsapp-dialog .field label { font-size: 13px; font-weight: 700; }
.whatsapp-dialog .textarea { font-size: 14px; line-height: 1.65; }

@media (max-width: 620px) {
    body { font-size: 15px; }
    .topbar-title h1 { font-size: 18px; }
    .topbar-actions .btn { min-height: 40px; font-size: 13px; }
    .content { padding: 20px 15px 36px; }
    .page-heading h2 { font-size: 24px; }
    .page-heading p { font-size: 14px; line-height: 1.55; }
    .page-heading .btn { min-height: 40px; font-size: 13px; }
    .stat-top { font-size: 11px; line-height: 1.35; }
    .stat-value { font-size: 25px; }
    .stat-note { font-size: 11px; }
    .card-head h3 { font-size: 15px; }
    .card-head p { font-size: 12px; }
    .contact-list { grid-template-columns: 1fr; gap: 14px; }
    .lead-identity h2 { font-size: 22px; }
    .lead-actions .btn { min-height: 42px; font-size: 13px; }
    .input, .select, .textarea,
    .whatsapp-dialog .input,
    .whatsapp-dialog .textarea,
    .top-search input,
    .line-item .input {
        min-height: 46px;
        font-size: 16px;
    }
    .field label { font-size: 13px; }
    .proposal-sheet h1 { font-size: 25px; }
    .line-item-header { font-size: 10px; }
    .line-item .input { padding: 9px 5px; }
    .whatsapp-dialog-heading h2 { font-size: 20px; }
}

@media (max-width: 820px) and (max-height: 720px) {
    body.auth-page .auth-shell::before { opacity: .08; background-size: min(820px, 120%) auto; }
    body.auth-page .auth-mobile-stack { gap: 10px; }
    body.auth-page .auth-brand-mobile img { width: 52px; height: 52px; border-radius: 14px; }
    body.auth-page .auth-brand-name { font-size: 20px; }
    body.auth-page .auth-quote { font-size: 13px; }
    body.auth-page .auth-card { padding: 14px 14px 12px; }
    body.auth-page .auth-card-head h2 { font-size: 18px; }
    body.auth-page .auth-form .field { margin-top: 7px; }
    body.auth-page .auth-company-row .field { margin-top: 7px; }
    body.auth-page .auth-form > .auth-company-row:first-of-type > .field:first-child { margin-top: 0; }
    body.auth-page .auth-pass-row .field,
    body.auth-page .auth-form .auth-pass-row > .field:first-child { margin-top: 7px; }
    body.auth-page .auth-form .input,
    body.auth-page .auth-form .select { min-height: 42px; }
    body.auth-page .auth-form .auth-submit { min-height: 42px; margin-top: 10px; }
    body.auth-page .auth-foot { margin-top: 10px; }
}


/* Mobile tables: compact record cards with paired details. */
@media (max-width: 620px) {
    .table-wrap { overflow: visible; }
    .table-wrap table { display: block; width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; }
    .table-wrap thead { display: none; }
    .table-wrap tbody { display: grid; gap: 0; }
    .table-wrap tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; column-gap: 14px; overflow: hidden; padding: 9px 12px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
    .table-wrap tr:last-child { border-bottom: 0; }
    .table-wrap td { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; box-sizing: border-box; width: auto; min-width: 0; min-height: 68px; padding: 10px 0; border: 0; border-bottom: 1px solid #eef1f0; color: var(--ink); font-size: 12px; line-height: 1.3; text-align: left; overflow-wrap: anywhere; }
    .table-wrap td:first-child { grid-column: 1 / -1; min-height: 0; padding: 10px 72px 11px 0; border-bottom: 1px solid #e9eeec; }
    .table-wrap td[data-label="Added"] { position: absolute; top: 42px; right: 11px; display: flex; align-items: flex-end; width: auto; min-height: 0; padding: 0; border: 0; text-align: right; }
    .table-wrap td[data-label="Added"]::before { font-size: 8px; }
    .table-wrap td::before { content: attr(data-label); color: #718087; font-size: 9px; font-weight: 700; line-height: 1.15; letter-spacing: .035em; text-transform: uppercase; }
    .table-wrap td .table-primary, .table-wrap td .table-secondary { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
    .table-wrap td .table-primary { font-size: 12px; line-height: 1.3; }
    .table-wrap td .table-secondary { margin-top: 1px; color: #718087; font-size: 10.5px; line-height: 1.25; }
    .table-wrap td .badge { align-self: flex-start; padding: 4px 7px; font-size: 10px; line-height: 1.2; }
    .table-wrap td[data-label="Open"] { position: absolute; top: 9px; right: 11px; display: block; width: auto; min-height: 0; padding: 0; border: 0; }
    .table-wrap td[data-label="Open"]::before { display: none; }
    .table-wrap td .inline-link { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 7px; border-radius: 7px; background: #f0f7f5; font-size: 11px; }
    .table-wrap td.text-right { text-align: left; }

    /* Proposal document layout — overrides list-table card styles above */
    .proposal-sheet {
        margin: 0 -3px;
        padding: 0;
        overflow: hidden;
        border: 1px solid #d7e6e0;
        border-radius: 18px;
        background:
            linear-gradient(180deg, #f3faf7 0, #ffffff 88px),
            #ffffff;
        box-shadow: 0 14px 34px rgba(28, 74, 61, .08);
    }
    .proposal-sheet .proposal-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 18px 16px 16px;
        border-bottom: 1px solid #e4efe9;
    }
    .proposal-sheet .proposal-brand {
        font-size: 11px;
        letter-spacing: 1.6px;
        line-height: 1.35;
    }
    .proposal-sheet .proposal-number {
        margin-top: 5px;
        font-size: 11px;
        line-height: 1.4;
    }
    .proposal-sheet .badge {
        flex: 0 0 auto;
        margin-top: 1px;
        font-size: 10px;
    }
    .proposal-sheet .proposal-intro {
        margin: 0;
        padding: 18px 16px 4px;
    }
    .proposal-sheet .proposal-intro .eyebrow {
        margin: 0 0 8px;
        font-size: 10px;
        letter-spacing: 1.2px;
    }
    .proposal-sheet h1 {
        margin: 0 0 10px;
        font-size: 24px;
        line-height: 1.22;
        letter-spacing: -.45px;
        overflow-wrap: anywhere;
    }
    .proposal-sheet .proposal-summary {
        color: #54646c;
        font-size: 14px;
        line-height: 1.65;
    }
    .proposal-sheet .proposal-meta {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 16px;
        padding: 14px;
        border: 1px solid #e5efe9;
        border-radius: 14px;
        background: #f7fbf9;
    }
    .proposal-sheet .proposal-meta .contact-item small {
        margin-bottom: 4px;
        color: #617179;
        font-size: 10px;
    }
    .proposal-sheet .proposal-meta .contact-item strong {
        font-size: 13px;
        line-height: 1.45;
    }
    .proposal-sheet .proposal-scope {
        padding: 4px 16px 18px;
    }
    .proposal-sheet .proposal-scope-label {
        display: block;
        margin: 0 0 10px;
        font-size: 10px;
        letter-spacing: 1.2px;
    }
    .proposal-sheet .proposal-items {
        overflow: visible;
        border: 1px solid #e5efe9;
        border-radius: 14px;
        background: #fff;
    }
    .proposal-sheet .proposal-items table,
    .proposal-sheet .proposal-items tbody {
        display: block;
        width: 100%;
    }
    .proposal-sheet .proposal-items thead { display: none; }
    .proposal-sheet .proposal-items tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 12px;
        align-items: start;
        padding: 14px;
        border: 0;
        border-bottom: 1px solid #eef3f1;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .proposal-sheet .proposal-items tr:last-child { border-bottom: 0; }
    .proposal-sheet .proposal-items td {
        display: block;
        width: auto;
        min-width: 0;
        min-height: 0;
        padding: 0;
        border: 0;
        color: var(--ink);
        font-size: 13px;
        line-height: 1.45;
        text-align: left;
        overflow-wrap: anywhere;
    }
    .proposal-sheet .proposal-items td::before { display: none; content: none; }
    .proposal-sheet .proposal-items .proposal-item-desc {
        grid-column: 1;
        grid-row: 1;
        padding: 0;
        border: 0;
        font-weight: 650;
        font-size: 14px;
        line-height: 1.4;
    }
    .proposal-sheet .proposal-items .proposal-item-meta {
        grid-column: 1;
        grid-row: 2;
        color: #66757c;
        font-size: 12px;
        font-weight: 500;
    }
    .proposal-sheet .proposal-items .proposal-item-amount {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        color: var(--ink);
        font-size: 14px;
        font-weight: 750;
        text-align: right;
        white-space: nowrap;
    }
    .proposal-sheet .proposal-total {
        width: 100%;
        margin: 14px 0 0;
        padding: 14px;
        border: 1px solid #dceae3;
        border-radius: 14px;
        background: linear-gradient(180deg, #f4faf7, #eef7f2);
    }
    .proposal-sheet .total-row {
        padding: 6px 0;
        color: #54646c;
        font-size: 13px;
    }
    .proposal-sheet .total-row.grand {
        margin-top: 6px;
        padding-top: 12px;
        border-top: 1px solid #d5e6de;
        font-size: 17px;
        letter-spacing: -.3px;
    }
    .proposal-sheet .proposal-terms {
        margin: 0;
        padding: 4px 16px 20px;
        border-top: 0;
    }
    .proposal-sheet .proposal-terms .divider,
    .proposal-sheet .proposal-terms + .proposal-terms::before {
        display: none;
    }
    .proposal-sheet > .form-note {
        margin: 0 16px 18px !important;
        padding: 12px 13px;
        border-radius: 12px;
        background: #f4f8f6;
    }
    .proposal-decision-card {
        max-width: none;
        margin: 14px 0 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .proposal-decision-card .card-head {
        padding: 4px 2px 10px;
        border-bottom: 0;
        background: transparent;
    }
    .proposal-decision-card .card-body {
        padding: 0 2px 8px;
    }
    .proposal-toolbar {
        gap: 10px;
        margin-bottom: 14px;
    }
    .proposal-actions-end.action-count-3,
    .proposal-actions-end.action-count-4 {
        display: grid;
        width: 100%;
        max-width: 220px;
        gap: 8px;
        margin-left: auto;
    }
    .proposal-actions-end.action-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 180px; }
    .proposal-actions-end.action-count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 240px; }
    .proposal-actions-end.action-count-3 .btn,
    .proposal-actions-end.action-count-3 a.btn,
    .proposal-actions-end.action-count-4 .btn,
    .proposal-actions-end.action-count-4 a.btn {
        width: 48px;
        min-width: 48px;
        height: 48px;
        min-height: 48px;
        justify-self: center;
        border: 1px solid rgba(201, 232, 220, .9) !important;
        border-radius: 15px;
        color: #176d59;
        background: rgba(255, 255, 255, .92) !important;
        box-shadow: 0 4px 12px rgba(38, 91, 72, .08) !important;
    }
    .proposal-actions-end.action-count-3 .btn svg,
    .proposal-actions-end.action-count-3 a.btn svg,
    .proposal-actions-end.action-count-4 .btn svg,
    .proposal-actions-end.action-count-4 a.btn svg {
        width: 22px;
        height: 22px;
        stroke-width: 2;
    }
    .proposal-create-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: stretch;
        gap: 10px;
        padding-top: 14px;
        border-top: 0;
    }
    .proposal-create-actions > .btn-secondary[href],
    .proposal-create-actions > #open-send-proposal,
    .proposal-create-actions > .btn[type="submit"][name="after_action"][value="save"] {
        width: 100%;
        min-height: 46px;
    }
    .proposal-create-actions > .btn-secondary[href] { order: 3; }
    .proposal-create-actions > #open-send-proposal { order: 2; }
    .proposal-create-actions > .btn[type="submit"][name="after_action"][value="save"] { order: 4; }
    .proposal-create-tools {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
        order: 1;
    }
    .proposal-send-dialog {
        width: calc(100% - 16px);
        padding: 18px 16px;
        border-radius: 14px;
    }
    .proposal-send-option { min-height: 70px; }
    .swipe-row-actions { display: flex; }
    .swipe-delete-desktop,
    .proposal-delete-desktop { display: none; }
    .lead-proposals-card .swipe-row-content.list-row,
    .dashboard-enquiry-mobile-list .swipe-row-content.list-row,
    .lead-mobile-list .swipe-row-content,
    .project-mobile-list .swipe-row-content.list-row {
        margin: 0;
        padding: 13px 15px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .follow-up-swipe.is-open .swipe-row-content.follow-up-item-card {
        border-radius: 14px 0 0 14px;
    }
    .lead-mobile-list .swipe-row-content.lead-mobile-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: start;
        gap: 12px;
    }
    .swipe-row.is-open .swipe-row-content {
        transform: translateX(-88px);
        box-shadow: -8px 0 18px rgba(17, 35, 43, .06);
    }
    .proposal-actions-end.action-count-4 form {
        display: grid;
        justify-self: center;
    }
    .proposal-actions-end.action-count-4 .proposal-delete-btn {
        color: #bd5a5a !important;
        border-color: rgba(240, 180, 170, .95) !important;
        background: #fff7f6 !important;
    }
    .proposal-create-tools .btn {
        display: grid;
        width: 100%;
        min-width: 0;
        height: 48px;
        min-height: 48px;
        place-items: center;
        padding: 0;
        border: 1px solid rgba(201, 232, 220, .9);
        border-radius: 15px;
        color: #176d59;
        background: rgba(255, 255, 255, .92);
        box-shadow: 0 4px 12px rgba(38, 91, 72, .08);
    }
    .proposal-create-tools .action-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .proposal-create-tools .btn svg {
        width: 22px;
        height: 22px;
    }
    .proposal-live-preview-dialog {
        width: calc(100% - 16px);
        max-height: calc(100dvh - 16px);
        padding: 14px;
        border-radius: 14px;
    }
    .proposal-live-preview-actions .btn { flex: 1; }
    .public-page {
        padding: 18px 12px 28px;
    }

    .leads-card-head { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 12px; padding: 15px; }
    .leads-card-head > div { min-width: 0; }
    .leads-card-head h3 { font-size: 15px; line-height: 1.35; }
    .leads-card-head p { display: none; }
    .leads-card-head .filter-form { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(72px, 1fr) auto auto; width: 100%; flex: initial; gap: 5px; }
    .leads-card-head .filter-form .input { grid-column: 1; width: 100%; min-width: 0; min-height: 42px; padding: 8px; font-size: 16px; }
    .leads-card-head .filter-form .select { grid-column: 2; width: 100%; min-width: 72px; min-height: 42px; padding: 8px 18px 8px 7px; font-size: 12px; }
    .leads-card-head .filter-form > button { grid-column: 3; min-width: 48px; min-height: 42px; padding: 0 6px; font-size: 10px; }
    .leads-card-head .filter-form .btn-quiet { grid-column: 4; min-width: 32px; min-height: 42px; padding: 0 5px; font-size: 0; }
    .leads-card-head .filter-form .btn-quiet::after { content: '×'; font-size: 18px; line-height: 1; }

    /* Keep the dashboard's recent enquiry details to two balanced rows. */
    .recent-enquiries-table td:first-child { grid-column: 1; grid-row: 1; min-height: 68px; padding: 10px 0; }
    .recent-enquiries-table td[data-label="Project"] { grid-column: 2; grid-row: 1; }
    .recent-enquiries-table td[data-label="Stage"] { grid-column: 1; grid-row: 2; }
    .recent-enquiries-table td[data-label="Next action"] { grid-column: 2; grid-row: 2; }
    .recent-enquiries-table td[data-label="Open"] { display: none; }
    .recent-enquiries-table tbody { gap: 0; }
    .recent-enquiries-table tr { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 0; }
    .recent-enquiries-table tr:last-child { margin-bottom: 0; }
    .recent-enquiries-table td,
    .recent-enquiries-table td:first-child { border-bottom: 0; }

    .dashboard-recent-head { align-items: center; gap: 10px; padding: 14px 15px; }
    .dashboard-recent-head h3 { font-size: 15px; }
    .dashboard-recent-head p { display: none; }
    .dashboard-recent-head .inline-link { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
    .dashboard-enquiry-mobile-list { display: block; }
    .recent-enquiries-table { display: none !important; }
    .dashboard-enquiry-row { align-items: flex-start; gap: 10px; padding: 14px 15px; }
    .dashboard-enquiry-row:first-child { border-top: 0; }
    .dashboard-enquiry-copy { min-width: 0; flex: 1; }
    .dashboard-enquiry-copy strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
    .dashboard-enquiry-copy small { display: block; margin-top: 4px; color: #5e6d75; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
    .dashboard-enquiry-copy .dashboard-enquiry-next { margin-top: 5px; color: #718087; font-size: 10px; }
    .dashboard-enquiry-row > .badge { flex: 0 0 auto; max-width: 82px; padding: 6px 8px; font-size: 10px; line-height: 1.2; text-align: center; white-space: normal; }

    .leads-index-table tbody,
    .projects-index-table tbody { gap: 0; }
    .leads-index-table tr,
    .projects-index-table tr { margin-bottom: 8px; border-bottom: 0; }
    .leads-index-table tr:last-child,
    .projects-index-table tr:last-child { margin-bottom: 0; }
    .leads-index-table td,
    .projects-index-table td,
    .leads-index-table td:first-child,
    .projects-index-table td:first-child { border-bottom: 0; }

    .lead-mobile-list { display: block; }
    .leads-index-table { display: none !important; }
    .lead-mobile-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-top: 1px solid #eef1f0; color: inherit; text-decoration: none; }
    .lead-mobile-row:first-child { border-top: 0; }
    .lead-mobile-row:hover { background: #fcfdfd; }
    .lead-mobile-copy { min-width: 0; flex: 1; }
    .lead-mobile-copy strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
    .lead-mobile-copy small { display: block; margin-top: 4px; color: #5e6d75; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
    .lead-mobile-copy .lead-mobile-next { margin-top: 5px; color: #718087; font-size: 10px; }
    .lead-mobile-row > .badge { flex: 0 0 auto; max-width: 88px; padding: 6px 8px; font-size: 10px; line-height: 1.2; text-align: center; white-space: normal; }

    .project-mobile-list { display: block; }
    .projects-index-table { display: none !important; }
    .project-mobile-row { align-items: flex-start; padding: 14px 18px; }
    .project-mobile-row:first-child { border-top: 0; }
    .project-mobile-copy { flex: 1; min-width: 0; }
    .project-mobile-copy strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
    .project-mobile-copy small { display: block; margin-top: 4px; color: #5e6d75; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
    .project-mobile-copy .project-mobile-meta { margin-top: 5px; color: #718087; font-size: 10px; }
    .project-mobile-row > .badge { flex: 0 0 auto; max-width: 88px; padding: 6px 8px; font-size: 10px; line-height: 1.2; text-align: center; white-space: normal; }
}

/* Collapsible icon rail */
html:not(.sidebar-expanded) .sidebar { width: 84px; padding: 22px 10px 17px; transition: width .22s ease, padding .22s ease; }
html:not(.sidebar-expanded) .main-area { margin-left: 84px; transition: margin-left .22s ease; }
html.sidebar-expanded .sidebar { width: 252px; padding: 25px 17px 18px; transition: width .22s ease, padding .22s ease; }
html.sidebar-expanded .main-area { margin-left: 252px; transition: margin-left .22s ease; }
html:not(.sidebar-expanded) .sidebar .brand { justify-content: center; padding: 2px 0 18px; }
html:not(.sidebar-expanded) .sidebar .brand-copy,
html:not(.sidebar-expanded) .sidebar .nav-label,
html:not(.sidebar-expanded) .sidebar .nav-copy,
html:not(.sidebar-expanded) .sidebar .side-help,
html:not(.sidebar-expanded) .sidebar .profile-copy { display: none; }
html:not(.sidebar-expanded) .sidebar .brand-mark { display: grid; width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; }
html:not(.sidebar-expanded) .sidebar .side-nav { gap: 7px; }
html:not(.sidebar-expanded) .sidebar .side-nav a { width: 58px; min-height: 58px; justify-content: center; margin: 0 auto; padding: 0; border-radius: 15px; }
html:not(.sidebar-expanded) .sidebar .nav-icon { width: 28px; }
html:not(.sidebar-expanded) .sidebar .nav-icon svg { width: 25px; height: 25px; stroke-width: 1.7; }
html:not(.sidebar-expanded) .sidebar .profile-row { flex-direction: column; justify-content: center; gap: 9px; padding: 13px 0 0; }
@media (max-width: 820px) {
    html:not(.sidebar-expanded) .sidebar { width: 84px; padding: 22px 10px 17px; }
    html.sidebar-expanded .sidebar { width: 260px; }
    html:not(.sidebar-expanded) .main-area, html.sidebar-expanded .main-area { margin-left: 0; }
    .sidebar-toggle { display: none !important; }
}

/* Zoho-inspired typography: light, calm text with clear hierarchy. */
:root { font-family: 'Lato', 'Segoe UI', sans-serif; color: #263442; }
body { font-family: 'Lato', 'Segoe UI', sans-serif; font-size: 15px; font-weight: 400; }
.brand-copy strong { font-weight: 600; letter-spacing: 0; }
.brand-mark { font-weight: 700; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .8px; }
.side-nav a { font-size: 14px; font-weight: 500; }
.side-help strong { font-weight: 600; }
.profile-copy strong { font-weight: 500; }
.topbar-title h1 { font-size: 20px; font-weight: 500; letter-spacing: 0; }
.page-heading h2 { font-size: clamp(25px, 2vw, 29px); font-weight: 500; line-height: 1.25; letter-spacing: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .7px; }
.btn { font-weight: 600; }
.btn-sm { font-weight: 600; }
.card-head h3 { font-weight: 500; letter-spacing: 0; }
.stat-top { font-weight: 400; }
.stat-value { font-weight: 600; letter-spacing: 0; }
th { font-weight: 600; letter-spacing: .35px; }
.table-primary { font-weight: 500; }
.badge { font-weight: 600; letter-spacing: 0; }
.due-date strong { font-weight: 600; }
.due-copy strong { font-weight: 500; }
.empty-state h3 { font-weight: 500; }
.inline-link { font-weight: 600; }
.field label { font-weight: 600; }
.form-section-title { font-weight: 600; }
.lead-identity h2 { font-weight: 500; letter-spacing: 0; }
.contact-item small { font-weight: 600; letter-spacing: .3px; }
.contact-item strong { font-weight: 400; }
.timeline-copy strong, .list-row-copy strong { font-weight: 500; }
.proposal-sheet h1 { font-weight: 500; letter-spacing: 0; }
.proposal-brand { font-weight: 600; }
.total-row.grand { font-weight: 600; }
.auth-showcase-copy h1 { font-weight: 700; letter-spacing: -.4px; }
.auth-card-head h2 { font-weight: 700; letter-spacing: -.35px; }
.whatsapp-dialog-heading h2 { font-weight: 500; }
.whatsapp-dialog .field label { font-weight: 600; }
@media (max-width: 620px) {
    .topbar-title h1 { font-size: 18px; }
    .page-heading h2 { font-size: 24px; }
}


/* Full-width mobile bottom navigation */
.mobile-bottom-nav { display: none; }
@media (max-width: 820px) {
    html, body { width: 100%; max-width: 100%; overflow-x: hidden; scrollbar-width: none; }
    html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
    .inline-link { display: inline-flex; align-items: center; white-space: nowrap; }
    .card-head .inline-link { flex: 0 0 auto; }
    .sidebar, .mobile-scrim { display: none !important; }
    .mobile-menu { display: none !important; }
    html.sidebar-expanded .main-area, html:not(.sidebar-expanded) .main-area { width: 100%; margin-left: 0; }
    .main-area { width: 100%; min-width: 0; padding-top: calc(58px + env(safe-area-inset-top, 0px)); }
    .topbar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 55;
        width: 100%;
        height: calc(58px + env(safe-area-inset-top, 0px));
        min-height: calc(58px + env(safe-area-inset-top, 0px));
        justify-content: space-between;
        gap: 8px;
        padding: env(safe-area-inset-top, 0px) 12px 0 14px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 4px 16px rgba(30, 49, 59, .06);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    .topbar-actions,
    .mobile-menu,
    .mobile-header-logo { display: none !important; }
    .mobile-back {
        display: grid !important;
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        place-items: center;
        margin: 0 2px 0 -6px;
        border: 0;
        border-radius: 50%;
        color: #33464d;
        background: transparent;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-back svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.1;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .mobile-back:active { background: #edf5f2; }
    .topbar:has(.mobile-back) .topbar-title { padding-left: 2px; }
    .topbar-title {
        display: block !important;
        min-width: 0;
        flex: 1;
        margin: 0;
    }
    .topbar-title h1 {
        max-width: 100%;
        overflow: hidden;
        font-size: 17px;
        font-weight: 500;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-top-actions {
        display: flex !important;
        flex: 0 0 auto;
        align-items: center;
        gap: 2px;
        margin-left: 4px;
    }
    .mobile-notifications,
    .mobile-logout {
        display: grid !important;
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        place-items: center;
        margin: 0;
        border: 0;
        border-radius: 50%;
        color: #33464d;
        background: transparent;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-notifications:active,
    .mobile-logout:active { background: #edf5f2; }
    .mobile-notifications svg,
    .mobile-logout svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
        shape-rendering: geometricPrecision;
    }
    .content { width: 100%; max-width: none; padding: 20px 15px calc(92px + env(safe-area-inset-bottom)); }
    .mobile-bottom-nav {
        position: fixed;
        inset: auto 0 0;
        z-index: 50;
        display: grid;
        width: 100%;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid #e5e9eb;
        background: rgba(255,255,255,.97);
        box-shadow: 0 -5px 20px rgba(30, 49, 59, .07);
        backdrop-filter: blur(14px);
    }
    .mobile-bottom-nav a {
        display: flex;
        min-width: 0;
        min-height: 54px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 4px 1px;
        border-radius: 10px;
        color: #66747b;
        text-align: center;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-nav-icon { display: grid; width: 24px; height: 24px; place-items: center; }
    .mobile-nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-nav-label { display: block; max-width: 100%; overflow: hidden; font-size: 10px; font-weight: 500; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-bottom-nav a.active { color: var(--green-dark); background: var(--green-pale); }
    .mobile-bottom-nav a.active .mobile-nav-icon svg { stroke-width: 2; }
}
@media (max-width: 360px) {
    .mobile-bottom-nav { padding-right: 2px; padding-left: 2px; }
    .mobile-nav-label { font-size: 9px; }
}

/* Lead detail mobile layout */
@media (max-width: 620px) {
    .lead-hero { position: relative; display: grid; gap: 14px; margin-bottom: 12px; padding: 16px; }
    .lead-hero-main { gap: 12px; }
    .lead-hero-actions { width: 100%; justify-items: center; gap: 10px; }
    .lead-source-action {
        display: grid;
        width: 52px;
        height: 52px;
        min-height: 52px;
        flex: none;
        place-items: center;
        padding: 0;
        border: 1px solid rgba(201, 232, 220, .9);
        border-radius: 16px;
        background: rgba(255, 255, 255, .88);
        box-shadow: 0 4px 12px rgba(38, 91, 72, .08);
    }
    .lead-source-action svg { width: 26px; height: 26px; stroke-width: 2.05; }
    .lead-source-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
    .lead-identity { gap: 11px; }
    .lead-avatar { width: 48px; height: 48px; border: 1px solid #c9e8dc; border-radius: 14px; background: linear-gradient(145deg, #e7f6ef, #cceadd); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); font-size: 16px; }
    .lead-identity h2 { font-size: 20px; line-height: 1.25; }
    .lead-identity p { margin-top: 3px; font-size: 11px; line-height: 1.4; }
    .lead-contact-line { margin-top: 3px; font-size: 10.5px; }
    .lead-actions {
        display: grid;
        width: 100%;
        justify-items: center;
        align-items: center;
        gap: 10px;
        padding: 2px 0 0;
    }
    .lead-actions.action-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lead-actions.action-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lead-actions.action-count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lead-actions.action-count-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lead-actions .btn {
        position: relative;
        display: grid;
        width: 52px;
        min-width: 52px;
        height: 52px;
        min-height: 52px;
        flex: none;
        place-items: center;
        justify-self: center;
        padding: 0;
        border: 1px solid rgba(201, 232, 220, .9) !important;
        border-radius: 16px;
        color: #176d59;
        background: rgba(255, 255, 255, .88) !important;
        box-shadow: 0 4px 12px rgba(38, 91, 72, .08) !important;
    }
    .lead-actions .btn-secondary,
    .lead-actions .btn:not(.btn-secondary) {
        border: 1px solid rgba(201, 232, 220, .9) !important;
        color: #176d59;
        background: rgba(255, 255, 255, .88) !important;
        box-shadow: 0 4px 12px rgba(38, 91, 72, .08) !important;
    }
    .lead-actions .btn:hover,
    .lead-actions .btn:active,
    .lead-actions .btn:focus,
    .lead-actions .btn:focus-visible {
        transform: none;
        border-color: #b7d9cb;
        outline: 0;
        background: #fff !important;
        box-shadow: 0 6px 14px rgba(38, 91, 72, .12) !important;
        -webkit-tap-highlight-color: transparent;
    }
    .lead-actions .btn svg {
        display: block;
        width: 26px;
        height: 26px;
        margin: 0 auto;
        stroke-width: 2.05;
        stroke-linecap: round;
        stroke-linejoin: round;
        shape-rendering: geometricPrecision;
    }
    .lead-actions .action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
    .lead-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .lead-detail-grid > .stack { display: contents; }
    .lead-detail-grid .lead-opportunity-card { order: 1; }
    .lead-detail-grid .lead-schedule-card { order: 2; }
    .lead-detail-grid .lead-timeline-card { order: 3; }
    .lead-detail-grid .lead-proposals-card { order: 4; }
    .lead-detail-grid .lead-delivery-card { order: 5; }
    .lead-detail-grid > .card { min-width: 0; }
    .lead-detail-grid .card-head { min-height: 0; gap: 10px; padding: 13px 15px; }
    .lead-detail-grid .card-head h3 { font-size: 15px; }
    .lead-detail-grid .card-head p { display: none; }
    .lead-detail-grid .card-body { padding: 15px; }

    .lead-opportunity-card .contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; }
    .lead-opportunity-card .contact-item { min-width: 0; }
    .lead-opportunity-card .contact-item small { margin-bottom: 3px; font-size: 9px; letter-spacing: .4px; }
    .lead-opportunity-card .contact-item strong { display: block; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
    .lead-opportunity-card .contact-item[style*="grid-column"] { grid-column: 1 / -1; }
    .lead-opportunity-card .stage-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
    .lead-opportunity-card .stage-form label { grid-column: 1 / -1; grid-row: 1; }
    .lead-opportunity-card .stage-form .select { grid-column: 1; grid-row: 2; width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
    .lead-opportunity-card .stage-form .btn-stage-confirm { grid-column: 2; grid-row: 2; width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
    .lead-opportunity-card .stage-form .stage-lost-reason { grid-column: 1 / -1; grid-row: 3; }
    .lead-opportunity-card .stage-form .stage-lost-reason .input { min-height: 44px; font-size: 16px; }

    .lead-schedule-card .callout { padding: 10px; font-size: 11px; line-height: 1.5; }
    .lead-schedule-card .follow-up-form { gap: 10px; max-width: 100%; min-width: 0; }
    .lead-schedule-card .follow-up-form .field,
    .lead-schedule-card .follow-up-form .split-fields {
        max-width: 100%;
        min-width: 0;
    }
    .lead-schedule-card .split-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .lead-schedule-card .field label { font-size: 11px; }
    .lead-schedule-card .field .hint { font-size: 10px; }
    .lead-schedule-card input[type="datetime-local"],
    .lead-schedule-card .input,
    .lead-schedule-card .select,
    .lead-schedule-card .textarea {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
    .lead-schedule-card input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        margin: 0;
        padding: 0;
        flex: 0 0 auto;
    }
    .form-grid .field,
    .form-grid .input,
    .form-grid .select,
    .form-grid .textarea {
        max-width: 100%;
        min-width: 0;
    }
    .form-grid input[type="date"],
    .form-grid input[type="datetime-local"],
    .form-grid input[type="tel"],
    .form-grid input[type="number"],
    .form-grid input[type="email"],
    .form-grid input[type="text"] {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
    .form-grid input[type="date"]::-webkit-calendar-picker-indicator,
    .form-grid input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        margin: 0;
        padding: 0;
        flex: 0 0 auto;
    }

    .lead-timeline-card .card-body { padding: 14px 15px; }
    .lead-timeline-card .card-body > form { margin-bottom: 14px !important; }
    .lead-timeline-card .timeline-item { grid-template-columns: 16px minmax(0, 1fr); gap: 9px; padding-bottom: 15px; }
    .lead-timeline-card .timeline-copy strong { font-size: 12px; }
    .lead-timeline-card .timeline-copy p { font-size: 12px; line-height: 1.5; }
    .lead-timeline-card .timeline-copy small { font-size: 10px; }

    .lead-proposals-card .list-row,
    .lead-delivery-card .list-row { gap: 10px; padding: 12px 15px; }
    .lead-proposals-card .list-row-copy,
    .lead-delivery-card .list-row-copy { min-width: 0; }
    .lead-proposals-card .badge,
    .lead-delivery-card .badge { flex: 0 0 auto; }

    .lead-opportunity-card { overflow: hidden; border-color: #d9ebe4; background: linear-gradient(135deg, #edf8f3 0%, #ffffff 52%, #e9f5f0 100%); box-shadow: 0 10px 24px rgba(38, 91, 72, .08); }
    .lead-opportunity-card .card-head { border-bottom: 0; background: transparent; padding: 16px 15px 0; }
    .lead-opportunity-card .card-body { padding: 13px 15px 15px; }
    .lead-opportunity-card .contact-list { gap: 9px; }
    .lead-opportunity-card .contact-item { padding: 10px; border: 1px solid rgba(209, 231, 221, .85); border-radius: 10px; background: rgba(255,255,255,.78); }
    .lead-opportunity-card .contact-item[style*="grid-column"] { padding: 11px; }
    .lead-opportunity-card .divider { display: none; }
    .lead-opportunity-card .stage-form {
        margin-top: 14px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }
}


/* Compact icon-only create actions on overview and enquiry list. */
.page-heading .btn-icon-circle { position: fixed; right: 26px; bottom: 24px; z-index: 60; display: inline-grid; width: 54px; min-width: 54px; height: 54px; min-height: 54px; flex: 0 0 54px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 50%; color: #fff; background: var(--green); box-shadow: 0 8px 22px rgba(19, 130, 105, .28); transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s ease, backdrop-filter .2s ease, transform .2s ease; }
.page-heading .btn-icon-circle:hover { color: #fff; background: var(--green-dark); box-shadow: 0 10px 25px rgba(19, 130, 105, .34); transform: translateY(-2px); }
.page-heading .btn-icon-circle svg { width: 23px; height: 23px; stroke-width: 2.2; }
.page-heading .btn-icon-circle.is-scrolled { border-color: rgba(255, 255, 255, .48); background: rgba(19, 130, 105, .68); box-shadow: 0 7px 22px rgba(16, 61, 51, .18); opacity: .82; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (max-width: 820px) {
    .page-heading .btn-icon-circle { right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 54px; min-width: 54px; height: 54px; min-height: 54px; }
    .todo-compose-card,
    .todo-compose-card .card-body,
    .todo-compose-form,
    .todo-compose-form .field,
    .todo-compose-form .split-fields {
        max-width: 100%;
        min-width: 0;
    }
    .todo-compose-form input[type="datetime-local"],
    .todo-due-input {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
}

/* Follow-ups: each scheduled item is its own base card on mobile. */
@media (max-width: 820px) {
    .follow-ups-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .follow-ups-grid > .card,
    .follow-ups-scheduled-stack,
    .follow-ups-completed-stack { min-width: 0; }
    .follow-ups-section-head {
        padding: 0 4px;
    }
    .follow-ups-section-head h3 { font-size: 14px; }
    .follow-up-swipe {
        border-radius: 14px;
        box-shadow: none;
    }
    .follow-up-swipe .swipe-row-content.follow-up-item-card {
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: 0 8px 22px rgba(27, 48, 58, .05);
    }
    .follow-up-item-main {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 10px;
        padding: 14px 14px 12px;
    }
    .follow-up-item-title {
        font-size: 14px;
        font-weight: 600;
    }
    .follow-up-item-actions {
        gap: 8px;
    }
    .follow-up-item-actions .badge {
        max-width: 84px;
        padding: 5px 8px;
        font-size: 10px;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }
    .follow-up-item-copy > small,
    .follow-up-item-meta {
        font-size: 11px;
        line-height: 1.4;
    }
    .follow-up-outcome-toggle {
        min-height: 46px;
        padding: 0 14px;
        font-size: 13px;
    }
    .follow-up-outcome-form {
        gap: 12px;
        padding: 14px;
        background: #f8fbfa;
    }
    .follow-up-outcome-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .follow-up-outcome-form .field {
        display: grid;
        gap: 6px;
        min-width: 0;
        max-width: 100%;
    }
    .follow-up-outcome-form .field label {
        font-size: 12px;
        line-height: 1.35;
    }
    .follow-up-outcome-form .textarea,
    .follow-up-outcome-form .input,
    .follow-up-outcome-form .select {
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 46px;
        font-size: 16px;
    }
    .follow-up-outcome-form .textarea {
        min-height: 92px;
        resize: vertical;
    }
    .follow-up-outcome-form input[type="datetime-local"] {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
    .follow-up-outcome-form .btn {
        width: 100%;
        min-height: 46px;
        margin-top: 2px;
        font-size: 14px;
    }
    .todos-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .todo-compose-card {
        max-width: none;
        overflow: hidden;
    }
    .todo-compose-card .card-body {
        overflow: hidden;
        min-width: 0;
    }
    .todo-compose-form {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .todo-compose-form .field { margin-top: 12px; min-width: 0; max-width: 100%; }
    .todo-compose-form .split-fields {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .todo-compose-form .split-fields .field { margin-top: 12px; min-width: 0; }
    .todo-compose-form .input,
    .todo-compose-form .select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        font-size: 16px;
    }
    .todo-compose-form input[type="datetime-local"] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-right: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .todo-compose-actions { margin-top: 16px; }
    .todo-compose-actions .btn { width: 100%; min-width: 0; }
    .todo-row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 12px;
        width: 100%;
    }
    .todo-row-actions .btn,
    .todo-row-actions form,
    .todo-row-actions form .btn {
        width: 100%;
        min-width: 0;
    }
    .todo-upcoming-card .follow-up-card {
        display: flex;
        align-items: flex-start !important;
        gap: 12px;
        margin: 0;
        padding: 14px 18px !important;
        border: 0;
        border-top: 1px solid #eef1f0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .todo-upcoming-card .card-head + .follow-up-card { border-top: 0; }
    .todo-upcoming-card .follow-up-card > .due-date { width: 43px; height: 46px; flex: 0 0 43px; }
    .todo-upcoming-card .follow-up-card-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
    .todo-upcoming-card .follow-up-card-copy > strong {
        display: block;
        color: var(--ink);
        font-size: 13px;
        font-weight: 500;
        line-height: 1.4;
        overflow-wrap: anywhere;
        white-space: normal;
    }
    .todo-upcoming-card .follow-up-card-copy > small {
        display: block;
        margin-top: 4px;
        color: #5e6d75;
        font-size: 11px;
        line-height: 1.4;
        overflow-wrap: anywhere;
        white-space: normal;
    }
    .todo-upcoming-card .follow-up-card-status { align-self: flex-start; }
    .follow-ups-completed-card > .completed-follow-up-card { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 18px !important; border: 0; border-top: 1px solid #eef1f0; border-radius: 0; background: transparent; box-shadow: none; }
    .follow-ups-completed-card > .card-head + .completed-follow-up-card { border-top: 0; }
    .completed-follow-up-card .list-row-copy { min-width: 0; flex: 1; }
    .completed-follow-up-card .list-row-copy strong { color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
    .completed-follow-up-card .list-row-copy small { color: #5e6d75; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; white-space: normal; }
    .completed-follow-up-card > .badge { flex: 0 0 auto; }
}


/* Mobile app header, notifications, and first-open splash. */
.mobile-splash {
    display: none;
    pointer-events: none;
}
html.mobile-splash-pending,
html.mobile-splash-pending body {
    overflow: hidden !important;
    overscroll-behavior: none;
}
html.mobile-splash-pending .mobile-splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    pointer-events: auto;
    color: #fff;
    background: #018150;
    opacity: 1;
    transition: opacity .35s ease, visibility .35s ease;
}
.mobile-splash.is-leaving { visibility: hidden; opacity: 0; }
.mobile-splash-content {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 16px;
    animation: mobile-splash-rise .5s ease both;
}
.mobile-splash-logo {
    display: block;
    width: min(196px, 48vw);
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 36px;
    box-shadow: 0 16px 40px rgba(0, 54, 34, .28);
}
.mobile-splash-title {
    margin: 0;
    color: #fff;
    font: 700 28px/1.1 'Lato', 'Segoe UI', sans-serif;
    letter-spacing: -.4px;
    text-align: center;
}
.mobile-splash-content i {
    width: 46px;
    height: 2px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255,255,255,.28);
}
.mobile-splash-content i::after {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    content: '';
    animation: mobile-splash-progress .75s ease-in-out infinite alternate;
}

@keyframes mobile-splash-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mobile-splash-progress { from { transform: translateX(0); } to { transform: translateX(125%); } }
@media (prefers-reduced-motion: reduce) { .mobile-splash-content, .mobile-splash-content i::after { animation: none !important; } .mobile-splash { transition: none !important; } }

/* Top bar already carries the page title — don't repeat it in the page body. */
.content .page-heading > div:has(h2) { display: none; }
.content .page-heading h2 { display: none !important; }
.content .page-heading:not(:has(.btn)) { display: none; }
.content .page-heading:has(.btn-icon-circle):not(:has(.btn:not(.btn-icon-circle))) {
    margin: 0;
    min-height: 0;
}
.project-heading { display: none; }

@media (max-width: 820px) {
    .project-milestones-card > .list-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 12px 15px;
    }
    .project-milestones-card > .list-row > .list-row-copy {
        min-width: 0;
        flex: none;
        width: 100%;
    }
    .project-milestone-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
        align-items: center;
        gap: 6px;
        width: 100%;
        min-width: 0;
        flex: none;
    }
    .project-milestone-form .select {
        grid-column: auto;
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 6px 28px 6px 8px;
        background-position: right 7px center;
        background-size: 13px;
        font-size: 13px;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .project-milestone-form .project-milestone-save {
        display: grid;
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 50%;
        color: #fff;
        background: var(--green);
        box-shadow: 0 4px 11px rgba(19, 130, 105, .2);
    }
    .project-milestone-form .project-milestone-save svg {
        display: block;
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.2;
        stroke-linecap: round;
        stroke-linejoin: round;
        shape-rendering: geometricPrecision;
    }
}
