:root {
    color-scheme: dark;
    --ink: #0b0d12;
    --ink-soft: #11141c;
    --panel: #12151d;
    --panel-raised: #171b24;
    --line: #272c37;
    --line-soft: #202530;
    --gold: #f5c451;
    --gold-light: #ffe09a;
    --white: #f5f4f1;
    --muted: #9a9eaa;
    --faint: #696f7c;
    --blue: #70a9ff;
    --violet: #c29aff;
    --cyan: #6bd8e6;
    --amber: #ffbd70;
    --green: #70d6a1;
    --red: #ff8288;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: var(--ink);
    color: var(--white);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 87% 1%, rgba(245, 196, 81, .08), transparent 28rem),
        radial-gradient(ellipse at 6% 40%, rgba(79, 117, 180, .055), transparent 30rem),
        var(--ink);
    color: var(--white);
    line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 76px;
    padding: 0 clamp(20px, 5vw, 72px);
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: rgba(11, 13, 18, .92);
    backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; width: fit-content; }
.brand-mark, .footer-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 35px;
    height: 35px;
    border: 1px solid rgba(245,196,81,.55);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(245,196,81,.2), rgba(245,196,81,.04));
    color: var(--gold-light);
    font-size: 15px;
    font-weight: 800;
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 14px; letter-spacing: .035em; }
.brand-copy small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .17em; }

.main-nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.nav-link {
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    transition: color .18s ease, background .18s ease;
}
.nav-link:hover { color: var(--white); }
.nav-link.nav-active { background: #222630; color: var(--gold-light); }

.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 15px; }
.demo-pill, .footer-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d7c18b;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .14em;
    white-space: nowrap;
}
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(245,196,81,.7); }
.avatar-button, .icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #151922;
    color: var(--muted);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.avatar-button:hover, .icon-button:hover { border-color: var(--gold); color: var(--gold-light); transform: rotate(4deg); }

