/* Project layout and business views use the supplied operations design tokens. */
body { margin: 0; }
.jh-ui {
  --bg: var(--jh-canvas);
  --white: var(--jh-surface);
  --ink: var(--jh-text);
  --muted: var(--jh-text-muted);
  --sub: var(--jh-text-muted);
  --line: var(--jh-border);
  --blue: var(--jh-brand);
  --good: var(--jh-success);
  --warn: var(--jh-warning);
  --radius: var(--jh-panel-radius);
  min-height: 100vh;
}
.jh-ui :where(svg) { width: 20px; height: 20px; vertical-align: middle; flex: none; }
.jh-ui :where(button svg) { width: 18px; height: 18px; }
.jh-ui :where(input, select, textarea) {
  min-height: var(--jh-control-height);
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--jh-border);
  border-radius: var(--jh-control-radius);
  background: var(--jh-surface);
  color: var(--jh-text);
  line-height: 1.4;
}
.jh-ui :where(input, textarea)::placeholder { color: var(--jh-text-muted); opacity: 1; }
.jh-ui :where(input[readonly]) { background: var(--jh-surface-muted); }
.jh-ui :where(textarea) { min-height: 80px; resize: vertical; }
.jh-ui :where(input[type='checkbox']) { min-height: 0; width: 18px; height: 18px; accent-color: var(--jh-brand); flex: none; }
.jh-ui :where(small) { font-size: var(--jh-font-xs); }
.jh-ui .muted, .jh-ui .soft { color: var(--jh-text-muted); }
.jh-ui .soft { font-size: 12px; line-height: 1.6; }
.jh-ui .mono { color: var(--jh-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jh-ui .num, .jh-ui .nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.jh-ui .num { font-weight: 600; }
.jh-ui .up { color: var(--jh-success); }
.jh-ui .down { color: var(--jh-danger); }
.jh-ui .cellsub { display: block; color: var(--jh-text-muted); font-size: 12px; margin-top: 3px; }
.jh-ui .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jh-ui .stack { display: grid; gap: 16px; min-width: 0; }

/* Navigation and context */
.jh-ui .app { display: grid; grid-template-columns: var(--jh-sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.jh-ui .app > aside {
  display: flex;
  position: sticky;
  top: 0;
  grid-row: auto;
  height: 100dvh;
  padding: 24px 12px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  gap: 20px;
  background: var(--jh-surface);
  border-right: 1px solid var(--jh-border);
}
.jh-ui .brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 4px; }
.jh-ui .brandmark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; background: var(--jh-brand); color: var(--jh-on-brand); }
.jh-ui .brand b { display: block; font-size: 20px; letter-spacing: 2px; color: var(--jh-brand); }
.jh-ui .brand small { display: block; color: var(--jh-text-muted); font-size: 11px; }
.jh-ui .jh-sidebar nav { gap: 4px; }
.jh-ui .navGroup { color: var(--jh-text-muted); font-size: 12px; padding: 16px 12px 4px; }
.jh-ui .navItem { width: 100%; background: transparent; text-align: left; line-height: 1.4; }
.jh-ui .navItem.active { background: var(--jh-brand-soft); color: var(--jh-brand-text); }
.jh-ui .asideFoot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--jh-border); color: var(--jh-text-muted); font-size: 12px; }
.jh-ui .asideFoot > span:last-child { display: block; padding-left: 13px; margin-top: 4px; }
.jh-ui .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; background: var(--jh-success); }
.jh-ui .shell { min-width: 0; }
.jh-ui .topbar {
  min-height: var(--jh-topbar-height);
  padding: 12px var(--jh-page-padding);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--jh-surface);
  border-bottom: 1px solid var(--jh-border);
}
.jh-ui .topContext, .jh-ui .crumb, .jh-ui .topright, .jh-ui .identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.jh-ui .crumb { font-size: 13px; color: var(--jh-text-muted); }
.jh-ui .crumb strong { color: var(--jh-text); font-weight: 500; }
.jh-ui .crumb svg { width: 12px; height: 12px; }
.jh-ui .topright { flex-wrap: wrap; font-size: 12px; color: var(--jh-text-muted); gap: 10px; }
.jh-ui .identityName { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jh-ui .topbar .btn { font-weight: 400; }
.jh-ui .btn.menuToggle, .jh-ui .menuBackdrop { display: none; }
.jh-ui main { max-width: 1700px; margin: 0 auto; padding: var(--jh-page-padding); min-width: 0; }
.jh-ui .pagehead { margin-bottom: 24px; }
.jh-ui .pagehead h1 { font-size: var(--jh-font-title); font-weight: 650; }
.jh-ui .pagehead p { font-size: 13px; max-width: 64em; }
.jh-ui .pagehead > .actions:empty { display: none; }

/* Shared controls and business panels */
.jh-ui .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--jh-control-height);
  padding: 6px 16px;
  border: 1px solid var(--jh-border);
  border-radius: var(--jh-control-radius);
  color: var(--jh-text);
  background: var(--jh-surface);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  white-space: nowrap;
}
.jh-ui .btn:hover:not(:disabled) { background: var(--jh-surface-muted); border-color: var(--jh-text-muted); }
.jh-ui .btn.primary { color: var(--jh-on-brand); background: var(--jh-brand); border-color: var(--jh-brand); }
.jh-ui .btn.primary:hover:not(:disabled) { background: var(--jh-brand-hover); border-color: var(--jh-brand-hover); }
.jh-ui .btn.sm { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.jh-ui .btn.link { color: var(--jh-link); background: transparent; border-color: transparent; padding-inline: 4px; }
.jh-ui .btn.link:hover:not(:disabled) { background: var(--jh-brand-soft); border-color: transparent; }
.jh-ui .btn.danger { color: var(--jh-danger); }
.jh-ui .card { min-width: 0; border: 1px solid var(--jh-border); border-radius: var(--jh-panel-radius); background: var(--jh-surface); }
.jh-ui .cardhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--jh-border); }
.jh-ui .cardhead h2 { font-size: var(--jh-font-section); font-weight: 600; }
.jh-ui .cardhead p { font-size: 12px; color: var(--jh-text-muted); margin-top: 4px; }
.jh-ui .cardpad { padding: 20px; }
.jh-ui .grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; }
.jh-ui .grid2.singleColumn { grid-template-columns: 1fr; }
.jh-ui .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.jh-ui .kpi { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-content: start; }
.jh-ui .kLabel { grid-column: 1; }
.jh-ui .kValue { grid-column: 1 / -1; margin: 8px 0; }
.jh-ui .kHint { grid-column: 1 / -1; }
.jh-ui .kIcon { display: grid; place-items: center; color: var(--jh-brand); background: var(--jh-brand-soft); width: 32px; height: 32px; border-radius: 6px; grid-column: 2; grid-row: 1; }
.jh-ui .kIcon.orange { background: var(--jh-warning-soft); color: var(--jh-warning); }
.jh-ui .kIcon.purple, .jh-ui .kIcon.blue { background: var(--jh-info-soft); color: var(--jh-info); }
.jh-ui .kIcon.green { background: var(--jh-success-soft); color: var(--jh-success); }
.jh-ui .tablewrap { min-width: 0; overflow: auto; }
.jh-ui .tablewrap table { min-width: 550px; }
.jh-ui .tablewrap th, .jh-ui .tablewrap td { line-height: 1.55; }
.jh-ui .tablewrap td { max-width: 400px; overflow-wrap: anywhere; }
.jh-ui .tablewrap .actions { flex-wrap: nowrap; }
.jh-ui .empty { display: grid; align-content: center; min-height: 140px; padding: 32px 20px; text-align: center; color: var(--jh-text-muted); font-size: 13px; }
.jh-ui .alertRow { padding: 16px 20px; border-bottom: 1px solid var(--jh-border); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.jh-ui .alertRow:last-child { border-bottom: 0; }
.jh-ui .alertRow b { font-size: 14px; font-weight: 600; }
.jh-ui .alertRow small { color: var(--jh-text-muted); display: block; margin-top: 5px; }
.jh-ui .alertQty { color: var(--jh-warning); white-space: nowrap; font-size: 12px; }
.jh-ui .hintBox, .jh-ui .callout { padding: 12px 16px; background: var(--jh-surface-muted); border-left: 3px solid var(--jh-brand-mark); color: var(--jh-text-muted); font-size: 12px; line-height: 1.7; border-radius: 0 4px 4px 0; }
.jh-ui .hintBox.warn { background: var(--jh-warning-soft); color: var(--jh-warning); border-color: var(--jh-warning); }
.jh-ui .callout { display: flex; gap: 10px; align-items: flex-start; }
.jh-ui .callout svg { color: var(--jh-brand); margin-top: 1px; }
.jh-ui .callout .actions { margin-left: auto; }
.jh-ui .listCards { display: grid; gap: 16px; }
.jh-ui .dochead { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px; }
.jh-ui .dochead h2 { font-size: 18px; font-weight: 600; margin-top: 8px; }
.jh-ui .dochead p { margin-top: 8px; }
.jh-ui .dochead .actions { justify-content: flex-end; }
.jh-ui .docbody { padding: 0 20px 20px; }
.jh-ui .pillRow { display: flex; flex-wrap: wrap; gap: 8px; }
.jh-ui .pill { font-size: 12px; color: var(--jh-text-muted); border: 1px solid var(--jh-border); border-radius: 4px; padding: 4px 8px; }
.jh-ui .pill.warn { color: var(--jh-warning); background: var(--jh-warning-soft); border-color: var(--jh-warning-soft); }
.jh-ui .scheduleSlot { margin-bottom: 12px; color: var(--jh-text-muted); font-size: 13px; }
.jh-ui .scheduleSlot svg { width: 16px; height: 16px; margin-right: 6px; }
.jh-ui .filter { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.jh-ui .filter input { width: 240px; max-width: 100%; }
.jh-ui .footerline { margin-top: 24px; color: var(--jh-text-muted); font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Forms and confirmation dialogs */
.jh-ui label.field { display: grid; gap: 8px; font-size: 13px; color: var(--jh-text); font-weight: 500; min-width: 0; }
.jh-ui .field :where(input, select, textarea) { width: 100%; }
.jh-ui .field small { font-weight: 400; }
.jh-ui .formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.jh-ui .full { grid-column: 1 / -1; }
.jh-ui .check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.jh-ui .err { color: var(--jh-danger); background: var(--jh-danger-soft); border-radius: 4px; padding: 12px 16px; font-size: 13px; }
.jh-ui dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--jh-border); border-radius: 8px; color: var(--jh-text); background: var(--jh-surface); box-shadow: var(--jh-shadow); }
.jh-ui dialog::backdrop { background: rgb(15 35 28 / 38%); }
.jh-ui .dialogHead { padding: 20px 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--jh-border); }
.jh-ui .dialogHead h2 { font-size: 18px; font-weight: 600; }
.jh-ui .dialogHead p { margin-top: 6px; }
.jh-ui .dialogBody { display: grid; gap: 16px; padding: 24px; }
.jh-ui .dialogFoot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--jh-border); background: var(--jh-surface-muted); padding: 16px 24px; }
.jh-ui .guideList { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.jh-ui #toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px)); padding: 16px 20px; border: 1px solid var(--jh-border); background: var(--jh-surface); color: var(--jh-text); border-radius: 8px; box-shadow: var(--jh-shadow); font-size: 13px; }
.jh-ui .labelCard { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--jh-border); border-radius: 6px; }
.jh-ui .labelCard img { width: 108px; height: 108px; image-rendering: pixelated; }
.jh-ui .labelCard p { margin-top: 5px; }
.jh-ui .saleLine { align-items: end; }
.jh-ui .proposalGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.jh-ui .proposalText { padding: 20px; line-height: 1.8; color: var(--jh-text-muted); font-size: 14px; }
.jh-ui .proposalText :where(ul, ol) { padding-left: 20px; display: grid; gap: 8px; }
.jh-ui .proposalText strong { color: var(--jh-text); }

