/* Siyaneh's look: one place for colors, type and the page frame (menu on the left, page title on top).
   Loaded last, so it wins over the older per-page styles in index.html and the scripts.

   Colors: petrol for the menu and main actions, a hi-vis amber "work tag" for where you are and what's waiting,
   a cool stone background so white cards and forms stand out. An LLC's own color still tints its invoice screen. */
/* IBM Plex Sans, shipped with Siyaneh (fonts/, SIL Open Font License): one file covers every weight */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url("/fonts/plex_sans.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url("/fonts/plex_sans_ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 100 700; font-display: swap;
  src: url("/fonts/plex_sans_italic.woff2") format("woff2"); }
:root {
  --side: #16313a;  --side-2: #1d3d47;  --side-ink: #c3d0d3;  --side-dim: #7f979d;
  --tag: #f0a43a;   --tag-ink: #3a2603;
  --navy: #1e5566;  --navy-2: #276a7e;           /* the main action color (an LLC's invoice screen uses its own) */
  --ink: #1b2427;   --muted: #5f6b6e;  --line: #d9dfdc;  --line-2: #e7ebe8;
  --bg: #eff1ee;    --card: #fff;      --soft: #e9eeec;
  --ok: #1d7048;    --warn: #9a4a12;   --bad: #b02a2a;
  --side-w: 236px;
  --radius: 8px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font: 14px/1.5 "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--bg);
  font-variant-numeric: tabular-nums;
}
body.signed-in { padding-left: var(--side-w); }

