/* The client portal on top of Flow's stylesheets (flowui.css + flowtheme.css + flowfonts.css), 2026-10-16.
   Only what the portal needs: its sidebar extras, page furniture, status labels with words (never colour alone),
   and a phone layout where the sidebar becomes a top bar. Colours are Flow's tokens. The :root below is the
   LoyalServe default for pages with no theme (sign-in, printouts); the shell prints the requestor's theme
   (theme/helpers.php) after this file, so on portal pages that wins. */
:root {
  --smui-btn: #c2410c; --smui-btn-hover: #9a3412; --smui-btn-tint: #fff4ed; --smui-btn-tint2: #ffe8d9;
  --smui-link: #c2410c; --smui-accent: #c2410c; --smui-mark: #f97316; --smui-newjob-bg: #c2410c; --smui-newjob-fg: #fff;
  --smui-font: 'IBM Plex Sans', system-ui, sans-serif; --smui-font-head: 'Bricolage Grotesque', 'IBM Plex Sans', sans-serif;
  --req-line: #e3ded3; --req-card: #fff; --req-ok: #0e7c6b; --req-ok-bg: #e6f4f1; --req-warn: #9a5b00; --req-warn-bg: #fff4dc;
  --req-bad: #b42318; --req-bad-bg: #fdecea; --req-info: #1f5fa8; --req-info-bg: #eaf1fb; --req-radius: 12px;
}
.req-skip { position: absolute; left: -9999px; top: 8px; z-index: 3000; background: #fff; padding: 8px 12px; border-radius: 8px; }
.req-skip:focus { left: 8px; }
.req-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The sidebar's colours are the requestor's theme, the same rules agency Flow pages get (theme/helpers.php, printed by
   includes/shell.php); with none chosen, LoyalServe's warm paper with the current page a black pill. The logo is
   LoyalServe's navy shield (assets/img/icons/rocketserve_transparentbg.png) on a white tile, so it reads on every theme. */
.req-logo-img { flex: 0 0 auto; width: 28px; height: 28px; padding: 3px; box-sizing: border-box; background: #fff; border-radius: 7px; display: block; }
.req-nav a.smui-nav2-newbtn { border-radius: 10px; }   /* no "more" half beside it here */
.req-nav a.smui-nav2-newbtn.active { box-shadow: inset 0 0 0 2px #16191d; }
/* the portal has five items, so it keeps the full sidebar down to phone width (flowui.css turns it into an icon
   rail under 1100px and a scrolling strip under 720px; the portal has its own phone menu below) */
@media (max-width: 1100px) {
  .req-frame { grid-template-columns: 210px 1fr; }
  .req-nav .smui-nav-logo { font-size: 17px; justify-content: flex-start; padding: 0 16px; }
  .req-nav .smui-nav-logo::after { content: none; }
  .req-nav a.smui-nav-item { justify-content: flex-start; padding: 12px 0 12px 12px; margin-left: 8px; border-radius: 100px 0 0 100px; gap: 12px; font-size: 16px; }
  .req-nav a.smui-nav-item .fa { font-size: 16px; width: 18px; }
  .req-nav .smui-nav2-new { margin: 12px 12px 8px; }
  .req-nav a.smui-nav2-newbtn span { display: inline; }
  .req-main.smui-main { padding: 26px 24px 40px; }
}

/* sidebar extras */
.req-nav { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.req-nav-items { display: flex; flex-direction: column; flex: 1; }
.req-logo { gap: 10px; }
.req-logo-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.req-logo-text b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-logo-text small { font-size: 12px; opacity: .7; }
.req-menu-btn { display: none; margin-left: auto; background: none; border: 0; font-size: 20px; color: inherit; cursor: pointer; padding: 6px 8px; }
.req-badge { margin-left: auto; margin-right: 12px; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--smui-newjob-bg); color: var(--smui-newjob-fg); font-size: 12px; text-align: center; }   /* "Send a new job"'s colours: reversed where the sidebar is the button colour, so it can't vanish into it */
.req-agency { margin: 10px 12px; padding: 12px; border: 1px solid var(--req-line); border-radius: var(--req-radius); background: rgba(255,255,255,.55); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.req-agency-h { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; color: var(--smui-muted); }
.req-agency-n { font-weight: 600; }
.req-agency a { color: inherit; text-decoration: none; overflow-wrap: anywhere; font-size: 12.5px; }
.req-agency a:hover { text-decoration: underline; }
.req-me { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 12px 14px; font-size: 13px; color: var(--smui-muted); }
.req-me a { color: var(--smui-link); text-decoration: none; font-weight: 500; white-space: nowrap; }
/* the Theme picker's button (theme/picker.php opens its popover beside it, so it spans the sidebar) */
.req-theme-btn { display: flex; align-items: center; gap: 9px; margin: 0 12px 10px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid rgba(0, 0, 0, .12); background: rgba(255, 255, 255, .5); color: var(--smui-nav-fg); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.req-theme-btn:hover { background: rgba(255, 255, 255, .85); }
/* A dark sidebar (html[data-reqnav="dark"]: set by includes/shell.php for the saved theme, and by its script while a
   colour is tried in the picker): the portal's own sidebar pieces in light-on-dark, not the greys and orange made
   for paper */
html[data-reqnav="dark"] .req-agency { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .24); }
html[data-reqnav="dark"] .req-agency-h, html[data-reqnav="dark"] .req-me, html[data-reqnav="dark"] .req-me a { color: #fff; }   /* full white: a mid-tone sidebar (Forest) leaves no room for a dimmer grey */
html[data-reqnav="dark"] .req-theme-btn { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .05); color: #fff; }
html[data-reqnav="dark"] .req-theme-btn:hover { background: rgba(255, 255, 255, .12); }
html[data-reqnav="dark"] .req-nav.smui-nav { border-bottom-color: rgba(255, 255, 255, .14); }
/* while a colour is tried, the current page's pill takes its text colour (the default's white-on-black rule only
   goes on the next page load) */
html[data-reqnav] .req-nav a.smui-nav-item.active, html[data-reqnav] .req-nav a.smui-nav-item.active .fa { color: var(--smui-nav-fg); }

/* page furniture */
.req-main { max-width: 1240px; width: 100%; box-sizing: border-box; padding-bottom: 40px; }
.req-main h1, .req-h1 { font-family: var(--smui-font-head); font-size: 28px; font-weight: 600; margin: 0 0 4px; }
.req-sub { color: var(--smui-muted); margin: 0 0 22px; }
.req-card { background: var(--req-card); border: 1px solid var(--req-line); border-radius: var(--req-radius); box-shadow: var(--smui-card-shadow); padding: 18px 20px; margin-bottom: 18px; }
.req-card h2 { font-family: var(--smui-font-head); font-size: 18px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.req-card h2 .req-act { margin-left: auto; font-family: var(--smui-font); font-size: 14px; font-weight: 500; }
.req-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.req-muted { color: var(--smui-muted); }
.req-empty { padding: 22px; text-align: center; color: var(--smui-muted); background: #faf8f4; border-radius: 10px; }
a.req-link, .req-link { color: var(--smui-link); text-decoration: none; font-weight: 500; }
a.req-link:hover { text-decoration: underline; }

/* buttons and fields */
.req-btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; background: var(--smui-btn); color: #fff; }
.req-btn:hover { background: var(--smui-btn-hover); }
.req-btn.ghost { background: #fff; color: var(--smui-btn); border-color: #f0cdb9; }
.req-btn.ghost:hover { background: var(--smui-btn-tint); }
.req-btn.plain { background: transparent; color: var(--smui-text); border-color: var(--req-line); }
.req-btn:disabled { opacity: .55; cursor: not-allowed; }
.req-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.req-field label { font-weight: 500; font-size: 14px; }
.req-field .req-hint { font-size: 13px; color: var(--smui-muted); }
.req-field input, .req-field select, .req-field textarea { font: inherit; padding: 9px 11px; border: 1px solid #d4cec2; border-radius: 9px; background: #fff; min-width: 0; }
.req-field input:focus, .req-field select:focus, .req-field textarea:focus { outline: 2px solid #fdba74; outline-offset: 1px; border-color: var(--smui-btn); }
.req-field.err input, .req-field.err select, .req-field.err textarea { border-color: var(--req-bad); }
.req-field .req-errmsg { color: var(--req-bad); font-size: 13px; }
.req-msg { padding: 10px 14px; border-radius: 10px; margin: 10px 0; }
.req-msg.ok { background: var(--req-ok-bg); color: var(--req-ok); }
.req-msg.bad { background: var(--req-bad-bg); color: var(--req-bad); }
.req-msg.info { background: var(--req-info-bg); color: var(--req-info); }

/* status labels: always words, colour only helps */
.req-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.req-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.req-status.ok { background: var(--req-ok-bg); color: var(--req-ok); }
.req-status.warn { background: var(--req-warn-bg); color: var(--req-warn); }
.req-status.bad { background: var(--req-bad-bg); color: var(--req-bad); }
.req-status.info { background: var(--req-info-bg); color: var(--req-info); }
.req-status.muted { background: #efece4; color: var(--smui-muted); }

/* tables that become cards on a phone: give each td a data-label */
.req-table { width: 100%; border-collapse: collapse; }
.req-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--smui-muted); padding: 8px 10px; border-bottom: 1px solid var(--req-line); }
.req-table td { padding: 11px 10px; border-bottom: 1px solid #efebe3; vertical-align: top; }
.req-table tr:hover td { background: #fcfbf8; }

/* phones: the sidebar becomes a top bar with a menu */
@media (max-width: 860px) {
  .req-frame { display: block; }
  .req-nav.smui-nav { position: sticky; top: 0; height: auto; max-height: 100vh; z-index: 1000; flex-direction: column; align-items: stretch; overflow-x: hidden; border-right: 0; border-bottom: 1px solid #e0dbcf; }
  .req-nav .smui-nav-logo { display: flex; height: 54px; }
  .req-nav .smui-nav-spacer { display: none; }
  .req-menu-btn { display: inline-flex; }
  .req-nav .req-nav-items { display: none; padding-bottom: 8px; }
  .req-nav.open .req-nav-items { display: flex; }
  .req-nav a.smui-nav-item { margin-right: 8px; border-radius: 10px; }
  .req-main { padding: 18px 16px 32px; }
  .req-main h1, .req-h1 { font-size: 23px; }
  .req-table thead { display: none; }
  .req-table, .req-table tbody, .req-table tr, .req-table td { display: block; width: 100%; box-sizing: border-box; }
  .req-table tr { border: 1px solid var(--req-line); border-radius: 10px; margin-bottom: 10px; padding: 6px 4px; background: #fff; }
  .req-table td { border: 0; padding: 5px 10px; display: flex; gap: 12px; justify-content: space-between; }
  .req-table td[data-label]::before { content: attr(data-label); color: var(--smui-muted); font-size: 13px; flex: 0 0 auto; }
}

/* linked companies (portalfirmlinks): the Company switch on Invoices and New job, and the company tag on list rows */
.req-coseg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: 12px; background: #ebe6db; width: fit-content; max-width: 100%; box-sizing: border-box; }
.req-coseg a { padding: 7px 13px; border-radius: 9px; color: #3d434a; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.req-coseg a:hover { background: #f5f3ee; }
.req-coseg a.on { background: #fff; color: #16191d; box-shadow: 0 1px 3px rgba(22, 25, 29, .14); }
.req-coseg a:focus-visible { outline: 2px solid #fdba74; outline-offset: 1px; }
.req-cotag { display: inline-block; max-width: 100%; padding: 1px 8px; border-radius: 100px; background: #ebe6db; color: #3d434a; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