/* Sign in */
.jh-ui .connectionStatus { padding: 32px; color: var(--jh-text-muted); }
.jh-ui .loginView { display: grid; grid-template-columns: 1fr 1fr; width: min(920px, calc(100% - 40px)); min-height: 500px; margin: clamp(32px, 12vh, 130px) auto; border: 1px solid var(--jh-border); border-radius: 8px; background: var(--jh-surface); overflow: hidden; }
.jh-ui .loginBrand { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px; background: var(--jh-brand-soft); border-right: 1px solid var(--jh-border); }
.jh-ui .loginWordmark { display: flex; gap: 12px; align-items: center; color: var(--jh-brand); }
.jh-ui .loginWordmark strong { font-size: 22px; letter-spacing: 2px; }
.jh-ui .loginMark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--jh-brand); color: var(--jh-on-brand); border-radius: 6px; font-size: 20px; font-weight: 600; }
.jh-ui .loginBrand h1 { font-size: 30px; font-weight: 600; margin-bottom: 12px; }
.jh-ui .loginTagline { color: var(--jh-text-muted); font-size: 14px; }
.jh-ui .loginFlow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--jh-border); color: var(--jh-brand); font-size: 13px; }
.jh-ui .loginPanel { display: flex; flex-direction: column; justify-content: center; padding: 40px; }
.jh-ui .loginPanel h2 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.jh-ui .loginPanel > p { font-size: 13px; }
.jh-ui .loginForm { display: grid; gap: 20px; margin: 28px 0 20px; }
.jh-ui .loginForm input, .jh-ui .loginForm .btn { min-height: 44px; }