/* ---- the menu ---------------------------------------------------------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 18px 12px 14px; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.side-logo { width: 32px; height: 32px; flex: none; display: block; }
.side-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .16em; }
.side-tag { color: var(--side-dim); font-size: 11.5px; }
.side-nav { display: grid; gap: 18px; flex: 1; align-content: start; }
.nav-group { display: grid; gap: 1px; }
.nav-h { color: var(--side-dim); font-size: 12px; font-weight: 500; padding: 0 10px 5px; }
.side-nav button {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; background: transparent; border: 0; border-radius: 6px;
  color: var(--side-ink); font-weight: 500; font-size: 14px; padding: 7px 10px 7px 14px;
}
.side-nav button:hover { background: var(--side-2); color: #fff; }
.side-nav button.on { background: var(--side-2); color: #fff; font-weight: 600; }
.side-nav button.on::before {      /* the amber tag: you are here */
  content: ""; position: absolute; left: 3px; top: 7px; bottom: 7px; width: 4px; border-radius: 2px; background: var(--tag);
}
.side-nav button:focus-visible, .side-link:focus-visible { outline: 2px solid var(--tag); outline-offset: 1px; }
.nav-n {
  background: var(--tag); color: var(--tag-ink); border-radius: 9px; font-size: 11px; font-weight: 700;
  padding: 1px 7px; margin-left: 6px; line-height: 1.5;
}
.side-user { border-top: 1px solid rgba(255,255,255,.1); padding: 12px 8px 0; margin-top: 14px; display: grid; gap: 6px; }
.side-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #fff; font-weight: 500; }
.who-role { font-size: 11px; color: var(--side-ink); background: rgba(255,255,255,.1); padding: 1px 8px; border-radius: 9px; font-weight: 500; }
.side-link { background: transparent; border: 0; color: var(--side-ink); padding: 3px 6px 3px 0; font-size: 13px; }
.side-link:hover { background: transparent; color: #fff; text-decoration: underline; }

/* ---- page title bar ------------------------------------------------------ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px 32px 16px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.ph-crumb { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.page-head h1 { margin: 1px 0 2px; font-size: 24px; line-height: 1.2; font-weight: 600; color: var(--ink); }
.page-head .sub { color: var(--muted); font-size: 13.5px; max-width: 72ch; }
.ph-acts { gap: 8px; }
.ph-acts button { background: #fff; }
.bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 36px; padding: 0; color: var(--ink); }
.bell .nav-n { position: absolute; top: -6px; right: -8px; margin: 0; }
#notifPanel { top: 86px; right: 28px; border-radius: 10px; }

/* ---- the content area ------------------------------------------------------ */
main, #jobsView, #techView, #empView, #reqView, #reportView, #rolesView, #auditView, #llcView, #acctView, #findView {
  margin: 22px 32px 80px; max-width: 1280px; padding: 0;
}
main { max-width: 1060px; }
#picker { margin: 28px 32px; max-width: 640px; padding: 0; }
#picker h2 { font-size: 18px; font-weight: 600; }
.co { border-radius: var(--radius); padding: 13px 16px; font-weight: 500; border-color: var(--line); }
.co:hover { border-color: var(--navy); background: #fff; }
.co .last { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }

/* ---- type ----------------------------------------------------------------- */
h2, h3 { letter-spacing: 0; }
.card { border-radius: var(--radius); border-color: var(--line); padding: 18px 20px; }
.card h2 { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.hint { color: var(--muted); }
label { font-weight: 500; color: #4a5558; font-size: 12.5px; }
a { color: var(--navy); }
a:hover { color: var(--navy-2); }

/* ---- controls ------------------------------------------------------------- */
input, textarea, select { border-color: #cfd6d3; border-radius: 6px; padding: 8px 10px; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--navy) 30%, transparent); outline-offset: 0; border-color: var(--navy); }
button { border-radius: 6px; border-color: #cfd6d3; padding: 7px 13px; font-weight: 500; }
button:hover { background: var(--soft); }
button:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
button.primary { background: var(--navy); border-color: var(--navy); font-weight: 600; }
button.primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
button.danger { background: var(--bad); border-color: var(--bad); }
.chip { border-radius: 999px; padding: 5px 13px; font-weight: 500; background: #fff; border-color: #cfd6d3; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { opacity: .65; }
dialog { border-radius: 12px; border-color: var(--line); box-shadow: 0 18px 50px rgba(16,30,36,.22); }
dialog::backdrop { background: rgba(16,30,36,.42); }
.doc-switch { border-radius: 8px; border-color: #cfd6d3; }
.doc-switch button { font-weight: 500; }

/* ---- tables ----------------------------------------------------------------- */
.jtable, .rpt-table { border-color: var(--line); border-radius: var(--radius); }
.jtable th, .rpt-table th, .roles-table th, .d-row.head {
  text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted); background: #f6f7f5;
}
.jtable td { border-color: var(--line-2); }
.jtable tr.jrow:hover td { background: #f5f8f7; }
.jtable tr.yrow td { background: #eef2f0; color: var(--ink); }
.roles-table tr.grp td { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); background: #eef2f0; }
.rpt-filters label.lab, .fnd-dist small { text-transform: none; letter-spacing: 0; }
.jsec h3 { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---- jobs board ------------------------------------------------------------- */
.jobs-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.jobs-top .hello { font-size: 15px; color: var(--muted); }
.jobs-top .hello b { color: var(--ink); font-weight: 600; }
#jAlerts:not(:empty) {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--tag); border-radius: var(--radius);
  padding: 4px 16px 6px; display: grid;
}
#jAlerts:not(:empty)::before { content: "Needs attention"; font-weight: 600; font-size: 14px; padding: 10px 0 4px; }
#jAlerts > div { background: transparent !important; border: 0 !important; border-top: 1px solid var(--line-2) !important;
  border-radius: 0 !important; margin: 0 !important; padding: 9px 0 !important; box-shadow: none !important; }
#jAlerts > div:first-child { border-top: 0 !important; }
#jAlerts ul { margin: 4px 0 0 18px; }
.pipe { border-radius: var(--radius); border-color: var(--line); padding: 14px 16px; margin: 0; }
.pipe-head { color: var(--ink); }
.pipe-card { border-color: var(--line-2); border-radius: 7px; background: #fbfcfb; }
.pipe-card:hover { border-color: #9db3ad; }
.pipe-card.on { border-color: var(--navy); background: #eef5f6; box-shadow: inset 0 0 0 1px var(--navy); }
.tile { border-radius: var(--radius); border-color: var(--line); }
.tile:hover { border-color: #9db3ad; }
.tile .val { color: var(--ink); font-weight: 600; }
.jobs-toolbar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 10px; }
.jobs-toolbar .row { justify-content: space-between; }
.jobs-toolbar input, .jobs-toolbar select { padding: 6px 9px; }

/* ---- sign-in ---------------------------------------------------------------- */
.login-card { border-radius: 12px; border-color: var(--line); border-top: 5px solid var(--side); }
.login-card h1 { color: var(--side) !important; font-weight: 600; }

/* ---- small screens: the menu becomes a bar across the top -------------------- */
@media (max-width: 900px) {
  body.signed-in { padding-left: 0; }
  .side { position: static; width: auto; padding: 12px 14px; }
  .side-brand { padding-bottom: 10px; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
  .nav-h { padding: 0 4px 0 0; }
  .side-nav button { width: auto; padding: 6px 10px 6px 12px; }
  .side-user { flex-direction: row; display: flex; align-items: center; justify-content: space-between; }
  .page-head { padding: 16px; }
  main, #jobsView, #techView, #empView, #reqView, #reportView, #rolesView, #auditView, #llcView, #acctView, #findView, #picker { margin: 16px 16px 60px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* "Disable" and similar in lists: still red, but not the loudest thing on every row */
.llc-card button.danger, #empView td button.danger, .jtable td button.danger {
  background: #fff; color: var(--bad); border-color: #e2b4b4; font-weight: 500;
}
.llc-card button.danger:hover, #empView td button.danger:hover, .jtable td button.danger:hover { background: #fbeeee; }
.llc-card { border-radius: var(--radius); border-color: var(--line); }

/* ---- icons ---------------------------------------------------------------- */
.ico { width: 15px; height: 15px; vertical-align: -3px; flex: none; }
.warn-txt .ico, .hint .ico { width: 13px; height: 13px; vertical-align: -2px; }

/* ---- waiting for the server --------------------------------------------- */
#loadBar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--tag), transparent); background-size: 40% 100%; background-repeat: no-repeat; }
#loadBar.on { opacity: 1; animation: loadslide 1s linear infinite; }
@keyframes loadslide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ---- messages in the corner ---------------------------------------------- */
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: grid; gap: 8px; max-width: min(420px, 92vw); }
.toast { display: flex; gap: 9px; align-items: flex-start; background: var(--ink); color: #fff; border-radius: 8px; padding: 11px 14px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(16,30,36,.25); cursor: pointer; transition: opacity .5s, transform .5s; }
.toast .ico { color: #7fd3a5; margin-top: 2px; }
.toast.error { background: #5c1d1d; } .toast.error .ico { color: #ffb4a8; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---- question boxes -------------------------------------------------------- */
#askDlg { width: min(460px, 94vw); padding: 22px 22px 18px; }
.ask-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.ask-body { color: var(--muted); white-space: pre-line; font-size: 13.5px; margin-bottom: 4px; }
#askDlg input { margin-top: 10px; }
.ask-acts { justify-content: flex-end; margin-top: 18px; }

/* ---- "More" menus ------------------------------------------------------------ */
details.more { position: relative; display: inline-block; }
details.more > summary { list-style: none; cursor: pointer; border: 1px solid #cfd6d3; border-radius: 6px; padding: 6px 10px 6px 12px;
  background: #fff; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; user-select: none; white-space: nowrap; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { background: var(--soft); }
details.more[open] > summary { background: var(--soft); }
.more-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 12px 30px rgba(16,30,36,.16); padding: 5px; display: grid; }
.more-pop button, .more-pop a { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 5px; white-space: nowrap;
  color: var(--ink); font-size: 13.5px; text-decoration: none; }
.more-pop button:hover, .more-pop a:hover { background: var(--soft); }
.more-pop .danger, .more-pop button.danger { background: transparent; color: var(--bad); border: 0; font-weight: 500; }
.more-pop .danger:hover { background: #fbeeee; }
.more-pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 2px; }

/* ---- the invoice screen ----------------------------------------------------- */
main .two { align-items: start; }
main .doc-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; margin: -8px 0; }

/* ---- the jobs list ------------------------------------------------------------- */
.jobs-list td { padding: 10px 10px; }
.jobs-list .nw { white-space: nowrap; }
.jobs-list td:nth-child(5) { white-space: normal; overflow-wrap: anywhere; max-width: 150px; }
.jobs-list td:nth-child(4) { max-width: 220px; overflow-wrap: anywhere; }
.jobs-list td:nth-child(3) { max-width: 110px; }
.jobs-list th.money-h { text-align: right; }
.jobs-list td.money { min-width: 150px; }
.jobs-list .mrow { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; line-height: 1.55; }
.jobs-list .mrow span { color: var(--muted); }
.jobs-list .mrow b { font-weight: 600; }
.jobs-list .sub .ico { width: 12px; height: 12px; vertical-align: -1px; }
td.empty, .empty { padding: 28px 18px; text-align: center; color: var(--muted); }
#jTiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ---- a job: its own page, beside the menu, with tabs ------------------------------- */
#jobDlg.job-page { position: fixed; inset: 0 0 0 var(--side-w); width: auto; max-width: none; height: 100vh; max-height: none;
  margin: 0; border: 0; border-radius: 0; padding: 0; background: var(--bg); box-shadow: -8px 0 30px rgba(16,30,36,.12); overflow: hidden; }
#jobDlg.job-page[open] { display: flex; flex-direction: column; }
dialog.job-page::backdrop { background: rgba(16,30,36,.25); }
.job-page .jd-head { position: static; display: block; padding: 14px 32px 0; background: #fff; border-bottom: 1px solid var(--line); }
.jd-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.jd-top h2 { margin: 0 4px 0 2px; font-size: 22px; font-weight: 600; color: var(--ink); }
.jd-back { border: 0; background: transparent; color: var(--muted); padding: 4px 6px 4px 0; display: inline-flex; align-items: center; gap: 2px; }
.jd-back:hover { background: transparent; color: var(--ink); }
.jd-back .ico.back { transform: rotate(90deg); }
.jd-sub { margin: 6px 0 2px; font-size: 13px; }
.jd-tabs { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; }
.jd-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; padding: 9px 14px 8px;
  color: var(--muted); font-weight: 500; white-space: nowrap; }
.jd-tabs button:hover { color: var(--ink); background: transparent; }
.jd-tabs button.on { color: var(--ink); border-bottom-color: var(--tag); font-weight: 600; }
.jd-tabs .n { margin-left: 6px; font-size: 11.5px; background: var(--soft); color: var(--muted); border-radius: 9px; padding: 1px 7px; }
.job-page .jd-body { flex: 1; overflow-y: auto; padding: 20px 32px 60px; display: grid; gap: 16px; align-content: start; }
.job-page .jd-body > * { max-width: 1180px; }
.job-page .jsec { background: #fff; border-color: var(--line); border-radius: var(--radius); padding: 16px 18px; }
.job-page .jd-panel { display: grid; gap: 16px; }
.job-page .jd-panel[hidden] { display: none; }
.jd-col { display: grid; gap: 16px; align-content: start; }
.job-page .tracker { background: #fff; border-radius: var(--radius); }
.job-page .hist { max-height: none; }
.job-page .money-row a { font-weight: 600; text-decoration: none; }
@media (max-width: 900px) { #jobDlg.job-page { inset: 0; } .job-page .jd-head, .job-page .jd-body { padding-left: 16px; padding-right: 16px; } }
.job-page .jd-head:not(:has(.jd-top)) { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-bottom: 14px; }
.job-page .jd-head:not(:has(.jd-top)) h2 { font-size: 20px; font-weight: 600; color: var(--ink) !important; }

/* ---- row colors: what each job needs at a glance ------------------------------------- */
.jobs-list tr.jrow td:first-child { box-shadow: inset 4px 0 0 transparent; }
.jobs-list tr.jrow.tone-attention td { background: #fbe9e6; }
.jobs-list tr.tone-attention td:first-child { box-shadow: inset 4px 0 0 #c4402f; }
.jobs-list tr.jrow.tone-waiting td { background: #fff4da; }
.jobs-list tr.tone-waiting td:first-child { box-shadow: inset 4px 0 0 #e0a526; }
.jobs-list tr.jrow.tone-done td { background: #e9f5ed; }
.jobs-list tr.tone-done td:first-child { box-shadow: inset 4px 0 0 #2f8a5b; }
.jobs-list tr.jrow.tone-cancelled td { background: #f1f2f1; color: var(--muted); }
.jobs-list tr.tone-cancelled td:first-child { box-shadow: inset 4px 0 0 #a9b0ad; }
.jobs-list tr.jrow:hover td { filter: brightness(.96); }
.tone-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin: 0 2px 8px; }
.tone-legend .tl { display: inline-flex; align-items: center; gap: 6px; }
.tone-legend i { width: 12px; height: 12px; border-radius: 3px; background: #fff; border: 1px solid var(--line); }
.tone-legend b { color: var(--ink); font-weight: 600; margin-left: 2px; }
.tone-legend .tone-attention i { background: #fbe9e6; border-color: #c4402f; border-left-width: 4px; }
.tone-legend .tone-waiting i { background: #fff4da; border-color: #e0a526; border-left-width: 4px; }
.tone-legend .tone-done i { background: #e9f5ed; border-color: #2f8a5b; border-left-width: 4px; }
.tone-legend .tone-cancelled i { background: #f1f2f1; border-color: #a9b0ad; border-left-width: 4px; }
.tile .val .rtl { font-size: 17px; line-height: 1.35; white-space: nowrap; }
.tile .val small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 5px; }

/* the sign-in card: the SIYANEH mark and name */
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 40px; height: 40px; flex: none; }
.login-brand span { font-weight: 700; letter-spacing: .16em; color: var(--side); }
