/* Wisdom Light customer portal and Optivise AI ERP demo. Shares the public site's palette. */
:root {
  --bg: #ffffff; --bg-2: #fff7ee; --bg-3: #ffecd6;
  --ink: #1d1b19; --ink-2: #4b4743; --mut: #7a746d;
  --rule: rgba(29, 27, 25, .12); --rule-2: rgba(29, 27, 25, .26);
  --accent: #ef7700; --accent-2: #ff9d3a; --accent-ink: #1d1b19; --accent-deep: #b85400;
  --good: #1f8a4c; --warn: #a86200; --bad: #c2410c;
  --font: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; height: 100%; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: .9375rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--rule); background: var(--bg-2); padding: 24px 16px; }
.side__logo img { height: 26px; width: auto; display: block; margin: 0 8px 6px; }
.side__name { margin: 0 8px 28px; color: var(--mut); font-size: .8125rem; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; text-decoration: none; color: var(--ink-2); border-left: 2px solid transparent; transition: background-color .15s, color .15s; }
.side nav a:hover { background: var(--bg-3); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--bg); color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
.side nav a span { font-size: .75rem; color: var(--mut); font-variant-numeric: tabular-nums; }
.side__foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--rule); font-size: .8125rem; color: var(--mut); }
.side__foot a { display: block; margin-top: 8px; color: var(--ink-2); text-decoration: none; }
.side__foot a:hover { color: var(--ink); }
.sample { display: inline-block; border: 1px solid var(--accent); color: var(--accent-deep); background: var(--bg); padding: 3px 8px; font-size: .75rem; margin-bottom: 8px; }

.main { min-width: 0; padding: 0 clamp(20px, 3vw, 48px) 64px; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 80px; border-bottom: 3px solid var(--accent); margin-bottom: 36px; flex-wrap: wrap; padding-block: 16px; }
.bar h1 { font-size: 1.75rem; font-weight: 300; letter-spacing: -.035em; line-height: 1.1; }
.bar__who { margin-left: auto; text-align: right; font-size: .8125rem; color: var(--mut); }
.bar__who b { display: block; color: var(--ink); font-weight: 500; font-size: .9375rem; }
.view > h2, .h2 { font-size: 1.375rem; font-weight: 400; letter-spacing: -.02em; margin: 40px 0 16px; }
.view > h2:first-child { margin-top: 0; }
.sub { color: var(--mut); margin: -8px 0 20px; max-width: 70ch; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); }
.kpi { padding: 22px 24px; border-right: 1px solid var(--rule); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi dt { color: var(--mut); font-size: .8125rem; }
.kpi dd { font-size: clamp(1.8rem, 2.6vw, 2.6rem); font-weight: 300; letter-spacing: -.04em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi small { display: block; margin-top: 6px; color: var(--mut); font-size: .8125rem; }
.up { color: var(--good); } .down { color: var(--bad); }

.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; margin-top: 24px; }
.box { border: 1px solid var(--rule); padding: 22px 24px; min-width: 0; }
.box h2, .box h3 { font-size: 1rem; font-weight: 500; letter-spacing: -.01em; margin-bottom: 16px; }
.box__top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.box__top h2 b { font-weight: inherit; white-space: nowrap; }
.box__top span { color: var(--mut); font-size: .8125rem; }

.tw { overflow-x: auto; border: 1px solid var(--rule); }
.box .tw { border: 0; margin: 0 -24px -22px; border-top: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--rule); white-space: nowrap; vertical-align: middle; }
thead th { font-weight: 500; font-size: .8125rem; color: var(--mut); background: var(--bg-2); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 500; }
tr.click { cursor: pointer; transition: background-color .15s; }
tr.click:hover, tr.click:focus-visible { background: var(--bg-2); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; min-width: 240px; }
.mono { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.pill { display: inline-block; padding: 3px 10px; font-size: .8125rem; border: 1px solid var(--rule-2); color: var(--ink-2); }
.pill--good { border-color: var(--good); color: var(--good); }
.pill--warn { border-color: var(--warn); color: var(--warn); }
.pill--bad { border-color: var(--bad); color: var(--bad); }
.pill--on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: 20px 0 8px; }
.track li { font-size: .75rem; color: var(--mut); padding-top: 10px; border-top: 3px solid var(--rule); }
.track li.done { border-color: var(--ink); color: var(--ink-2); }
.track li.now { border-color: var(--accent); color: var(--ink); font-weight: 500; }

.meter { height: 6px; background: var(--bg-3); position: relative; min-width: 90px; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.meter i.hot { background: var(--bad); } .meter i.warm { background: var(--warn); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--ghost { background: var(--bg); color: var(--ink); border-color: var(--rule-2); }
.btn--ghost:hover { border-color: var(--accent); background: var(--bg-2); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: .8125rem; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form label { font-size: .8125rem; color: var(--mut); }
.form input, .form select, .form textarea { display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--rule-2); border-radius: 0; color: var(--ink); }
.form .wide { grid-column: 1 / -1; }
.msg { border: 1px solid var(--good); color: var(--good); padding: 12px 14px; margin-top: 16px; }

.drawer { overscroll-behavior: contain; position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); background: var(--bg); border-left: 1px solid var(--rule-2); padding: 28px 28px 40px; overflow-y: auto; z-index: 40; box-shadow: -40px 0 80px rgba(60, 30, 0, .22); }
.drawer__x { float: right; background: var(--bg); border: 1px solid var(--rule-2); padding: 6px 12px; cursor: pointer; }
.drawer h2 { font-size: 1.75rem; font-weight: 300; letter-spacing: -.03em; margin-bottom: 4px; }
.drawer dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); margin: 20px 0; }
.drawer dl div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); }
.drawer dt { font-size: .8125rem; color: var(--mut); }
.log li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.log li span { color: var(--mut); font-variant-numeric: tabular-nums; }