@media (max-width: 1200px) {
  .jh-ui .brand { padding-inline: 6px; }
  .jh-ui .navItem { padding-inline: 10px; gap: 8px; }
  .jh-ui .kpi { padding: 16px; }
}
@media (max-width: 1024px) {
  .jh-ui .grid2 { grid-template-columns: 1fr; }
  .jh-ui .topright { gap: 8px; }
}
@media (max-width: 768px) {
  .jh-ui .app { display: block; }
  .jh-ui .app > aside { display: none; position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(280px, 85vw); height: 100dvh; box-shadow: var(--jh-shadow); }
  .jh-ui .app.menuOpen > aside { display: flex; }
  .jh-ui .btn.menuToggle { display: inline-flex; }
  .jh-ui .menuBackdrop { display: block; position: fixed; inset: 0; z-index: 35; border: 0; background: rgb(15 35 28 / 38%); padding: 0; }
  .jh-ui .topbar { padding-block: 12px; gap: 12px; }
  .jh-ui .topContext { width: 100%; gap: 12px; }
  .jh-ui .topright { width: 100%; gap: 8px; }
  .jh-ui .topright .identity { margin-right: auto; }
  .jh-ui .topright .today { display: none; }
  .jh-ui .identityName { max-width: 90px; }
  .jh-ui .topbar .btn.sm { min-height: 44px; padding-inline: 8px; }
  .jh-ui .pagehead { flex-wrap: wrap; margin-bottom: 20px; }
  .jh-ui .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .jh-ui .kpi { padding: 16px; }
  .jh-ui .kIcon { width: 26px; height: 26px; }
  .jh-ui .kIcon svg { width: 16px; height: 16px; }
  .jh-ui .cardhead { padding: 16px; }
  .jh-ui .cardpad { padding: 16px; }
  .jh-ui .cardhead .filter { width: 100%; }
  .jh-ui .filter input { flex: 1; }
  .jh-ui .dochead { flex-direction: column; align-items: flex-start; padding: 16px; }
  .jh-ui .dochead .actions { justify-content: flex-start; }
  .jh-ui .docbody { padding: 0 16px 16px; }
  .jh-ui .formgrid, .jh-ui .proposalGrid { grid-template-columns: 1fr; }
  .jh-ui .dialogHead { padding: 16px; }
  .jh-ui .dialogBody { padding: 20px 16px; }
  .jh-ui .dialogFoot { padding: 16px; }
  .jh-ui .labelCard { flex-wrap: wrap; }
}
@media (max-width: 650px) {
  .jh-ui .loginView { grid-template-columns: 1fr; max-width: 440px; margin: 24px auto; min-height: 0; }
  .jh-ui .loginBrand { padding: 24px; gap: 24px; border-right: 0; border-bottom: 1px solid var(--jh-border); }
  .jh-ui .loginBrand h1 { font-size: 24px; margin-bottom: 8px; }
  .jh-ui .loginFlow { display: none; }
  .jh-ui .loginPanel { padding: 28px 24px; }
}
@media (max-width: 380px) {
  .jh-ui .identityName { display: none; }
  .jh-ui .topbar .btn.sm { padding-inline: 7px; }
  .jh-ui .kpi { padding: 12px; }
}
@media (pointer: coarse) {
  .jh-ui .btn.sm, .jh-ui .jh-table .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .jh-ui :where(*, *::before, *::after) { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.jh-ui #printArea { display: none; }
@media print {
  body.printing > :not(#printArea) { display: none !important; }
  .jh-ui.printing #printArea { display: block; color: #111; padding: 12mm; background: #fff; }
  .jh-ui #printArea h1 { margin-bottom: 12px; }
  .jh-ui #printArea p { margin: 6px 0; }
  .jh-ui #printArea .tablewrap { overflow: visible; }
  .jh-ui #printArea table { min-width: 0; }
  .jh-ui #printArea tr { break-inside: avoid; }
  .jh-ui #printArea .labelCard { width: fit-content; }
}
