/* =====================================================================
   CIVIFLUX PORTAL - stylesheet
   Palette taken from the existing civifluxeng.co.ke site. No gradients.
   navy #003366 | dark #001f3f | yellow #ffcc00 | blue #004aad | hover #0055aa
   ===================================================================== */
:root {
  --navy: #003366;
  --dark: #001f3f;
  --yellow: #ffcc00;
  --blue: #004aad;
  --blue-hover: #0055aa;
  --icon: #0056b3;
  --soft: #e6f0f8;
  --light: #f9f9f9;
  --light2: #f8f9fb;
  --grey: #f4f4f4;
  --text: #333;
  --muted: #666;
  --line: #ccc;
  --line-soft: #e3e3e3;
  --ok: #2e7d32;
  --bad: #c62828;
  --radius: 3px;
  --radius-card: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Arial, sans-serif; color: var(--text); background: #fff; line-height: 1.6; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
h1, h2, h3, h4 { line-height: 1.25; margin-top: 0; }
p { margin-top: 0; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.mt { margin-top: 20px; } .mt-lg { margin-top: 40px; } .mb { margin-bottom: 20px; }
.sr { position: absolute; left: -9999px; }

/* ---------------------------------------------------------------- header */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 20px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 1000; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand img { display: block; width: 100%; max-width: 150px; height: auto; background: #fff; }
.clock { font-family: monospace; font-size: 1rem; font-weight: bold; color: var(--text); background: var(--yellow); padding: 5px 10px; border-radius: var(--radius); border-left: 3px solid var(--icon); min-width: 105px; text-align: center; white-space: nowrap; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 20px; margin: 0; padding: 0; }
.main-nav a { color: #fff; text-decoration: none; font-weight: bold; }
.main-nav a:hover, .main-nav a.active { color: var(--yellow); }
.main-nav .btn { color: var(--navy); }
.menu-toggle { display: none; background: transparent; border: 0; color: #fff; font-size: 24px; cursor: pointer; padding: 6px 10px; }

/* ---------------------------------------------------------------- buttons (flat, small radius) */
.btn { display: inline-block; background: var(--navy); color: #fff; border: 2px solid var(--navy); padding: 10px 20px; border-radius: var(--radius); font: bold 1rem Arial, sans-serif; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s; text-align: center; line-height: 1.3; }
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn-yellow { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.btn-yellow:hover { background: #e6b800; border-color: #e6b800; color: var(--navy); }
.btn-outline { background: transparent; color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-light { background: #fff; color: var(--navy); border-color: #fff; }
.btn-light:hover { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .85rem; }
.btn-block { display: block; width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
form.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------------- flash */
.flashes { max-width: 1100px; margin: 14px auto 0; padding: 0 20px; }
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 10px; border-left: 4px solid var(--blue); background: var(--soft); color: var(--dark); font-size: .95rem; }
.flash-success { border-color: var(--ok); background: #eaf5ea; }
.flash-error { border-color: var(--bad); background: #fbeaea; }
.flash-info { border-color: var(--blue); background: var(--soft); }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; height: 100vh; min-height: 460px; max-height: 760px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: #fff; overflow: hidden; background: var(--dark); padding: 20px; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.active { opacity: 1; }
.hero::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .5); pointer-events: none; }
.hero > *:not(.hero-slide) { position: relative; z-index: 1; }
.hero h1 { font-size: 3em; margin-bottom: 8px; animation: fadeInDown 1.6s; }
.hero p { font-size: 1.4em; margin: 10px 0 24px; animation: fadeInUp 1.6s; }
.hero .btn-row { justify-content: center; animation: zoomIn 1.6s; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

.page-hero { background: var(--navy); color: #fff; padding: 38px 20px; text-align: center; }
.page-hero h1 { margin: 0 0 6px; font-size: 2rem; }
.page-hero p { margin: 0; color: #dbe6f2; }
.crumbs { font-size: .85rem; margin-bottom: 8px; color: #b9c9db; }
.crumbs a { color: var(--yellow); text-decoration: none; }

/* ---------------------------------------------------------------- sections */
.section { padding: 60px 20px; }
.section.alt { background: var(--light); }
.section.alt2 { background: var(--light2); }
.section-title { text-align: center; margin: 0 0 36px; font-size: 2rem; color: var(--navy); }
.section-title::after { content: ""; display: block; width: 60px; height: 4px; background: var(--yellow); margin: 12px auto 0; }
.grid { display: grid; gap: 20px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card { background: #fff; border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 2px 6px rgba(0, 0, 0, .1); transition: transform .25s; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
a.card:hover, .card.lift:hover { transform: translateY(-6px); }
.card img.cover { width: 100%; height: 220px; object-fit: cover; display: block; background: var(--grey); }
.card-body { padding: 18px 20px; flex: 1; }
.card-body h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--navy); }
.card-body p { margin-bottom: 0; font-size: .95rem; }
.card-meta { font-size: .8rem; color: var(--muted); margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tag { display: inline-block; font-size: .75rem; font-weight: bold; padding: 2px 8px; border-radius: var(--radius); background: var(--soft); color: var(--navy); }
.tag-yellow { background: var(--yellow); color: var(--navy); }

.about-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.about-wrap img { width: 100%; border-radius: var(--radius-card); box-shadow: 0 6px 15px rgba(0, 0, 0, .1); }
.highlight { background: var(--soft); padding: 15px; border-left: 4px solid var(--blue); }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.features li { display: flex; gap: 14px; background: #fff; padding: 14px 16px; border-radius: var(--radius-card); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.features i { color: var(--icon); font-size: 1.3rem; margin-top: 4px; width: 26px; text-align: center; }
.value-item { background: #fff; padding: 20px; border-radius: var(--radius-card); box-shadow: 0 2px 6px rgba(0, 0, 0, .1); border-top: 4px solid var(--icon); text-align: center; }
.value-item h3 { color: var(--navy); }

.stats { background: var(--navy); color: #fff; padding: 40px 20px; }
.stats .grid { max-width: 1100px; margin: 0 auto; text-align: center; }
.stat b { display: block; font-size: 2.4rem; color: var(--yellow); line-height: 1.1; }
.stat span { font-size: .95rem; color: #dbe6f2; }

.cta-band { background: var(--navy); color: #fff; text-align: center; padding: 46px 20px; }
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: #dbe6f2; }

.testimonial { padding: 22px; background: var(--grey); border-radius: var(--radius-card); border-left: 4px solid var(--yellow); }
.testimonial p { font-style: italic; margin-bottom: 12px; }
.testimonial strong { color: var(--navy); }

.clients-slider { overflow: hidden; width: 100%; }
.clients-track { display: flex; width: max-content; animation: scrollLeft 40s linear infinite; align-items: center; }
.clients-slider:hover .clients-track { animation-play-state: paused; }
.clients-track img { height: 70px; width: auto; max-width: 180px; object-fit: contain; margin: 0 30px; }
@keyframes scrollLeft { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 24px; align-items: center; justify-items: center; }
.logo-grid img { max-height: 70px; max-width: 100%; object-fit: contain; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--navy); font-weight: bold; }
.pager .current { background: var(--navy); color: #fff; border-color: var(--navy); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery img { width: 100%; height: 150px; object-fit: cover; cursor: zoom-in; border-radius: var(--radius); }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); display: none; align-items: center; justify-content: center; z-index: 3000; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; }
.lightbox button { position: absolute; top: 14px; right: 18px; background: var(--yellow); border: 0; font-size: 22px; width: 40px; height: 40px; cursor: pointer; border-radius: var(--radius); }

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; align-items: start; }
.facts { background: var(--light); border: 1px solid var(--line-soft); border-radius: var(--radius-card); padding: 18px 20px; }
.facts dl { margin: 0; }
.facts dt { font-size: .78rem; text-transform: uppercase; color: var(--muted); margin-top: 12px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 2px 0 0; font-weight: bold; color: var(--navy); }

/* ---------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: .95rem; }
table.data th, table.data td { border: 1px solid var(--line-soft); padding: 10px 12px; text-align: left; vertical-align: middle; }
table.data th { background: var(--grey); color: var(--navy); font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
table.data tbody tr:nth-child(even) { background: #fafafa; }
table.data tbody tr:hover { background: var(--soft); }
table.data img.thumb { width: 56px; height: 42px; object-fit: cover; display: block; border-radius: 2px; background: var(--grey); }
table.data .num { text-align: right; white-space: nowrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 30px; text-align: center; background: var(--light); border: 1px dashed var(--line); border-radius: var(--radius-card); color: var(--muted); }

/* ---------------------------------------------------------------- forms */
label { display: block; font-weight: bold; font-size: .9rem; margin-bottom: 5px; color: var(--navy); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font: 1rem Arial, sans-serif; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--yellow); border-color: var(--navy); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { margin-bottom: 4px; }
.field .help { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: normal; }
.check input { width: 20px; height: 20px; flex: none; }
.panel { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius-card); padding: 22px; margin-bottom: 22px; }
.panel h2, .panel h3 { color: var(--navy); font-size: 1.1rem; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--yellow); display: inline-block; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.auth-box { max-width: 440px; margin: 40px auto; background: #fff; border: 1px solid var(--line-soft); border-top: 4px solid var(--yellow); border-radius: var(--radius-card); padding: 28px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.auth-box h1 { color: var(--navy); font-size: 1.5rem; }
.auth-box .field { margin-bottom: 14px; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.upload-preview figure { margin: 0; position: relative; width: 110px; }
.upload-preview img { width: 110px; height: 82px; object-fit: cover; border: 1px solid var(--line); border-radius: 2px; display: block; }
.upload-preview figcaption { font-size: .75rem; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-block; padding: 2px 9px; font-size: .75rem; font-weight: bold; border-radius: var(--radius); background: var(--grey); color: var(--text); white-space: nowrap; border: 1px solid var(--line); }
.b-submitted, .b-new, .b-pending { background: var(--yellow); color: var(--navy); border-color: var(--yellow); }
.b-under_review, .b-in_progress, .b-ongoing, .b-read { background: var(--soft); color: var(--navy); border-color: var(--soft); }
.b-quoted, .b-unpaid { background: #fff; color: var(--navy); border-color: var(--navy); }
.b-paid, .b-success, .b-completed, .b-report_ready, .b-replied, .b-yes { background: var(--ok); color: #fff; border-color: var(--ok); }
.b-cancelled, .b-failed, .b-no { background: #fff; color: var(--bad); border-color: var(--bad); }
.b-admin { background: var(--navy); color: #fff; border-color: var(--navy); }
.b-client { background: var(--grey); }

/* ---------------------------------------------------------------- tracker */
.tracker { list-style: none; display: flex; padding: 0; margin: 0 0 6px; counter-reset: s; }
.tracker li { flex: 1; text-align: center; position: relative; font-size: .78rem; color: var(--muted); padding-top: 38px; counter-increment: s; }
.tracker li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; line-height: 26px; border: 2px solid var(--line); background: #fff; border-radius: 50%; font-weight: bold; z-index: 1; }
.tracker li::after { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.tracker li:first-child::after { display: none; }
.tracker li.done { color: var(--navy); }
.tracker li.done::before { background: var(--navy); border-color: var(--navy); color: #fff; }
.tracker li.done::after { background: var(--navy); }
.tracker li.current { color: var(--navy); font-weight: bold; }
.tracker li.current::before { background: var(--yellow); border-color: var(--navy); color: var(--navy); }
.tracker li.current::after { background: var(--navy); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 3px solid var(--soft); }
.timeline li { position: relative; padding: 0 0 18px 14px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 5px; width: 12px; height: 12px; background: var(--navy); border-radius: 50%; border: 2px solid #fff; }
.timeline .when { font-size: .78rem; color: var(--muted); }

/* ---------------------------------------------------------------- app shell (portal + admin) */
body.shell-body { background: var(--light2); }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--dark); color: #fff; padding: 0 0 30px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .side-brand { padding: 14px 18px; background: var(--navy); }
.sidebar .side-brand img { display: block; max-width: 140px; background: #fff; }
.sidebar .side-label { padding: 18px 20px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #8fa6c1; }
.sidebar a.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: #dbe6f2; text-decoration: none; font-size: .95rem; border-left: 4px solid transparent; }
.sidebar a.side-link i { width: 20px; text-align: center; color: var(--yellow); }
.sidebar a.side-link:hover { background: var(--navy); color: #fff; }
.sidebar a.side-link.active { background: var(--navy); border-left-color: var(--yellow); color: #fff; font-weight: bold; }
.sidebar .count { margin-left: auto; background: var(--yellow); color: var(--navy); font-size: .72rem; font-weight: bold; padding: 1px 7px; border-radius: var(--radius); }
.shell-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 900; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: .9rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar .side-toggle { display: none; background: var(--navy); color: #fff; border: 0; width: 42px; height: 38px; font-size: 18px; border-radius: var(--radius); cursor: pointer; }
.topbar h1 { font-size: 1.2rem; margin: 0; color: var(--navy); }
.shell-content { padding: 24px; flex: 1; min-width: 0; }
.shell-foot { padding: 14px 24px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line-soft); background: #fff; }
.scrim { display: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--line-soft); border-left: 4px solid var(--navy); border-radius: var(--radius-card); padding: 16px 18px; }
.kpi.y { border-left-color: var(--yellow); }
.kpi small { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.kpi b { display: block; font-size: 1.7rem; color: var(--navy); line-height: 1.25; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding-top: 10px; border-bottom: 2px solid var(--navy); }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: .72rem; }
.bar i { display: block; width: 100%; background: var(--navy); min-height: 2px; }
.bar em { font-style: normal; color: var(--muted); margin-bottom: 3px; }
.bar-labels { display: flex; gap: 12px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); }
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--navy); font-size: .85rem; font-weight: bold; background: #fff; }
.tabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs a small { opacity: .75; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; font-weight: bold; color: var(--navy); word-break: break-word; }

/* ---------------------------------------------------------------- request wizard */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 22px; }
.wizard-steps div { flex: 1; text-align: center; padding: 9px 4px; background: var(--grey); border-bottom: 4px solid var(--line); font-size: .82rem; font-weight: bold; color: var(--muted); }
.wizard-steps div.active { background: var(--soft); border-color: var(--yellow); color: var(--navy); }
.wizard-steps div.done { border-color: var(--navy); color: var(--navy); }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.wizard-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.estimate { position: sticky; top: 76px; background: #fff; border: 1px solid var(--line-soft); border-top: 4px solid var(--yellow); border-radius: var(--radius-card); padding: 18px; }
.estimate b.total { display: block; font-size: 1.6rem; color: var(--navy); }
.estimate ul { list-style: none; margin: 10px 0 0; padding: 0; font-size: .85rem; max-height: 220px; overflow-y: auto; }
.estimate li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.test-row { display: grid; grid-template-columns: 1fr 110px 90px; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 8px; background: #fff; }
.test-row.on { border-color: var(--navy); background: var(--soft); }
.test-row .nm { font-weight: bold; color: var(--navy); font-size: .92rem; }
.test-row .pr { font-size: .8rem; color: var(--muted); }
.test-row input { text-align: center; padding: 7px; }
.service-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.service-pick label { margin: 0; cursor: pointer; }
.service-pick input { position: absolute; opacity: 0; }
.service-pick span { display: block; padding: 14px; border: 2px solid var(--line-soft); border-radius: var(--radius); background: #fff; font-weight: bold; color: var(--navy); font-size: .92rem; height: 100%; }
.service-pick span i { display: block; color: var(--icon); font-size: 1.3rem; margin-bottom: 6px; }
.service-pick input:checked + span { border-color: var(--navy); background: var(--soft); }
.service-pick input:focus + span { outline: 2px solid var(--yellow); }

/* ---------------------------------------------------------------- invoice & payment */
.invoice { background: #fff; border: 1px solid var(--line); padding: 30px; max-width: 820px; margin: 0 auto; }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 3px solid var(--navy); padding-bottom: 16px; margin-bottom: 18px; }
.invoice-head img { max-width: 150px; }
.invoice h1 { color: var(--navy); font-size: 1.6rem; margin: 0 0 4px; }
.invoice .total-row td { font-weight: bold; background: var(--soft); font-size: 1.05rem; }
.stamp { display: inline-block; border: 3px solid var(--ok); color: var(--ok); font-weight: bold; letter-spacing: .1em; padding: 4px 14px; transform: rotate(-4deg); }
.pay-box { background: var(--soft); border-left: 4px solid var(--navy); padding: 18px; border-radius: var(--radius-card); max-width: 820px; margin: 0 auto 20px; }
.pay-box .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.pay-box .row > div { flex: 1 1 200px; }
.pay-status { margin-top: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); font-weight: bold; display: none; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- footer + floating */
.site-footer { background: var(--dark); color: #fff; padding: 40px 20px 26px; text-align: center; }
.site-footer a { color: #ccc; }
.socials { display: flex; justify-content: center; gap: 20px; margin: 18px 0; }
.socials a { color: #fff; font-size: 24px; transition: transform .25s, color .25s; }
.socials a:hover { color: var(--yellow); transform: scale(1.2); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin: 14px 0; }
.footer-links a { text-decoration: none; font-weight: bold; }
.footer-links a:hover { color: var(--yellow); }
.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 900; width: 50px; height: 50px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; border-radius: var(--radius); text-decoration: none; border: 2px solid var(--yellow); }
.wa-float:hover { background: var(--yellow); color: var(--navy); }
.map iframe { width: 100%; height: 320px; border: 0; border-radius: var(--radius-card); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.contact-list { list-style: none; padding: 0; margin: 0 0 20px; }
.contact-list li { display: flex; gap: 12px; margin-bottom: 12px; }
.contact-list i { color: var(--icon); width: 20px; text-align: center; margin-top: 4px; }
.error-page { text-align: center; padding: 80px 20px; }
.error-page .code { font-size: 5rem; font-weight: bold; color: var(--yellow); background: var(--navy); display: inline-block; padding: 0 28px; border-radius: var(--radius); line-height: 1.3; }

/* ================================================================ responsive */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .wizard-layout { grid-template-columns: 1fr; }
  .estimate { position: static; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); display: none; border-top: 1px solid #1c4a7a; }
  .main-nav.show { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 16px; }
  .main-nav li a { display: block; padding: 11px 0; border-bottom: 1px solid #1c4a7a; }
  .main-nav li:last-child a { border: 0; margin-top: 10px; text-align: center; padding: 10px; }
  .site-header { flex-wrap: wrap; }
  .clock { font-size: .8rem; min-width: 0; padding: 3px 7px; }

  .about-wrap, .detail-grid, .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  /* app shell: sidebar becomes a slide-in drawer */
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 2000; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 1900; }
  .topbar .side-toggle { display: block; }
  .topbar { padding: 10px 14px; }
  .shell-content { padding: 16px 14px; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .section { padding: 42px 16px; }
  .section-title { font-size: 1.6rem; }
  .hero h1 { font-size: 1.9em; }
  .hero p { font-size: 1.1em; }
  .hero { height: 70vh; min-height: 380px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; }
  .stats .grid { grid-template-columns: repeat(2, 1fr); }
  .card img.cover { height: 200px; }
  .page-hero h1 { font-size: 1.5rem; }
  .btn-row .btn { flex: 1 1 auto; }
  .auth-box { margin: 20px auto; padding: 20px; }
  .panel { padding: 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .invoice { padding: 16px; }
  .test-row { grid-template-columns: 1fr 90px; }
  .test-row .line { grid-column: 1 / -1; text-align: right; }
  .wizard-steps div { font-size: .68rem; padding: 8px 2px; }
  .filters input, .filters select { flex: 1 1 100%; }
  .kpi b { font-size: 1.4rem; }
  .topbar h1 { font-size: 1rem; }
  .topbar .who .hide-sm { display: none; }

  /* progress tracker turns vertical */
  .tracker { flex-direction: column; gap: 0; }
  .tracker li { text-align: left; padding: 4px 0 18px 46px; min-height: 40px; }
  .tracker li::before { left: 0; top: 0; transform: none; }
  .tracker li::after { top: 30px; left: 14px; width: 3px; height: calc(100% - 26px); }

  /* data tables become stacked cards */
  table.data.stack, table.data.stack tbody, table.data.stack tr, table.data.stack td { display: block; width: 100%; }
  table.data.stack thead { display: none; }
  table.data.stack tr { border: 1px solid var(--line-soft); border-radius: var(--radius-card); margin-bottom: 12px; padding: 6px 0; background: #fff !important; }
  table.data.stack td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: right; }
  table.data.stack td::before { content: attr(data-label); font-weight: bold; font-size: .75rem; text-transform: uppercase; color: var(--muted); text-align: left; flex: none; }
  table.data.stack td.num { text-align: right; }
  table.data.stack td.act { justify-content: flex-start; }
  table.data.stack td.act::before { display: none; }
  table.data.stack td img.thumb { width: 90px; height: 64px; }
}

@media (max-width: 480px) {
  .site-header { padding: 6px 12px; }
  .brand { gap: 8px; }
  .brand img { max-width: 110px; }
  .stats .grid { gap: 14px; }
  .stat b { font-size: 1.9rem; }
  .actions .btn { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------- print (invoices) */
@media print {
  .site-header, .site-footer, .sidebar, .topbar, .shell-foot, .wa-float, .no-print, .flashes, .scrim { display: none !important; }
  .shell { display: block; }
  body, body.shell-body { background: #fff; }
  .shell-content { padding: 0; }
  .invoice { border: 0; padding: 0; max-width: none; }
}

/* ---------- quotation / invoice documents ---------- */
.doc { background: #fff; border: 1px solid var(--line-soft); max-width: 860px; margin: 0 auto 24px; padding: 28px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 3px solid var(--navy); padding-bottom: 14px; margin-bottom: 16px; }
.doc-head img { height: 56px; width: auto; }
.doc-meta { text-align: right; }
.doc-meta h1 { margin: 0 0 4px; font-size: 1.5rem; color: var(--navy); letter-spacing: 1px; }
.doc-title { font-weight: 700; color: var(--navy); margin: 12px 0; }
.doc-table th, .doc-table td { font-size: .88rem; }
.doc-table .head-row td { background: var(--soft); font-weight: 700; color: var(--navy); }
.doc-table .sum-row td { font-weight: 600; text-align: right; border-top: 1px solid var(--line-soft); }
.doc-table .sum-row td.num { text-align: right; }
.doc-table .total-row td { background: var(--navy); color: #fff; font-weight: 700; text-align: right; }
.doc-notes { margin-top: 16px; font-size: .88rem; }
.doc-notes ul { margin: 6px 0 0; padding-left: 20px; }
.doc-foot { margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.paydetails { background: var(--soft); border-left: 4px solid var(--yellow); padding: 10px 14px; font-size: .85rem; margin-top: 10px; }
.mode-pay { border: 1px solid var(--line-soft); padding: 10px 14px; margin: 14px 0 8px; font-size: .9rem; }
.mode-pay .mp-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line-soft); }
.stamp { display: inline-block; border: 3px solid #2e7d32; color: #2e7d32; font-weight: 800; padding: 2px 14px; letter-spacing: 2px; transform: rotate(-6deg); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.manual-pay .form-grid { gap: 10px; }

/* ---------- admin quotation builder ---------- */
.qrows { display: grid; gap: 8px; margin-bottom: 14px; }
.qrow { display: grid; grid-template-columns: 44px 1fr 80px 90px 110px 110px 44px; gap: 6px; align-items: center; }
.qrow.is-head { grid-template-columns: 44px 1fr 44px; background: var(--soft); padding: 4px; }
.qrow.is-head .q-unit, .qrow.is-head .q-qty, .qrow.is-head .q-rate, .qrow.is-head .q-amt { display: none; }
.qrow input { width: 100%; }
.q-no { font-weight: 700; color: var(--navy); text-align: center; }
.q-amt { text-align: right; font-weight: 600; font-size: .9rem; }
.qtotals { margin-left: auto; max-width: 340px; display: grid; gap: 4px; }
.qtotals div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.qtotals .grand { background: var(--navy); color: #fff; padding: 8px 10px; font-size: 1.05rem; }
@media (max-width: 760px) {
  .qrow { grid-template-columns: 1fr 1fr 1fr; border: 1px solid var(--line-soft); padding: 8px; }
  .qrow .q-no { grid-column: 1 / 2; text-align: left; }
  .qrow .q-act { grid-column: 3 / 4; text-align: right; }
  .qrow .q-desc { grid-column: 1 / -1; }
  .qrow .q-amt { grid-column: 1 / -1; text-align: left; }
  .qrow.is-head { grid-template-columns: 1fr 44px; }
  .qrow.is-head .q-no { display: none; }
  .qrow.is-head .q-desc { grid-column: 1 / 2; }
  .qrow.is-head .q-act { grid-column: 2 / 3; }
  .doc { padding: 16px; }
  .doc-meta { text-align: left; }
  .qtotals { max-width: none; }
}
@media print {
  .no-print, .sidebar, .topbar, #sidebar, #scrim, header, footer { display: none !important; }
  .doc { border: 0; padding: 0; max-width: none; }
  body { background: #fff; }
}
