/* Inter (text) and Poppins (headings), latin subset, shipped with the portal: nothing is fetched from anywhere else.
   SIL Open Font License: fonts/LICENSE-Inter.txt and fonts/LICENSE-Poppins.txt. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-latin-700-normal.woff2") format("woff2"); }

:root {
    --ink: #0b1320;
    --text: #2f353c;
    --muted: #5b6573;      /* the mockup's #737b85 is under 4.5:1 on white; this passes */
    --line: #eceef1;
    --border: #d8dde3;
    --canvas: #f2f3f5;
    --card: #ffffff;
    --banner: #070c18;     /* the rental company's base colour, from /branding/theme.css */
    --teal: #0db5a0;       /* the rental company's accent colour, from /branding/theme.css */
    --teal-dark: #0a9387;  /* the focus ring: meets WCAG 1.4.11's 3:1 whatever the accent */
    --on-teal: #032520;    /* text on the accent, from /branding/theme.css */
    --error: #b3261e;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--canvas);
}

h1, h2, h3 { font-family: "Poppins", system-ui, sans-serif; color: var(--ink); line-height: 1.2; }
h1 { font-size: 1.35rem; font-weight: 600; margin: 0 0 0.5rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
a { color: var(--ink); }

/* The frame: the rental company's top bar over the page */
.app { max-width: 1320px; margin: 12px auto 0; padding: 0 24px; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(11, 19, 32, 0.04); }
.co { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; color: var(--ink); text-decoration: none; }
.brand-logo { max-height: 2.25rem; max-width: 10rem; }
.brand-mark { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--banner); display: grid; place-items: center; }
.brand-mark::before { content: ""; width: 14px; height: 14px; border: 3px solid var(--teal); border-radius: 3px; transform: rotate(45deg); }
.brand-text { min-width: 0; }
.brand-text b { display: block; font-family: "Poppins", system-ui, sans-serif; font-size: 0.9rem; font-weight: 600; line-height: 1.15; }
.brand-text span { font-size: 0.75rem; color: var(--muted); }
.user { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line); font-size: 0.85rem; font-weight: 500; color: var(--ink); text-decoration: none; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: #d8c7ff; color: #3b2a7a; display: grid; place-items: center; font-size: 0.75rem; font-weight: 600; }
.content { padding-top: 14px; }

/* Standalone pages: sign-in, setup, account */
.panel { max-width: 60rem; margin: 1.5rem auto 0; padding: 1.5rem; background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(11, 19, 32, 0.04); }
.panel.narrow { max-width: 28rem; }

