:root {
  --accent: #1f639f;
  --sky: #9fd0f5;
  --ink: #14233a;
  --muted: #52647c;
  --line: #cfdcea;
  --edge: #a9bfd6;
  --ground: #eaf0f7;
  --soft: #e3eef9;
  --bad: #a92b2b;
  --bad-soft: #fbe6e4;
  --good: #1a6341;
  --good-soft: #dff2e7;
  /* Brushed blue steel: a light band running across a dark surface. */
  --metal: linear-gradient(105deg, #0f2c52, #1d4d85 28%, #2d6aa8 46%, #1c4a80 62%, #10305a);
  --metal-alert: linear-gradient(105deg, #64181f, #8d2a30 28%, #ab4146 46%, #862a30 62%, #64181f);
  --metal-button: linear-gradient(#3674b2, #245c97 50%, #1c4d84);
  --steel: linear-gradient(#fff, #edf3f9 50%, #dde8f3);
  --shine: inset 0 1px 0 #ffffff59;
  --lift: 0 1px 2px #0f2c521f, 0 6px 18px #0f2c5214;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; background: var(--ground); color: var(--ink); font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-color: #1f639f66; }
a:hover { text-decoration-color: currentColor; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 650; letter-spacing: -.015em; margin: 0 0 1.1rem; text-wrap: balance; }
h2 { font-size: 1.1rem; font-weight: 650; margin: 2rem 0 .7rem; }
:focus-visible { outline: 3px solid #5aa5e0; outline-offset: 2px; }

/* Menu */
nav { flex: 0 0 216px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--metal); color: #fff; padding: 1.4rem .8rem 1rem; display: flex; flex-direction: column; gap: 4px; box-shadow: inset -1px 0 0 #ffffff26; }
nav a, nav .link { display: flex; align-items: center; gap: .7rem; width: 100%; color: #f0f6fd; text-decoration: none; padding: .55rem .8rem; border-radius: 9px; text-align: left; transition: background-color .15s; }
nav a:hover, nav .link:hover { background: #ffffff1f; }
nav a[aria-current] { background: var(--steel); color: #123a68; font-weight: 600; box-shadow: 0 2px 6px #0a1f3b59; }
nav svg { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav form { margin-top: auto; padding-top: 1rem; }
nav .menu { display: none; }
.brand { font-size: 1.1rem; font-weight: 700; margin: 0 .8rem 1.4rem; color: #fff; line-height: 1.3; }
.brand span { color: var(--sky); font-weight: 400; }
main { flex: 1; min-width: 0; padding: 2rem 2.25rem 4rem; }

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; margin-bottom: 1.2rem; }
.top h1, .top h2, .top p { margin: 0; }
.muted, .help { color: var(--muted); font-size: .87rem; }
.bad { color: var(--bad); }
.notice { background: #fff5d9; border: 1px solid #e6cf8d; border-radius: 10px; padding: .7rem 1rem; }
.notice.error { background: var(--bad-soft); border-color: #e5b3ae; }
.notice.success { background: var(--good-soft); border-color: #a9d5bc; }
.tag { display: inline-block; padding: .05rem .6rem; border-radius: 99px; background: #dde8f4; color: var(--ink); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.good { background: var(--good-soft); color: var(--good); }

/* Page heading */
.banner { margin-bottom: 1.5rem; padding: 1.3rem 1.5rem 1.4rem; border-radius: 16px; background: var(--metal); color: #fff; box-shadow: var(--shine), var(--lift); }
.banner .top { margin: 0; align-items: center; }
.banner h1 { font-size: 1.9rem; }
.banner h1 + p { margin-top: .4rem; }
.banner .muted, .banner .muted a { color: #e2edf9; }
.banner .filters { margin: 0; }
.banner .button, .banner button { background: #ffffff1f; border-color: #ffffff80; color: #fff; box-shadow: none; }
.banner .button:hover, .banner button:hover { background: #ffffff38; border-color: #fff; filter: none; }
.banner .primary, .banner .primary:hover { background: var(--steel); border-color: #fff; color: #123a68; }

/* Buttons and inputs */
button, .button, input, select, textarea, .dropdown summary { font: inherit; color: inherit; border: 1px solid var(--edge); border-radius: 9px; background: #fff; padding: .45rem .8rem; }
button, .button { cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; font-weight: 600; background: var(--steel); box-shadow: 0 1px 2px #0f2c521a; transition: filter .15s, border-color .15s; }
button:hover, .button:hover { border-color: #5f8db9; filter: brightness(1.03); }
button:active, .button:active { filter: brightness(.95); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.primary { background: var(--metal-button); border-color: #1a477a; color: #fff; box-shadow: var(--shine), 0 1px 3px #0f2c524d; }
.primary:hover { border-color: #1a477a; filter: brightness(.92); }
/* Orange: the client's hours do not fit the word count. */
.tag.flag { background: #f28c28; color: #2b1500; }
.notice.flag { background: #ffe3c2; border-color: #f28c28; }
.danger { color: var(--bad); }
.link { background: none; border: 0; box-shadow: none; color: var(--accent); padding: 0; font-weight: 400; }
.buttons, .actions, .filters { display: flex; flex-wrap: wrap; gap: .5rem; }
td.actions { display: table-cell; white-space: nowrap; }
td.actions > * { display: inline-block; }
.filters { margin-bottom: 1.1rem; }
input:hover, select:hover, textarea:hover, .dropdown summary:hover { border-color: #5f8db9; }
input[type=checkbox] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; margin: 0; }
input[type=file] { padding: .3rem; }

/* Dropdown menus. Browsers without base-select keep their own list and only get the arrow. */
select, .dropdown summary { cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%231f639f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right .8rem center, var(--steel); padding-right: 2.2rem; }
select { appearance: none; }
.dropdown details > div { position: absolute; z-index: 5; width: 100%; }
.dropdown details > div, .tip { background: #fff; border: 1px solid var(--edge); border-radius: 11px; box-shadow: 0 10px 30px #0f2c5238; }
.dropdown details > div { max-height: 21rem; overflow-y: auto; margin-top: 5px; padding: .35rem; }
.dropdown details label { display: flex; align-items: center; gap: .6rem; padding: .4rem .65rem; border-radius: 8px; cursor: pointer; }
.dropdown details label:hover { background: var(--soft); }
.dropdown.field { position: relative; }
.dropdown summary { list-style: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { min-height: 0; }
  select::picker-icon { display: none; }
  ::picker(select) { margin-top: 5px; padding: .35rem; max-height: 21rem; background: #fff; border: 1px solid var(--edge); border-radius: 11px; box-shadow: 0 10px 30px #0f2c5238; }
  option { padding: .4rem .65rem; border-radius: 8px; gap: .5rem; }
  option:hover, option:focus-visible { background: var(--soft); outline: 0; }
  option:checked { background: var(--metal-button); color: #fff; }
  option::checkmark { display: none; }
}

/* Tiles */
.figures { display: flex; flex-wrap: wrap; gap: .9rem; margin: 0 0 1.75rem; }
.figures div { flex: 1 1 auto; min-width: 145px; padding: .9rem 1.1rem 1rem; border-radius: var(--radius); background: var(--metal); color: #fff; box-shadow: var(--shine), var(--lift); }
.figures div:has(> .bad) { background: var(--metal-alert); }
.figures dt { color: #e2edf9; font-size: .87rem; }
.figures dd { margin: .15rem 0 0; font-size: 1.4rem; line-height: 1.35; font-weight: 650; color: #fff; }
.figures a, .figures .muted { color: #fff; }
.figures .tag, .figures .muted { font-size: 1.05rem; }
.details { display: grid; grid-template-columns: 8rem 1fr; gap: .35rem 1rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.scroll, .panel, .chart, .lists section, dl.details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift); }
dl.details { padding: 1.1rem 1.25rem; margin: 0; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; vertical-align: top; padding: .65rem .9rem; border-bottom: 1px solid #e2eaf3; }
th { font-size: .83rem; font-weight: 600; color: #2d4a6b; white-space: nowrap; background: #e6eef7; box-shadow: 1px 0 #e6eef7; border-color: var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f3f8fd; }
tr.flag td { background: #fff0de; }
tr.off td { color: var(--muted); background: #f3f5f8; }

.panel { padding: 1.4rem; margin-bottom: 1.25rem; }
.panel .scroll { margin-bottom: .75rem; box-shadow: none; }
.panel:target { border-color: var(--accent); box-shadow: 0 0 0 2px #1f639f59; }
.rates { margin-top: 1rem; }
.upload { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.upload input[type=file] { max-width: 100%; }
.upload label { display: flex; align-items: center; gap: .45rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem 1.25rem; margin-bottom: 1.4rem; }
.fields h2 { grid-column: 1 / -1; margin: .5rem 0 0; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.field.checkboxselectmultiple:not(.dropdown), .field.textarea { grid-column: 1 / -1; }
.label { display: flex; flex-wrap: wrap; gap: 0 .6rem; align-items: baseline; font-weight: 600; margin-bottom: .3rem; }
.label .required, .label .link { font-weight: 400; font-size: .83rem; }
.required { color: var(--muted); }
.checkboxselectmultiple > div:not(.label):not(.help):not(.error) { display: flex; flex-wrap: wrap; gap: .45rem; }
.checkboxselectmultiple > div > div > label { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--edge); border-radius: 99px; padding: .25rem .8rem .25rem .55rem; background: #fff; cursor: pointer; }
.checkboxselectmultiple > div > div > label:hover { border-color: #5f8db9; }
.checkboxselectmultiple label:has(:checked) { border-color: var(--accent); background: var(--soft); }
.error { color: var(--bad); font-size: .9rem; }
.error ul, .help ul { margin: .2rem 0; padding-left: 1.1rem; }
.quick { display: flex; gap: .4rem; margin-bottom: .4rem; }

.lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.1rem; }
.lists section { display: flex; flex-direction: column; overflow: hidden; }
.lists h2 { margin: 0; padding: .7rem 1.1rem; font-size: 1rem; background: var(--metal); color: #fff; box-shadow: var(--shine); }
.lists ul { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 1.1rem; padding: 0; }
.lists li a { display: block; padding: .2rem .75rem; border-radius: 99px; border: 1px solid var(--edge); background: var(--steel); color: var(--ink); text-decoration: none; }
.lists li a:hover { background: var(--metal-button); border-color: #1a477a; color: #fff; }
.lists section > a { margin: auto 1.1rem 1rem; }

/* Freelancer tiles: an open tile uses the whole width. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); grid-auto-flow: dense; gap: .5rem; }
.card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--stripe, var(--line)); border-radius: var(--radius); box-shadow: var(--lift); }
.card:hover { border-color: #5f8db9; border-left-color: var(--stripe, #5f8db9); }
.card[open] { grid-column: 1 / -1; }
.card.green { --tile: #f3f8f5; --stripe: #8fbfa3; }
.card.orange { --tile: #fcf7ee; --stripe: #e0b878; }
.card.red { --tile: #fbf3f2; --stripe: #d69d98; }
.card summary { background: var(--tile, #fff); display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: .35rem .55rem; border-radius: 8px var(--radius) var(--radius) 8px; font-size: .85rem; cursor: pointer; list-style: none; }
.card[open] summary { height: auto; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--tile, var(--soft)); }
.card .tag { padding: 0 .4rem; font-size: .7rem; }
.card strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card dl.details { border: 0; box-shadow: none; }
@media (min-width: 1000px) { .card dl.details { grid-template-columns: 7rem 1fr 7rem 1fr; } }
.card .scroll, .card > .buttons { margin: 0 1.25rem 1.15rem; }
#context { inset: auto; margin: 0; min-width: 190px; padding: .3rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 10px 30px #0f2c5238; }
#context form { margin: 0; }
#context a, #context button { display: block; width: 100%; margin: 0; padding: .45rem .7rem; border: 0; border-radius: 6px; background: none; box-shadow: none; color: var(--ink); font: inherit; font-size: .9rem; text-align: left; text-decoration: none; }
#context a:hover, #context button:hover, #context :focus-visible { background: var(--soft); }
#context .danger { color: var(--bad); }
.tag.first { background: #dcebe3; color: #2c5540; }
.tag.second { background: #f5e8d3; color: #694816; }
.skills { display: flex; flex-wrap: wrap; gap: .25rem; }
.foot { display: flex; align-items: center; gap: .5rem; margin-top: auto; }
.card:not([open]) .crown { gap: 0; font-size: 0; }
span.skills:empty { display: none; }
.stars { display: inline-flex; }
.card .crown svg { width: 17px; height: 13px; }
.card .stars button { font-size: .95rem; }
.stars button { padding: 0 .1rem; font-size: 1.1rem; line-height: 1.3; color: #bcc8d6; }
.stars .on { color: #d3a544; }
.stars button:hover { color: #a87400; }
.crown { display: flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: #7a5600; }
.crown svg { flex: none; width: 22px; height: 17px; fill: #ecc558; stroke: #a8802c; stroke-width: 1.3; stroke-linejoin: round; }

/* Report charts: colours are the first two slots of a colour-blind-safe palette, checked on white. */
.missing { margin-bottom: 1.25rem; max-height: 22rem; overflow-y: auto; }
.chart { margin: 0 0 1.25rem; padding: 1.2rem 1.4rem; }
.chart figcaption { font-weight: 600; }
.legend { display: flex; gap: 1.25rem; list-style: none; margin: .3rem 0 0; padding: 0; color: var(--muted); font-size: .87rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .4rem; }
.series1 { background: #257de0; }
.series2 { background: #f47230; }
.plot { position: relative; height: 210px; margin: 1.25rem 0 0 3.2rem; }
.plot.low { height: 120px; }
.tick { position: absolute; left: 0; right: 0; border-top: 1px solid #e7e7e7; }
.tick.zero { border-color: #c2c2c2; }
.tick span { position: absolute; right: 100%; top: -.65rem; margin-right: .5rem; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.months { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, 1fr); }
.month { position: relative; border-radius: 4px; }
.month:hover, .month:focus-visible { background: #14224f0d; }
.bar { position: absolute; width: min(22px, 38%); border-radius: 4px 4px 0 0; }
.bar.below { border-radius: 0 0 4px 4px; }
.bar.series1 { right: calc(50% + 1px); }
.bar.series2 { left: calc(50% + 1px); }
.low .bar { right: auto; left: 50%; transform: translateX(-50%); }
.tip { display: none; position: absolute; z-index: 4; bottom: 100%; left: 50%; transform: translateX(-50%); padding: .5rem .8rem; white-space: nowrap; font-size: .87rem; pointer-events: none; }
.month:hover .tip, .month:focus-visible .tip { display: block; }
.month:nth-child(n+10) .tip { left: auto; right: 0; transform: none; }
.tip i { display: inline-block; width: 12px; height: 3px; margin-right: .4rem; vertical-align: middle; }
.names { display: grid; grid-template-columns: repeat(12, 1fr); margin: .35rem 0 0 3.2rem; color: var(--muted); font-size: .8rem; text-align: center; }
.numbers th:not(:first-child), .numbers td:not(:first-child) { text-align: right; }
.numbers tfoot td { font-weight: 600; }
.clients { margin: .6rem 0 1rem; }
.bars { width: 28%; min-width: 120px; }
.bars i { display: block; height: 8px; margin: 2px 0; border-radius: 0 4px 4px 0; }
.copy { width: 100%; }

.calendar { table-layout: fixed; min-width: 640px; }
.calendar td { height: 5.2rem; border-right: 1px solid #e2eaf3; padding: .4rem .5rem; }
.calendar .other { background: #f3f5f8; color: var(--muted); }
.calendar .today > span { background: var(--accent); color: #fff; border-radius: 99px; padding: .1rem .5rem; font-weight: 600; }
/* Blue and red: freelancers. Violet and orange: in-house staff. */
.entry { --fill: #dbe9f8; --text: #164a7c; position: relative; display: block; margin-top: 2px; padding: 0 .35rem; border-left: 3px solid var(--text); border-radius: 4px; background: var(--fill); color: var(--text); font-size: .7rem; line-height: 1.45; font-weight: 600; text-decoration: none; }
.entry.away { --fill: var(--bad-soft); --text: var(--bad); }
.entry.house { --fill: #e9e2f8; --text: #56349b; }
.entry.house.away { --fill: #ffe9cc; --text: #8a4a00; }
.entry .short { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Enlarged while the mouse is on it. It opens towards the middle, so that it is never cut off. */
.entry .more { display: none; position: absolute; z-index: 5; top: -3px; left: -3px; width: max-content; min-width: 100%; max-width: 270px; padding: .5rem .75rem; border-left: 5px solid var(--text); border-radius: 8px; background: var(--fill); box-shadow: 0 8px 24px #0f2c5259; font-size: .95rem; line-height: 1.4; font-weight: 400; white-space: normal; overflow-wrap: anywhere; pointer-events: none; }
.entry:hover .more, .entry:focus-visible .more { display: block; }
.entry .more strong { display: block; }
.calendar td:nth-child(n+5) .more { left: auto; right: -3px; }
.calendar tbody tr:nth-last-child(-n+2) .more { top: auto; bottom: -3px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.legend .entry { margin: 0; font-size: .8rem; }

/* Sign-in */
body:has(.auth) { background: #1a3276 url("skyline.jpg") 60% 100% / cover no-repeat fixed; padding: 1rem; display: flex; flex-direction: column; }
/* Company name in the sky, as on the website */
.wordmark { align-self: flex-start; margin: 1rem 0 1.5rem max(.25rem, (100% - 1180px) / 2); color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.2; letter-spacing: .01em; text-shadow: 0 0 8px #0d1535; }
.wordmark span { display: block; margin-top: .3rem; padding-top: .35rem; border-top: 2px solid #6ca3d9; color: var(--sky); font-size: .56em; font-weight: 400; letter-spacing: .07em; text-align: center; }
.credit { display: none; margin: 1rem 0 0; text-align: center; font-size: .75rem; color: #fff; text-shadow: 0 0 4px #0d1535, 0 0 8px #0d1535; }
.credit a { color: inherit; }
.auth ~ .credit { display: block; }
.auth { flex: none; width: min(440px, 100%); margin: auto; padding: 2.25rem; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px #06152b73; }
.auth .fields { grid-template-columns: 1fr; }
.auth .link { margin-top: 1rem; }
.qr svg { width: 220px; height: 220px; background: #fff; }
.codes { columns: 2; list-style: none; padding: 1rem; background: var(--ground); border-radius: 10px; font: 1rem/1.9 Consolas, monospace; }

.invoice { max-width: 800px; padding: 2.5rem; }
.parties { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 3rem; margin-bottom: 2rem; }
.parties p { margin: 0; }
.invoice h2 { font-size: 1.75rem; }
.invoice table { margin: 1.5rem 0; }

@media print {
  nav, .banner, .noprint, .notice { display: none; }
  body { background: #fff; }
  main { padding: 0; }
  .invoice { border: 0; padding: 0; max-width: none; box-shadow: none; }
}
@media (max-width: 760px) {
  body { display: block; }
  nav { position: static; height: auto; padding: .7rem .8rem; flex-flow: row wrap; align-items: center; justify-content: space-between; }
  nav .brand { margin: 0 .4rem; }
  nav .menu { display: block; color: #123a68; }
  nav > a, nav form { display: none; }
  nav.open > a { display: flex; }
  nav.open form { display: block; width: 100%; padding: 0; margin: 0; }
  main { padding: 1.25rem 1rem 3rem; }
  .auth { padding: 1.5rem; }
  .figures div { flex-basis: 40%; min-width: 0; }
  .details { grid-template-columns: 1fr; gap: 0; }
  .details dd { margin-bottom: .6rem; }
  .names span:nth-child(even) { visibility: hidden; }
}

/* A small table inside a table cell */
.mini { width: auto; margin-top: .5rem; font-size: .83rem; border: 1px solid var(--line); }
.mini th, .mini td { padding: .25rem .7rem; white-space: nowrap; }
.mini th { font-size: .78rem; }
.mini :is(th, td):nth-child(n+2) { text-align: right; }
.scroll + .panel { margin-top: 1.25rem; }
:not(.card) > .scroll + form.buttons { margin-top: .9rem; }