.page-content { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 64px; flex: 1; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 10px;
    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .2em;
}
.eyebrow-line { width: 18px; height: 1px; background: var(--gold); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(29px, 4vw, 42px); line-height: 1.1; letter-spacing: -.045em; font-weight: 720; }
h1 span { color: var(--gold-light); }
.hero-copy { margin-bottom: 0; color: var(--muted); font-size: 13px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary {
    background: linear-gradient(135deg, #f8d77f, #edb93f);
    color: #17130b;
    box-shadow: 0 5px 22px rgba(245,196,81,.14);
}
.button-primary:hover { background: linear-gradient(135deg, #ffe49a, #f3c75e); box-shadow: 0 7px 25px rgba(245,196,81,.23); }
.button-primary > span { font-size: 17px; line-height: 1; }
.button-secondary { border-color: var(--line); background: #181c25; color: #e7e5df; }
.button-secondary:hover { border-color: #50515a; background: #20242e; }

.safety-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid rgba(245,196,81,.22);
    border-radius: 12px;
    background: linear-gradient(100deg, rgba(245,196,81,.09), rgba(245,196,81,.025));
}
.safety-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 9px;
    background: rgba(245,196,81,.12);
    color: var(--gold-light);
    font-size: 18px;
}
.safety-banner strong { display: block; margin-bottom: 2px; color: #f6dfa7; font-size: 11px; }
.safety-banner p { margin: 0; color: #b7ad94; font-size: 10px; }
.text-button { margin-left: auto; padding: 8px; border: 0; background: transparent; color: #e5cc8e; cursor: pointer; font-size: 10px; white-space: nowrap; }
.text-button:hover { color: #fff0c8; text-decoration: underline; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card {
    position: relative;
    min-height: 130px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: linear-gradient(150deg, rgba(24,28,37,.98), rgba(16,19,26,.98));
    box-shadow: 0 9px 28px rgba(0,0,0,.12);
}
.metric-card::after {
    position: absolute;
    right: -25px;
    bottom: -48px;
    width: 100px;
    height: 100px;
    border: 1px solid rgba(255,255,255,.045);
    border-radius: 50%;
    content: "";
}
.metric-total { border-color: rgba(245,196,81,.24); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label { color: #a9acb6; font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.metric-glyph { color: var(--gold); font-size: 17px; }
.glyph-blue { color: var(--blue); }
.glyph-violet { color: var(--violet); }
.glyph-cyan { color: var(--cyan); }
.glyph-amber { color: var(--amber); }
.glyph-green { color: var(--green); }
.metric-value { margin: 11px 0 0; font-size: 33px; font-weight: 720; line-height: 1; letter-spacing: -.055em; }
.metric-foot { margin: 8px 0 0; color: var(--faint); font-size: 9px; }

.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.panel { border: 1px solid var(--line-soft); border-radius: 15px; background: rgba(18,21,29,.92); box-shadow: 0 12px 35px rgba(0,0,0,.12); }
.pipeline-panel, .followup-panel { min-height: 275px; padding: 21px 22px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading .eyebrow { margin-bottom: 4px; font-size: 8px; }
.panel-heading h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.quiet-button { padding: 6px 0 6px 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.quiet-button span { margin-left: 5px; color: var(--gold); }
.quiet-button:hover { color: var(--white); }
.pipeline-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; row-gap: 17px; margin-top: 25px; }
.pipeline-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.pipeline-name { color: #c4c6ce; font-size: 10px; }
.pipeline-count { color: #edeae2; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pipeline-track { height: 4px; overflow: hidden; border-radius: 5px; background: #272b35; }
.pipeline-fill { display: block; height: 100%; min-width: 0; border-radius: inherit; transition: width .45s ease; }
.width-0 { width: 0%; }
.width-5 { width: 5%; }
.width-10 { width: 10%; }
.width-15 { width: 15%; }
.width-20 { width: 20%; }
.width-25 { width: 25%; }
.width-30 { width: 30%; }
.width-35 { width: 35%; }
.width-40 { width: 40%; }
.width-45 { width: 45%; }
.width-50 { width: 50%; }
.width-55 { width: 55%; }
.width-60 { width: 60%; }
.width-65 { width: 65%; }
.width-70 { width: 70%; }
.width-75 { width: 75%; }
.width-80 { width: 80%; }
.width-85 { width: 85%; }
.width-90 { width: 90%; }
.width-95 { width: 95%; }
.width-100 { width: 100%; }
.fill-blue { background: var(--blue); }
.fill-violet { background: var(--violet); }
.fill-cyan { background: var(--cyan); }
.fill-amber { background: var(--amber); }
.fill-green { background: var(--green); }
.fill-muted { background: #7d8491; }
.radar-icon { color: var(--gold); font-size: 24px; }
.followup-list { display: grid; gap: 4px; margin-top: 15px; }
.followup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 9px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease;
}
.followup-item:hover { background: rgba(255,255,255,.045); }
.followup-copy { display: grid; min-width: 0; gap: 2px; }
.followup-copy strong { overflow: hidden; color: #e2e0db; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.followup-copy span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.followup-empty { display: grid; justify-items: center; gap: 5px; padding: 25px 10px; text-align: center; }
.followup-empty-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(112,214,161,.12); color: var(--green); }
.followup-empty strong { font-size: 11px; }
.followup-empty p { margin: 0; color: var(--muted); font-size: 9px; }

.recent-panel, .all-enquiries-panel { padding: 21px 22px 4px; }
.panel-heading-wrap { align-items: flex-end; margin-bottom: 17px; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 210px;
    height: 37px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #10131a;
    color: var(--muted);
}
.search-box > span:first-child { font-size: 18px; line-height: 1; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--white); font-size: 10px; }
.search-box input::placeholder { color: #757b88; }
.search-box:focus-within { border-color: rgba(245,196,81,.6); }
.table-wrap { width: 100%; overflow-x: auto; scrollbar-color: #373c47 #14171e; scrollbar-width: thin; }
.enquiry-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.enquiry-table th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    color: #757c89;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .13em;
    text-align: left;
    white-space: nowrap;
}
.enquiry-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.045); color: #d0cfc9; font-size: 10px; vertical-align: middle; }
.enquiry-table tbody tr:last-child td { border-bottom: 0; }
.enquiry-table tbody tr:hover { background: rgba(255,255,255,.018); }
.organisation-cell { min-width: 190px; }
.organisation-name { display: block; color: #f1efe9; font-size: 10px; font-weight: 650; }
.organisation-contact { display: block; margin-top: 3px; color: #858b97; font-size: 9px; }
.service-cell { max-width: 190px; color: #c1c2ca !important; }
.next-action-cell { max-width: 175px; color: #a8abb4 !important; }
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 650;
    white-space: nowrap;
}
.status-badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-blue { border-color: rgba(112,169,255,.2); background: rgba(112,169,255,.08); color: var(--blue); }
.status-violet { border-color: rgba(194,154,255,.2); background: rgba(194,154,255,.08); color: var(--violet); }
.status-cyan { border-color: rgba(107,216,230,.2); background: rgba(107,216,230,.08); color: var(--cyan); }
.status-amber { border-color: rgba(255,189,112,.2); background: rgba(255,189,112,.08); color: var(--amber); }
.status-green { border-color: rgba(112,214,161,.2); background: rgba(112,214,161,.08); color: var(--green); }
.status-muted { border-color: rgba(154,158,170,.2); background: rgba(154,158,170,.08); color: #a6aab3; }
.due-date { color: #9da2ac; font-size: 9px; white-space: nowrap; }
.due-overdue { color: var(--red); }
.due-today { color: var(--amber); }
.due-soon { color: #e4ce96; }
.row-actions { white-space: nowrap; }
.row-action { padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #a7abb5; cursor: pointer; font-size: 9px; }
.row-action:hover { border-color: var(--line); background: #1b2029; color: var(--gold-light); }
.row-action-delete:hover { border-color: rgba(255,130,136,.28); color: var(--red); }
.empty-state { padding: 35px 20px; text-align: center; }
.empty-orbit { display: block; margin-bottom: 8px; color: var(--gold); font-size: 23px; }
.empty-state strong { display: block; color: #e5e3dd; font-size: 12px; }
.empty-state p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }

.all-enquiries-panel { padding-bottom: 12px; }
.all-enquiries-panel .panel-heading { margin-bottom: 20px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 14px; }
.filter-row .search-box { flex: 1 1 250px; }
.select-filter select {
    height: 37px;
    min-width: 140px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #10131a;
    color: #d4d2cc;
    font-size: 10px;
}

.footer {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 12px clamp(20px, 5vw, 72px);
    border-top: 1px solid rgba(255,255,255,.06);
    background: rgba(12,14,19,.7);
}
.footer-mark { width: 25px; height: 25px; border-radius: 8px; font-size: 10px; }
.footer p { margin: 0; color: #848995; font-size: 9px; }
.footer p span { padding: 0 4px; color: #545a66; }
.footer-status { margin-left: auto; color: #a8a28f; font-size: 8px; }

.modal {
    width: min(650px, calc(100% - 28px));
    max-width: none;
    max-height: min(90vh, 850px);
    padding: 0;
    overflow: auto;
    border: 1px solid #363b46;
    border-radius: 17px;
    background: var(--panel);
    color: var(--white);
    box-shadow: 0 30px 100px rgba(0,0,0,.65);
}
.modal::backdrop { background: rgba(3,5,9,.78); backdrop-filter: blur(5px); }
.modal-card { padding: clamp(20px, 4vw, 30px); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.modal-heading .eyebrow { margin-bottom: 5px; }
.modal-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.icon-button { width: 32px; height: 32px; font-size: 21px; }
.modal-note { margin: -4px 0 20px; padding: 10px 12px; border-left: 2px solid var(--gold); border-radius: 0 7px 7px 0; background: rgba(245,196,81,.06); color: #c6b98f; font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; color: #c4c7cf; font-size: 10px; font-weight: 600; }
.field > span { display: inline; color: var(--gold); }
.field-wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 40px;
    padding: 10px 11px;
    border: 1px solid #303541;
    border-radius: 8px;
    outline: 0;
    background: #0e1117;
    color: #f0eee8;
    font-size: 11px;
    font-weight: 400;
}
.field input::placeholder, .field textarea::placeholder { color: #626977; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(245,196,81,.65); }
.field textarea { min-height: 82px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.modal-compact { width: min(490px, calc(100% - 28px)); }
.about-copy p { margin: 0 0 13px; color: #b5b8c0; font-size: 11px; }
.about-copy p:last-child { margin-bottom: 0; }
.about-copy strong { color: #f2d89c; }
.details-content { margin: 18px 0; }
.details-status { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.details-service { color: #c2c3cb; font-size: 10px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.detail-item { min-width: 0; padding: 11px; border: 1px solid var(--line-soft); border-radius: 9px; background: #10131a; }
.detail-label { color: #858b98; font-size: 8px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.detail-value { margin: 5px 0 0; overflow-wrap: anywhere; color: #e5e2dc; font-size: 10px; white-space: pre-wrap; }
.detail-updated { margin: 13px 0 0; color: var(--faint); font-size: 9px; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 20; display: grid; gap: 8px; width: min(330px, calc(100vw - 40px)); }
.toast { padding: 12px 15px; border: 1px solid #3c414c; border-radius: 10px; background: #1b2029; color: #e8e5de; font-size: 11px; box-shadow: 0 12px 40px rgba(0,0,0,.4); animation: toast-enter .2s ease-out; }
.toast-success { border-left: 3px solid var(--green); }
.toast-warning { border-left: 3px solid var(--amber); }
.toast-error { border-left: 3px solid var(--red); }
.toast-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes toast-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric-card { min-height: 120px; }
}

@media (max-width: 700px) {
    .topbar { grid-template-columns: 1fr auto; min-height: 66px; padding: 0 18px; }
    .main-nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; margin: 0 0 10px; }
    .topbar { padding-top: 8px; }
    .topbar-right { grid-column: 2; grid-row: 1; }
    .demo-pill { font-size: 8px; }
    .brand-mark { width: 32px; height: 32px; }
    .page-content { width: calc(100% - 32px); padding: 30px 0 42px; }
    .hero-row { align-items: flex-start; flex-direction: column; gap: 17px; }
    .hero-row > .button { width: 100%; }
    .safety-banner { align-items: flex-start; padding: 12px; }
    .safety-banner p { line-height: 1.45; }
    .text-button { padding-top: 1px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .metric-card { min-height: 112px; padding: 13px; }
    .metric-value { font-size: 29px; }
    .metric-label { font-size: 7px; letter-spacing: .1em; }
    .metric-foot { font-size: 8px; }
    .work-grid { grid-template-columns: 1fr; gap: 10px; }
    .pipeline-panel, .followup-panel { min-height: 0; padding: 17px; }
    .pipeline-list { column-gap: 18px; row-gap: 14px; margin-top: 20px; }
    .recent-panel, .all-enquiries-panel { padding: 17px 14px 5px; }
    .panel-heading-wrap { align-items: flex-start; flex-direction: column; gap: 13px; }
    .heading-actions { width: 100%; }
    .heading-actions .search-box { flex: 1; min-width: 0; }
    .heading-actions .button { flex: 0 0 auto; padding: 0 10px; font-size: 10px; }
    .filter-row { align-items: stretch; }
    .filter-row .search-box { flex-basis: 100%; }
    .select-filter { flex: 1; }
    .select-filter select { width: 100%; min-width: 0; }
    .footer { padding: 12px 16px; }
    .footer p { font-size: 8px; }
    .footer-status { font-size: 7px; }
}

@media (max-width: 420px) {
    .topbar-right { gap: 8px; }
    .demo-pill { letter-spacing: .07em; }
    .metric-card { padding: 11px; }
    .metric-label { white-space: normal; }
    .metric-top { align-items: flex-start; }
    .safety-banner { gap: 9px; }
    .text-button { font-size: 9px; }
    .heading-actions .button { font-size: 0; gap: 0; }
    .heading-actions .button span { font-size: 15px; }
    .form-grid, .details-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .modal-actions { flex-wrap: wrap; }
    .modal-actions .button { flex: 1; }
    .footer-mark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
