:root {
    --ridge-red: #cd0733;
    --ridge-red-dark: #990225;
    --ridge-red-soft: #fff0f3;
    --ridge-gold: #f3d571;
    --ridge-gold-dark: #a87800;
    --charcoal: #151515;
    --ink: #29272a;
    --muted: #716b70;
    --canvas: #f7f5f1;
    --paper: #ffffff;
    --line: #e7e1da;
    --success: #16794b;
    --warning: #a45a00;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(28, 17, 20, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
a { color: var(--ridge-red); text-decoration: none; }
a:hover { color: var(--ridge-red-dark); }
img { max-width: 100%; }
.container { width: min(1160px, calc(100% - 36px)); margin-inline: auto; }
.gap-top { margin-top: 20px; }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.public-flashes { margin-top: 18px; }
.compact-form { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.public-header {
    background: rgba(255,255,255,.95);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
}
.public-header .container { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--charcoal); font-weight: 800; letter-spacing: -.02em; }
.brand img { width: 62px; height: 62px; object-fit: contain; }
.brand small { display: block; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.public-nav { display: flex; align-items: center; gap: 26px; font-weight: 700; }
.public-nav a:not(.btn) { color: var(--ink); }

.hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 76px;
    background: linear-gradient(125deg, #fff 0%, #fff8ea 52%, #fde7ed 100%);
}
.hero::after {
    content: "";
    position: absolute;
    width: 430px;
    height: 430px;
    border: 64px solid rgba(205,7,51,.08);
    border-radius: 50%;
    right: -130px;
    top: -170px;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; }
.eyebrow { color: var(--ridge-red); text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin: 12px 0 20px; color: var(--charcoal); font-size: clamp(2.7rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.06em; }
.hero-copy p { max-width: 680px; color: var(--muted); font-size: 1.12rem; }
.hero-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.trust-card { background: var(--charcoal); color: white; padding: 36px; border-radius: 28px; box-shadow: var(--shadow); }
.trust-card h2 { font-size: 1.65rem; }
.trust-list { display: grid; gap: 18px; padding: 0; margin: 28px 0 0; list-style: none; }
.trust-list li { display: grid; grid-template-columns: 34px 1fr; align-items: start; gap: 12px; }
.trust-list span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--charcoal); background: var(--ridge-gold); font-weight: 900; }

.section { padding: 88px 0; }
.section-heading { max-width: 720px; margin-bottom: 38px; }
.section-heading h2 { margin: 8px 0 12px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -.045em; color: var(--charcoal); }
.section-heading p { color: var(--muted); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.service-card { padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(28,17,20,.04); }
.service-card::before { content: ""; display: block; width: 42px; height: 5px; margin-bottom: 24px; border-radius: 8px; background: linear-gradient(90deg, var(--ridge-red) 0 66%, var(--ridge-gold) 66%); }
.service-card h3 { margin-bottom: 6px; }
.service-card p { color: var(--muted); margin-bottom: 0; }

.enquiry-section { background: var(--charcoal); color: white; }
.enquiry-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: 54px; align-items: start; }
.enquiry-intro { position: sticky; top: 115px; }
.enquiry-intro h2 { margin: 8px 0 15px; font-size: clamp(2.2rem, 4.5vw, 4rem); line-height: 1; letter-spacing: -.05em; }
.enquiry-intro p { color: #cfc8cb; }
.enquiry-card { padding: 34px; border-radius: 24px; background: white; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 800; font-size: .88rem; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #d8d2cc;
    border-radius: 10px;
    background: white;
    color: var(--ink);
    outline: none;
}
.field textarea { min-height: 118px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ridge-red); box-shadow: 0 0 0 3px rgba(205,7,51,.12); }
.field-hint { color: var(--muted); font-size: .78rem; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: .85rem; color: var(--muted); }
.consent input { width: 18px; height: 18px; accent-color: var(--ridge-red); flex: none; margin-top: 2px; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 850;
    transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--ridge-red); border-color: var(--ridge-red); }
