:root {
    --bg: #f5f8fb;
    --surface: #ffffff;
    --surface-alt: #ecf2f8;
    --text: #132238;
    --muted: #607086;
    --border: #d8e3ef;
    --dark: #0f1b2e;
    --accent: #1cc6bb;
    --accent-dark: #0ea59b;
    --violet: #6f67ff;
    --shadow: 0 18px 50px rgba(15, 27, 46, 0.08);
    --radius: 28px;
    --radius-sm: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}
.topbar {
    background: var(--dark);
    color: #d4e2f2;
    font-size: 14px;
}
.topbar-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
}
.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(245, 248, 251, 0.95);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(216, 227, 239, 0.8);
}
.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}
.brand strong {
    display: block;
    font-size: 14px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.brand small {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
}
.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #ffffff;
    border: 1px solid var(--border);
    overflow: hidden;
    padding: 4px;
    box-shadow: 0 6px 16px rgba(15, 27, 46, 0.1);
}
.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    background: var(--surface);
}
.lang-switch a {
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.04em;
    line-height: 1;
}
.lang-switch a.active {
    background: var(--dark);
    color: #fff;
}
.menu-toggle {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 999px;
}
.site-nav {
    display: none;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 12px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.site-nav.is-open { display: flex; }
.site-nav a {
    padding: 12px 16px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
}
.site-nav a.active,
.site-nav a:hover,
.section-nav a.active-pill {
    background: var(--dark);
    color: #fff;
}
.button,
.button-outline,
button.button,
button.button-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    padding: 14px 22px;
    border: 0;
    font-weight: 700;
    cursor: pointer;
}
.button { background: var(--dark); color: #fff; }
.button:hover,
.button-outline:hover { opacity: 0.96; }
.button-accent { background: var(--accent); color: var(--dark); }
.button-outline {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.small-button { padding: 10px 16px; font-size: 14px; }
.danger-button { color: #b24343; border-color: #efcccc; }
.flash {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 20px;
    font-weight: 600;
}
.flash-success { background: #dff7f4; color: #0f6b64; }
.flash-error { background: #fde8e8; color: #b24343; }
.flash-info { background: #e7f0fb; color: #1f4f86; }
.section { padding: 64px 0; }
.grid { display: grid; gap: 22px; }
.gap-large { gap: 28px; }
.hero { padding: 40px 0 28px; }
.hero-grid { display: grid; gap: 28px; }
.card,
.stat-card,
.panel,
.service-card,
.project-card,
.info-card,
.table-card,
.form-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(216, 227, 239, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel-dark {
    background: var(--dark);
    color: #fff;
    border: 0;
}
.card-body,
.panel-body,
.service-card,
.project-card,
.info-card,
.table-card,
.form-card { padding: 28px; }
.narrow-card { max-width: 720px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #dff7f4;
    color: #0f6b64;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 800;
}
.eyebrow-dark {
    background: rgba(255, 255, 255, 0.1);
    color: #7dece5;
}
.hero h1,
.page-hero h1,
.invoice-sheet h1 { font-size: clamp(2.4rem, 6vw, 4.7rem); line-height: 1.05; margin: 16px 0; }
.hero p,
.page-hero p,
.lead { color: var(--muted); font-size: 18px; line-height: 1.75; }
.panel-dark .lead { color: #c8d6e8; }
.hero-actions,
.inline-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.stats-grid,
.services-grid,
.projects-grid,
.dashboard-grid,
.footer-grid,
.split-grid,
.form-grid { display: grid; gap: 22px; }
.stat-card h3 { font-size: 2rem; margin: 0 0 10px; }
.service-card h3,
.project-card h3,
.table-card h3,
.form-card h3,
.panel h3,
.stack-item h3 { margin-top: 0; font-size: 1.55rem; }
.service-meta,
.project-tags,
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pill,
.project-tag,
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}
.status-open { background: #e5f0ff; color: #23589b; }
.status-progress { background: #fff1d8; color: #9a6400; }
.status-closed, .status-paid, .status-won { background: #def7e9; color: #146a45; }
.status-due, .status-requested, .status-reviewing, .status-issued { background: #eeeafd; color: #5849b7; }
.status-overdue { background: #fde8e8; color: #b24343; }
.media-frame {
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid rgba(216, 227, 239, 0.9);
    box-shadow: var(--shadow);
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.check-list { padding: 0; margin: 18px 0 0; list-style: none; }
.check-list li { padding: 14px 0; border-bottom: 1px solid rgba(216, 227, 239, 0.75); }
.check-list li:last-child { border-bottom: 0; }
.form-card form,
.form-stack { display: grid; gap: 16px; }
input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    background: #f9fbfd;
    border-radius: 18px;
    padding: 14px 16px;
    color: var(--text);
}
textarea { min-height: 150px; resize: vertical; }
label { display: grid; gap: 8px; font-weight: 700; color: var(--text); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid rgba(216, 227, 239, 0.75); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); }
.hero-visual {
    min-height: 100%;
    display: grid;
    gap: 18px;
}
.page-hero { padding: 34px 0 10px; }
.page-hero-box { padding: 34px; }
.notice {
    border-radius: 22px;
    padding: 18px 20px;
    background: #fff7df;
    color: #7b5c00;
    border: 1px solid #f0dfaa;
}
.footer-grid { padding: 34px 0 48px; }
.site-footer { background: var(--dark); color: #dce7f2; margin-top: 70px; }
.footer-copy { color: #aebfd2; max-width: 420px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: #dce7f2; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.social-links a {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}
.call-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 60;
    background: var(--accent);
    color: var(--dark);
    font-weight: 800;
    padding: 14px 22px;
    border-radius: 999px;
    box-shadow: 0 18px 45px rgba(28, 198, 187, 0.35);
}
.kicker { color: var(--muted); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; font-weight: 800; }
.muted { color: var(--muted); }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.auth-shell { max-width: 1100px; }
.section-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.section-nav a { padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; }
.stack-list { display: grid; gap: 16px; }
.stack-item {
    border: 1px solid rgba(216, 227, 239, 0.75);
    border-radius: 22px;
    padding: 20px;
    background: #fbfdff;
}
.table-card-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 18px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.top-space { margin-top: 14px; }
.invoice-summary { display: flex; flex-wrap: wrap; gap: 12px; font-weight: 700; color: var(--muted); }
.invoice-page { background: #edf3f9; padding: 24px; }
.invoice-sheet {
    max-width: 960px;
    margin: 0 auto;
    background: #fff;
    padding: 36px;
    border-radius: 28px;
    box-shadow: var(--shadow);
}
.invoice-grid { display: grid; gap: 22px; margin: 30px 0; }
.invoice-meta { text-align: left; }
.invoice-total {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(216, 227, 239, 0.8);
}
@media (min-width: 760px) {
    .topbar-inner { flex-direction: row; justify-content: space-between; align-items: center; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .split-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .invoice-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
    .menu-toggle { display: none; }
    .site-nav {
        display: flex;
        position: static;
        flex-direction: row;
        align-items: center;
        background: transparent;
        border: 0;
        padding: 0;
        box-shadow: none;
    }
    .hero-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; }
    .services-grid { grid-template-columns: repeat(4, 1fr); }
    .projects-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-grid { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
    .split-grid.portal { grid-template-columns: 0.9fr 1.1fr; }
    .split-grid.admin { grid-template-columns: 0.92fr 1.08fr; }
}
@media print {
    .hero-actions,
    .call-float { display: none !important; }
    .invoice-page { padding: 0; background: #fff; }
    .invoice-sheet { box-shadow: none; border-radius: 0; max-width: none; }
}

/* ---- Partner logo cloud (managed from admin ▸ Partners) ---- */
.partners { padding-top: 8px; }
.partners-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 28px;
}
.partners-head h2 { margin: 8px 0 0; }

.partner-cloud {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 22px 40px;
    padding: clamp(28px, 5vw, 60px) clamp(20px, 5vw, 64px);
    background:
        radial-gradient(120% 140% at 15% 0%, rgba(28, 198, 187, 0.10), transparent 55%),
        radial-gradient(120% 140% at 85% 100%, rgba(111, 103, 255, 0.08), transparent 55%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: 96px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.partner-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    opacity: 0.92;
    transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
a.partner-chip:hover {
    color: var(--accent-dark);
    opacity: 1;
    transform: translateY(-2px);
}

/* Size tiers give the organic, varied "cloud" rhythm. */
.partner-chip--sm { font-size: clamp(0.95rem, 1.6vw, 1.15rem); }
.partner-chip--md { font-size: clamp(1.15rem, 2.2vw, 1.6rem); }
.partner-chip--lg { font-size: clamp(1.45rem, 3vw, 2.15rem); }
.partner-chip--xl { font-size: clamp(1.8rem, 4vw, 2.8rem); }

/* Uploaded logo images sit in the same rhythm, sized per tier. */
.partner-chip.has-logo { opacity: 0.85; }
.partner-chip.has-logo:hover { opacity: 1; }
.partner-chip.has-logo img { width: auto; object-fit: contain; }
.partner-chip--sm.has-logo img { height: 26px; }
.partner-chip--md.has-logo img { height: 34px; }
.partner-chip--lg.has-logo img { height: 46px; }
.partner-chip--xl.has-logo img { height: 58px; }

/* Admin: partner list + logo previews */
.partner-row-main { display: flex; align-items: center; gap: 14px; }
.partner-row-logo img { height: 30px; width: auto; object-fit: contain; }
.partner-logo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}
.partner-logo-preview img { height: 48px; width: auto; object-fit: contain; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

@media (max-width: 720px) {
    .partner-cloud { gap: 16px 26px; border-radius: 48px; }
    .partner-chip--xl.has-logo img { height: 44px; }
    .partner-chip--lg.has-logo img { height: 38px; }
}

/* ---- Booking calendar & inquiry-visit picker ---- */
.booking-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .booking-layout { grid-template-columns: 1fr; } }

.cal-wrap { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 860px) { .cal-wrap { position: static; } }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow); }
.cal-head { font-weight: 700; text-align: center; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal-cell {
    position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 13px; color: var(--text); border: 1px solid transparent;
}
.cal-cell.empty { border: 0; }
.cal-cell.past { color: #b6c2d0; }
.cal-cell .dnum { line-height: 1; }
a.cal-cell.has {
    background: var(--accent); color: #04312e; font-weight: 700; border-color: var(--accent-dark);
    transition: transform .12s ease, box-shadow .12s ease;
}
a.cal-cell.has:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(28,198,187,.35); }
.cal-cell .dcount {
    position: absolute; top: 3px; right: 4px; font-size: 9px; font-weight: 700;
    background: #04312e; color: #fff; border-radius: 999px; min-width: 14px; height: 14px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.cal-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 2px 0 0; }
.cal-legend .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); display: inline-block; }

.booking-form .day-slots {
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0 0;
    scroll-margin-top: 16px;
}
.booking-form .day-slots legend { font-weight: 700; padding: 0 6px; font-size: 14px; }
.booking-form .day-slots:target { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28,198,187,.18); }

/* ---- Booking calendar v2: clickable day buttons + time panels ---- */
button.cal-cell { font: inherit; width: 100%; cursor: pointer; background: none; }
.cal-cell.has { background: var(--accent); color: #04312e; font-weight: 700; border-color: var(--accent-dark); transition: transform .12s ease, box-shadow .12s ease; }
.cal-cell.has:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(28,198,187,.35); }
.cal-cell.full { background: #f1f4f8; color: #98a4b3; border-color: var(--border); }
.cal-cell.full:hover { border-color: #c3ccd8; }
.cal-cell.selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.cal-cell .dfull { position: absolute; bottom: 2px; left: 0; right: 0; font-size: 7.5px; letter-spacing: .03em; text-transform: uppercase; }
.cal-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin: 2px 0 0; flex-wrap: wrap; }
.cal-legend .dot-full { background: #cdd6e0; }

.slot-panel { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 10px; background: var(--surface); }
.slot-panel[hidden] { display: none; }
.slot-panel-date { font-weight: 700; margin: 0 0 10px; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.time-chip { position: relative; display: block; }
.time-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.time-chip > span { display: flex; align-items: center; justify-content: center; padding: 11px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 14px; text-align: center; cursor: pointer; transition: .12s; }
.time-chip input:checked + span { border-color: var(--accent-dark); background: var(--accent); color: #04312e; font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent-dark); }
.time-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(28,198,187,.25); }
.time-chip--booked > span { flex-direction: column; gap: 2px; cursor: not-allowed; background: #f1f4f8; color: #9aa6b4; border-style: dashed; }
.time-chip--booked small { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }

/* ---- Admin bookings: assessment badge + summary peek ---- */
.booking-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.assess-pill { background: #def7e9; color: #146a45; }
.assess-peek { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.assess-peek > summary { cursor: pointer; padding: 11px 15px; font-weight: 700; font-size: 14px; list-style: none; }
.assess-peek > summary::-webkit-details-marker { display: none; }
.assess-peek > summary::before { content: "▸ "; color: var(--muted); }
.assess-peek[open] > summary::before { content: "▾ "; }
.assess-peek[open] > summary { border-bottom: 1px solid var(--border); }
.assess-peek-body { padding: 12px 15px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; color: var(--text); max-height: 300px; overflow: auto; }

/* ---- Invoice builder (staff) ---- */
.li-table { width: 100%; border-collapse: collapse; }
.li-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; }
.li-table td { padding: 6px 8px; vertical-align: middle; }
.li-table input { padding: 10px; }
.li-amt { font-weight: 700; white-space: nowrap; text-align: right; }
.li-total-row { display: flex; justify-content: flex-end; align-items: baseline; gap: 16px; padding: 14px 8px; border-top: 2px solid var(--border); margin-top: 6px; font-size: 18px; }
.li-total-row strong { font-size: 26px; }
.li-del { line-height: 1; }