.alerts li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.alerts li:last-child { border-bottom: 0; padding-bottom: 0; }
.alerts p { color: var(--ink-2); }
.alerts button { margin-top: 8px; }
.alerts .ok { color: var(--good); font-size: .8125rem; margin-top: 8px; }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--mut); font-size: 11px; font-family: var(--font); }
.chart .v { fill: var(--ink-2); }

.board { display: grid; grid-template-columns: repeat(8, minmax(168px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.lane { border-top: 3px solid var(--rule-2); padding-top: 12px; min-width: 0; }
.lane h3 { font-size: .875rem; font-weight: 500; display: flex; justify-content: space-between; margin-bottom: 12px; }
.lane h3 span { color: var(--mut); font-weight: 400; }
.tk { display: block; width: 100%; text-align: left; background: var(--bg-2); border: 1px solid var(--rule); padding: 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s; }
.tk:hover { border-color: var(--ink-2); }
.tk b { display: block; font-weight: 500; }
.tk span { display: block; color: var(--mut); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk em { display: block; font-style: normal; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tk--new { border-color: var(--accent); }

.gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(60vw 40vw at 80% 0, var(--bg-3), var(--bg) 70%); padding: 24px; }
.gate__in { width: min(560px, 100%); }
.gate img.logo { height: 30px; width: auto; margin-bottom: 48px; }
.gate h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 300; letter-spacing: -.04em; line-height: 1; margin-bottom: 20px; }
.gate p { color: var(--ink-2); font-size: 1.0625rem; margin-bottom: 28px; max-width: 46ch; }
.gate .btn { min-height: 52px; padding: 0 28px; }
.gate small { display: block; margin-top: 20px; color: var(--mut); }

@media (max-width: 64rem) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .side__name { margin: 0; } .side__logo img { margin: 0; }
  .side nav { display: flex; overflow-x: auto; width: 100%; }
  .side nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .side nav a[aria-current="page"] { border-bottom-color: var(--accent); }
  .side__foot { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(2) { border-right: 0; } .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .cols, .form { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }
.side nav a { gap: 8px; }
@media (max-width: 64rem) {
  .track li { font-size: 0; }
  .track li.now { font-size: .75rem; white-space: nowrap; }
}

.foot { display: none; }

/* Phones */
@media (max-width: 64rem) {
  .side { position: sticky; top: 0; z-index: 30; padding-bottom: 0; }
  .side nav { margin-inline: -16px; width: calc(100% + 32px); padding-inline: 16px; scroll-padding-inline: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent); }
  .side nav::-webkit-scrollbar { display: none; }
  .side__name { margin-right: auto; }
  .side .sample--top { display: inline-block; margin: 0; }
  .foot { display: block; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .8125rem; color: var(--mut); }
  .foot p { max-width: 60ch; }
  .foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; }
  .foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
}
@media (max-width: 64rem) and (max-height: 30rem) { .side { position: static; } }
.sample--top { display: none; }

@media (max-width: 40rem) {
  /* 16px inputs: iOS Safari zooms the page on focus below that. */
  .form input, .form select, .form textarea { font-size: 1rem; }
  .main { padding-inline: 16px; padding-bottom: 40px; }
  .bar { min-height: 0; margin-bottom: 24px; padding-block: 14px; gap: 4px 16px; }
  .bar h1 { font-size: 1.5rem; }
  .bar__who { margin-left: 0; text-align: left; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
  .bar__who b { font-size: .8125rem; }
  .kpi { padding: 16px; }
  .box { padding: 18px 16px; }
  .box .tw { margin: 0 -16px -18px; }
  .cols { gap: 16px; margin-top: 16px; }
  .view > h2, .h2 { margin-top: 32px; }
  .btn--sm { min-height: 44px; padding: 0 14px; }
  .drawer { padding: 20px 16px 32px; border-left: 0; }
  .drawer__x { min-height: 44px; padding: 0 16px; position: sticky; top: 0; z-index: 1; }
  .log li { grid-template-columns: auto minmax(0, 1fr); }
  .log li span { white-space: nowrap; min-width: 52px; }
  .drawer__x { top: 0; margin: 0 0 8px 12px; }

  /* Tables become one card per row: the first cell is the heading, the rest are label and value pairs. */
  .tw { overflow: visible; border: 0; }
  .box .tw { margin: 16px 0 0; border-top: 0; }
  table.cards, table.cards tbody { display: block; }
  table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px; border: 1px solid var(--rule); margin-bottom: 8px; }
  table.cards tr:last-child { margin-bottom: 0; }
  table.cards th, table.cards td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; text-align: left; overflow-wrap: anywhere; }
  table.cards tbody th { grid-column: 1 / -1; font-size: 1rem; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
  table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--mut); margin-bottom: 2px; }
  table.cards td.wrap, table.cards td.mono, table.cards td[colspan] { grid-column: 1 / -1; }
  table.cards td.num { text-align: left; }
  table.cards tr.click { position: relative; padding-right: 36px; }
  table.cards tr.click::after { content: ""; position: absolute; right: 16px; top: 22px; width: 8px; height: 8px; border-right: 1.5px solid var(--mut); border-top: 1.5px solid var(--mut); transform: rotate(45deg); }
  table.cards td a { display: inline-flex; align-items: center; min-height: 32px; }
  .meter { min-width: 0; }
}