.btn-primary:hover { color: white; background: var(--ridge-red-dark); }
.btn-gold { color: var(--charcoal); background: var(--ridge-gold); border-color: var(--ridge-gold); }
.btn-outline { color: var(--ink); background: transparent; border-color: #ccc4bd; }
.btn-outline:hover { color: var(--ridge-red); border-color: var(--ridge-red); }
.btn-danger { color: white; background: var(--danger); }
.btn-small { min-height: 36px; padding: 7px 12px; font-size: .82rem; }
.btn-block { width: 100%; }
.link-button { padding: 0; border: 0; color: var(--ridge-red); background: transparent; cursor: pointer; font-weight: 800; }

.public-footer { padding: 30px 0; background: #0c0c0d; color: #c8c3c5; }
.public-footer .container { display: flex; justify-content: space-between; gap: 24px; }

.flash-stack { display: grid; gap: 9px; margin-bottom: 20px; }
.flash { padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: .92rem; }
.flash-success { color: #0c5736; background: #eaf8f0; border-color: #bde4ce; }
.flash-error { color: #8f1d14; background: #fff0ee; border-color: #f4b8b2; }
.flash-warning { color: #795000; background: #fff7df; border-color: #efd68e; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-visual { padding: 60px; display: flex; flex-direction: column; justify-content: space-between; color: white; background: linear-gradient(145deg, var(--charcoal), #34000c); }
.auth-visual .brand { color: white; }
.auth-quote { max-width: 520px; }
.auth-quote h1 { color: white; font-size: clamp(2.4rem, 5vw, 4.8rem); }
.auth-quote p { color: #d6ccd0; }
.auth-panel { display: grid; place-items: center; padding: 36px; background: white; }
.auth-card { width: min(460px, 100%); }
.auth-card h1 { margin-bottom: 10px; font-size: 2.3rem; }
.auth-card > p { color: var(--muted); }
.stack { display: grid; gap: 16px; }

.admin-body { background: #f5f3f0; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 23px 18px; display: flex; flex-direction: column; color: white; background: var(--charcoal); }
.sidebar .brand { color: white; padding: 0 9px 22px; border-bottom: 1px solid #373335; }
.sidebar .brand img { width: 48px; height: 48px; }
.sidebar .brand small { color: #bcb4b7; }
.side-nav { display: grid; gap: 5px; margin-top: 22px; }
.side-nav a { padding: 11px 13px; border-radius: 9px; color: #d6d0d2; font-weight: 750; }
.side-nav a:hover, .side-nav a.active { color: white; background: var(--ridge-red); }
.sidebar-user { margin-top: auto; padding: 18px 9px 0; border-top: 1px solid #373335; }
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user span { margin: 2px 0 12px; color: #aaa2a5; font-size: .78rem; overflow-wrap: anywhere; }
.admin-main { min-width: 0; }
.admin-topbar { min-height: 76px; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.admin-topbar h1 { margin: 0; font-size: 1.24rem; letter-spacing: -.02em; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.mobile-menu { display: none; }
.admin-content { padding: 28px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric { min-height: 132px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 7px 26px rgba(28,17,20,.035); }
.metric span { color: var(--muted); font-size: .82rem; font-weight: 750; }
.metric strong { display: block; margin-top: 10px; color: var(--charcoal); font-size: 2rem; line-height: 1; }
.metric.red { border-top: 4px solid var(--ridge-red); }
.metric.gold { border-top: 4px solid var(--ridge-gold); }
.metric.warning { border-top: 4px solid #e18a22; }
.metric.success { border-top: 4px solid var(--success); }

.admin-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px,.55fr); gap: 20px; }
.card { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 7px 26px rgba(28,17,20,.035); }
.card-header { min-height: 66px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.02rem; }
.card-body { padding: 20px; }
.card + .card { margin-top: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #eee9e5; text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #fbfaf8; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: .88rem; }
tbody tr:hover { background: #fffaf6; }
.table-link { color: var(--ink); font-weight: 850; }
.subtle { color: var(--muted); font-size: .8rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 5px 9px; font-size: .7rem; font-weight: 850; text-transform: capitalize; white-space: nowrap; }
.badge-new, .badge-urgent { color: #99112f; background: #ffe6ec; }
.badge-approved, .badge-completed { color: #11633e; background: #e5f6ec; }
.badge-rejected, .badge-spam { color: #9b251d; background: #ffebe8; }
.badge-under_review, .badge-application_submitted, .badge-high { color: #765000; background: #fff3c9; }
.badge-contacted, .badge-follow_up_required, .badge-documents_pending { color: #27567a; background: #e8f3fb; }
.badge-normal, .badge-low, .badge-no_response { color: #5a5558; background: #eeeceb; }

.filters { margin-bottom: 18px; padding: 16px; display: grid; grid-template-columns: 1.6fr repeat(3, minmax(140px, .7fr)) auto; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.filters input, .filters select { min-height: 42px; padding: 8px 10px; border: 1px solid #d8d2cc; border-radius: 9px; background: white; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 5px; font-size: 1.75rem; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); }
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 16px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.pagination .current { color: white; background: var(--ridge-red); border-color: var(--ridge-red); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px,.75fr); gap: 20px; align-items: start; }
.detail-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.detail-item span { display: block; color: var(--muted); font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.detail-item strong { display: block; margin-top: 5px; font-size: .94rem; overflow-wrap: anywhere; }
.message-box { margin-top: 20px; padding: 18px; border-radius: 11px; background: #faf8f6; white-space: pre-wrap; }
.timeline { display: grid; gap: 13px; }
.timeline-item { position: relative; padding: 15px 15px 15px 18px; border-left: 3px solid var(--ridge-gold); border-radius: 8px; background: #faf8f6; }
.timeline-item p { margin: 6px 0 0; white-space: pre-wrap; }
.timeline-item header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .75rem; }
.danger-zone { border-color: #f3c2bc; }
.danger-zone .card-header { color: var(--danger); }
.security-note { padding: 14px; border-left: 4px solid var(--ridge-gold); background: #fff9e8; font-size: .86rem; }
.code-box { padding: 15px; border-radius: 10px; background: #161416; color: var(--ridge-gold); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); }
.install-wrap { padding: 48px 0 80px; }
.install-card { max-width: 860px; margin: auto; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.requirements { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 20px 0; }
.requirement { display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: 8px; background: #f8f6f3; }
.requirement.ok::before { content: "✓"; color: var(--success); font-weight: 900; }
.requirement.fail::before { content: "×"; color: var(--danger); font-weight: 900; }

@media (max-width: 1050px) {
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .admin-grid, .detail-grid { grid-template-columns: 1fr; }
    .filters { grid-template-columns: repeat(2, 1fr); }
    .filters .btn { grid-column: span 2; }
}
@media (max-width: 820px) {
    .hero-grid, .enquiry-grid, .auth-shell { grid-template-columns: 1fr; }
    .trust-card { max-width: 620px; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .enquiry-intro { position: static; }
    .auth-visual { display: none; }
    .admin-shell { display: block; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; z-index: 60; transform: translateX(-105%); transition: transform .2s ease; }
    .admin-shell.menu-open .sidebar { transform: translateX(0); }
    .mobile-menu { display: inline-flex; }
    .admin-content, .admin-topbar { padding-inline: 18px; }
}
@media (max-width: 620px) {
    .public-nav a:not(.btn) { display: none; }
    .brand strong { font-size: .9rem; }
    .hero { padding-top: 62px; }
    .section { padding: 62px 0; }
    .services-grid, .form-grid, .metrics, .detail-list, .requirements { grid-template-columns: 1fr; }
    .enquiry-card { padding: 22px; }
    .field.full { grid-column: auto; }
    .public-footer .container, .page-head { align-items: flex-start; flex-direction: column; }
    .filters { grid-template-columns: 1fr; }
    .filters .btn { grid-column: auto; }
    .admin-content { padding: 18px 12px; }
    .topbar-actions .btn { display: none; }
    .recovery-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