/* An account page: the icon rail beside the customer's banner and the page's cards */
.account { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 14px; }
.rail { align-self: start; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; background: var(--card); border-radius: 16px; }
.rail-link { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.rail-link.on { background: var(--ink); color: #ffffff; }
.rail-link svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.account-main { min-width: 0; }

.banner {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 16px;
    min-height: 150px;
    padding: 26px 22px 16px 26px;
    border-radius: 18px;
    background-color: var(--banner);
    background-image: radial-gradient(90% 160% at 78% 30%, color-mix(in srgb, var(--teal) 30%, transparent) 0%, transparent 60%);
}
.banner-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner > :not(.banner-art) { position: relative; }
.ribbon-light { stop-color: color-mix(in srgb, var(--teal) 55%, #ffffff); }
.ribbon-mid { stop-color: var(--teal); }
.ribbon-dim { stop-color: color-mix(in srgb, var(--teal) 75%, #000000); }
.client { flex: 1 1 18rem; display: flex; align-items: center; gap: 14px; min-width: 0; color: #ffffff; }
.client-mark { flex: none; width: 54px; height: 54px; padding: 6px; border-radius: 12px; background: #ffffff; display: grid; place-items: center; object-fit: contain; font-family: "Poppins", system-ui, sans-serif; font-size: 1.1rem; font-weight: 700; color: #0b3b66; }
.client-mark.small { width: 40px; height: 40px; padding: 4px; border-radius: 10px; font-size: 0.85rem; background: var(--canvas); }
.client-text { min-width: 0; }
.client-text b { display: block; font-family: "Poppins", system-ui, sans-serif; font-size: 1.5rem; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.client-text span { font-size: 0.85rem; color: #c9d1d9; }
.switch { flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.14); color: #ffffff; font-size: 0.8rem; text-decoration: none; }
.tab-row { flex-basis: 100%; display: flex; justify-content: flex-end; }
.tabs { display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: var(--card); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4); }
.tabs a { padding: 7px 14px; border-radius: 999px; font-family: "Poppins", system-ui, sans-serif; font-size: 0.85rem; font-weight: 500; color: var(--text); text-decoration: none; }
.tabs a.on { background: var(--canvas); color: var(--ink); font-weight: 600; }

.card { margin-top: 14px; padding: 18px 20px; background: var(--card); border-radius: 16px; box-shadow: 0 1px 2px rgba(11, 19, 32, 0.04); }
.sub { margin: 4px 0 0; font-size: 0.8rem; color: var(--muted); }

.account-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.account-list li + li { border-top: 1px solid var(--line); }
.account-list a { display: flex; align-items: center; gap: 14px; padding: 12px 0; color: var(--ink); text-decoration: none; }
.account-list b { display: block; }
.account-list .sub { display: block; margin: 0; }

/* Forms, buttons, tables and messages */
label { display: block; font-weight: 600; margin: 1rem 0 0.25rem; color: var(--ink); }
input, select, textarea { width: 100%; padding: 0.6rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; color: var(--ink); background: var(--card); }
input[type="checkbox"], input[type="radio"] { width: auto; }

button {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--teal);
    color: var(--on-teal);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--border); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 2px; }

.error { color: var(--error); }
.notice { background: #e6f7f4; border-left: 4px solid var(--teal); padding: 0.75rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.8rem; font-weight: 600; color: var(--muted); }

.footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 2rem 0; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 1000px) {
    .account { grid-template-columns: minmax(0, 1fr); }
    .rail { flex-direction: row; justify-content: center; padding: 8px; }
    .tab-row { display: none; }
}

@media (max-width: 600px) {
    .app { padding: 0 12px; }
    .user-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .client-text b { font-size: 1.2rem; }
}

/* The Equipment screens */
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head h1 { margin: 0; }
.refresh button { margin-top: 0; }
.seg { display: inline-flex; margin-top: 14px; padding: 4px; border-radius: 999px; background: var(--canvas); font-size: 0.8rem; font-weight: 500; }
.seg a { padding: 6px 12px; border-radius: 999px; color: var(--text); text-decoration: none; white-space: nowrap; }
.seg a.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 14px 0 6px; }
.field { flex: 1 1 12rem; }
.field label { margin-top: 0; font-size: 0.8rem; }
.filters button { margin-top: 0; }
.filters .clear { align-self: center; font-size: 0.85rem; }
.muted { display: block; font-size: 0.8rem; color: var(--muted); }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.status.on-hire { background: #e3f6f0; color: #0d5c46; }
.status.returned { background: var(--canvas); color: var(--muted); }
.status.lost { background: #fdecea; color: #a1261b; }
table.units td a { font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; font-size: 0.85rem; }
.back { margin: 0 0 8px; font-size: 0.85rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 12px 20px; margin: 16px 0 0; }
.facts dt { font-size: 0.8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

/* On a phone, each row of a units table becomes a card, each value labelled from its cell's data-label */
@media (max-width: 700px) {
    table.units thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    table.units, table.units tbody, table.units tr, table.units td { display: block; width: 100%; }
    table.units tr { margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
    table.units td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
    table.units td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; }
    table.units td:empty { display: none; }   /* a blank value (no serial number) leaves no bare label on a phone */
}

/* The Overview: the hire horizon beside the side cards */
.overview { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); gap: 0 14px; align-items: start; }
.side h2 { margin: 0; }
.horizon-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 10px 0 8px; }
.horizon-tools .seg { margin-top: 0; }
.window-nav { display: flex; gap: 14px; font-size: 0.85rem; font-weight: 600; }
.horizon svg { display: block; overflow: visible; }
.horizon-axis, .group-head, .unit-row, .billing-lane { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
.lane-label { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding-right: 10px; }
.lane-label b { font-size: 0.85rem; color: var(--ink); overflow-wrap: anywhere; }
.axis text { font-size: 11.5px; fill: var(--muted); }
.axis .today-label text { font-weight: 600; fill: var(--ink); }
.group { border-bottom: 1px solid var(--line); }
.group summary { display: block; list-style: none; cursor: pointer; }
.group summary::-webkit-details-marker { display: none; }
.group-head .lane-label b::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 9px 2px 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); }
.group[open] .group-head .lane-label b::before { transform: rotate(45deg); }
.band, .unit-lane, .billing-band { background-image: repeating-linear-gradient(to right, #f1f2f4 0 1px, transparent 1px calc(100% / 12)); }
.band-fill { fill: color-mix(in srgb, var(--teal) 20%, transparent); }
.band-edge { stroke: var(--ink); stroke-width: 2; }
.band-ahead { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 5 5; opacity: 0.5; }
.group.idle .band-fill { fill: rgba(115, 123, 133, 0.16); }
.group.idle .band-edge { stroke: #9aa1a9; stroke-width: 1.6; }
.today-line { stroke: var(--ink); stroke-width: 2; }
.unit-row { background: #fafbfc; border-top: 1px solid var(--line); }
.unit-row .lane-label { padding-left: 18px; }
.unit-row .lane-label a { font-size: 0.85rem; font-weight: 600; overflow-wrap: anywhere; }
.bar { fill: var(--ink); }
.bar.lost { fill: var(--error); }
.show-all { margin: 0; padding: 10px 18px; background: #fafbfc; border-top: 1px solid var(--line); font-size: 0.85rem; font-weight: 600; }
.items { list-style: none; margin: 12px 0 0; padding: 0; }
.items li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.items li:first-child { border-top: 0; }
.items b { display: block; font-size: 0.85rem; color: var(--ink); }
.items .sub { display: block; margin: 0; }
.doc-mark { flex: none; width: 34px; height: 40px; border-radius: 6px; background: #eef1f5; color: #56606b; display: grid; place-items: center; }
.doc-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1000px) {
    .overview { grid-template-columns: minmax(0, 1fr); }
    .axis .tick.minor { display: none; }
}

/* On a phone, each group of the horizon becomes a card, its label above its band; the axis stays above them */
@media (max-width: 700px) {
    .horizon-axis, .group-head, .unit-row, .billing-lane { grid-template-columns: minmax(0, 1fr); }
    .horizon-axis > .lane-label { display: none; }
    .group { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
    .lane-label { padding: 8px 12px 4px; }
}

/* Certificates, in the spec's fixed status colours: green valid, amber running out, red expired; grey renewed */
.status.cert-valid { background: #e3f6f0; color: #0d5c46; }
.status.cert-running-out { background: #fff3d6; color: #7a4d00; }
.status.cert-expired { background: #fdecea; color: #a1261b; }
.status.cert-renewed { background: var(--canvas); color: var(--muted); }
.muted-inline { font-size: 0.8rem; color: var(--muted); }
.file-links { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.85rem; }

/* Certificates on the Overview: amber running out, red expired, green valid, pale green renewed (the mockup's) */
.side-column { min-width: 0; }
.cert-note { display: block; font-size: 0.75rem; font-weight: 600; }
.cert-note.running-out { color: #7a4d00; }
.cert-note.expired { color: #a1261b; }
.cert-note.renewed { color: var(--muted); font-weight: 500; }
.cert-mark { stroke: #ffffff; stroke-width: 1.5; }
.cert-mark.running-out { fill: #e0a100; }
.cert-mark.expired { fill: #c53a2e; }
.cert-line { stroke-width: 5; }
.cert-line.valid { stroke: #2e9e6a; }
.cert-line.renewed { stroke: #bfe3c8; }
.cert-line.running-out { stroke: #e0a100; }
.cert-line.lapsed { stroke: #c53a2e; stroke-dasharray: 6 4; }
.items .when { margin-left: auto; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.when.running-out { color: #7a4d00; }
.when.expired { color: #a1261b; }
.card-link { margin: 10px 0 0; font-size: 0.85rem; font-weight: 600; }

/* Deliveries: a document's address, its lines, a kit's components indented, a cancelled line struck through */
.address span { display: block; }
table.lines td.indent-1 { padding-left: 1.5rem; }
table.lines td.indent-2 { padding-left: 2.5rem; }
table.lines td.indent-3 { padding-left: 3.5rem; }
table.lines tr.cancelled td { color: var(--muted); }
table.lines tr.cancelled td:nth-child(-n+3) { text-decoration: line-through; }
.status.cancelled { background: var(--canvas); color: var(--muted); }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 0; }
.doc-actions:empty { display: none; }
.button-link { display: inline-block; padding: 0.55rem 1.1rem; border: 1px solid var(--border); border-radius: 999px; color: var(--ink); font-weight: 600; text-decoration: none; }

/* Certificate packs: the buttons that ask for one, and a pack's page */
.pack-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 0 12px; }
.pack-row .sub { margin: 0; }
.pack-form { margin: 0; }
.pack-form button { margin-top: 0; padding: 0.55rem 1.1rem; }
.button-link.primary { border-color: var(--teal); background: var(--teal); color: var(--on-teal); }
.pack-progress { display: block; width: min(24rem, 100%); margin-top: 10px; accent-color: var(--teal); }
.order-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.group-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
td .pack-form button, .group-actions .pack-form button { padding: 0.25rem 0.75rem; font-size: 0.8rem; }

/* Billing: the balance beside what is next to be invoiced, amounts to the right, overdue in the fixed red */
.billing-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 12px 24px; margin-top: 14px; }
.billing-summary h2, .billing-card h2 { margin: 0; font-size: 1rem; }
.money { margin: 8px 0 0; font-family: "Poppins", system-ui, sans-serif; font-size: 1.5rem; font-weight: 600; color: var(--ink); }
.sub.overdue { color: #a1261b; font-weight: 600; }
table.units th.amount, table.units td.amount { text-align: right; white-space: nowrap; }
.status.overdue { background: #fdecea; color: #a1261b; }
.status.open { background: #e3f6f0; color: #0d5c46; }
.status.settled { background: var(--canvas); color: var(--muted); }
.status.next { margin-left: 6px; background: #e3f6f0; color: #0d5c46; }

/* The billing lane on top of the hire horizon: each invoice a dot, the latest labelled, then what is next to be invoiced after Today */
.billing-lane { border-bottom: 1px solid var(--line); }
.invoice-dot { fill: var(--ink); stroke: #ffffff; stroke-width: 1.5; }
.invoice-label text { font-size: 11.5px; fill: var(--ink); }
.next-block { fill: color-mix(in srgb, var(--teal) 10%, #ffffff); stroke: color-mix(in srgb, var(--teal) 45%, #ffffff); stroke-width: 1.5; }
.next-text text { font-size: 11.5px; fill: var(--text); }
.next-text.amount text { font-size: 14px; font-weight: 700; fill: var(--ink); }

/* On a phone the block is too narrow for words: the "Next to be invoiced" card, below the horizon, says them */
@media (max-width: 700px) {
    .next-text { display: none; }
    .billing-lane { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
}
