/* The shared register and dossier panel use the same spacing on desktop and phone. */
:root {
  --wb-ink: #162d3e;
  --wb-muted: #536978;
  --wb-line: #d8e1e7;
  --wb-blue: #214e70;
  --wb-light: #f0f5f8;
}
.layout { background: radial-gradient(ellipse at 88% 0, #eaf3f6 0, transparent 42%), #f5f7f9; }
.layout .body { max-width: 1560px; }
.layout .rail {
  background: linear-gradient(151deg,#e4edf2 0%,#edf2f4 32%,#e5edef 78%,#dce9e9 100%);
  color: #233f50;
  border-right: 1px solid #cbd8df;
}
.layout .rail .brand { background: transparent; border: 0; box-shadow: none; border-radius: 0; }
.rail .brand img { mix-blend-mode: multiply; }
.rail nav { gap: 2px; }
.rail .nav-group { display: grid; gap: 1px; }
.rail .nav-group-title, .rail nav > h3 { color: #4b6373; font-size: .72rem; letter-spacing: .075em; margin: 12px 10px 3px; }
.rail nav .nav-link { display: flex; justify-content: space-between; align-items: center; color: #223f51; border: 0; border-radius: 7px; padding: 6px 11px; min-height: 29px; font-size: .89rem; line-height: 1.25; }
.rail nav .nav-link:hover, .rail nav .nav-legacy a:hover { background: #dce6eb; color: #132f42; }
.rail nav .nav-link[aria-current="page"] {
  background: linear-gradient(100deg,color-mix(in srgb,var(--accent) 13%,#f7fafb),#edf3f5 94%);
  color: #132d40; box-shadow: inset 3px 0 var(--accent);
}
.nav-count { border-radius: 10px; background: #d8e3e9; color: #395466; padding: 1px 6px; font-size: .72rem; }
.rail .dept-choice { padding: 0 3px 10px; color: #425e6b; }
.rail .dept-choice select { min-height: 32px; font-size: .87rem; color:#1d3e52; border-color: #b7c9d1; border-radius: 7px; background-color: #eaf0f3; }
.nav-legacy { color: #486274; font-size: .82rem; padding: 9px 4px; margin-top: 7px; border-color: #c6d6dd; }
.nav-legacy summary { font-weight: 500; }
.rail nav .nav-legacy a { padding-block: 6px; font-size: .84rem; color:#365567; }
.layout .pagehead { gap: 9px; }
.layout .pagehead > div:first-child { margin-right: auto; }
.layout .pagehead h1, .wb-head h1 { color: var(--wb-ink); letter-spacing: -.036em; font-size: clamp(1.65rem,2.25vw,2.25rem); margin: 2px 0 0; }
.layout .pagehead small, .wb-context { color: var(--wb-muted); font-size: .82rem; letter-spacing: 0; }
.layout .pagehead .wb-primary, .wb-head .wb-primary, .wb-action {
  min-height: 37px; background: linear-gradient(112deg,#234862,#245774 62%,#276675); color: white; border-radius: 9px; font-weight: 650; font-size: .92rem;
}
.workboard { display: grid; gap: 14px; min-width: 0; color: var(--wb-ink); }
.wb-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.workboard h2 { margin: 0; font-size: 1.08rem; letter-spacing: -.02em; }
.wb-process {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr));
  position: relative; border: 1px solid #cbdce2; border-radius: 14px; overflow: hidden;
  background: linear-gradient(105deg,#e9f1f7 0%,#eef4f7 34%,#eaf4f1 70%,#f8f4eb 100%);
}
.wb-process button {
  position: relative; display: flex; justify-content: space-between; gap: 6px; border: 0; border-radius: 0;
  background: transparent; color: var(--wb-ink); padding: 12px 16px 19px; text-align: left; font-weight: 450; min-height: 64px;
}
.wb-process button + button { border-left: none; }
.wb-process button::after {
  position: absolute; content: ""; height: 2px; inset: auto 0 8px; background: linear-gradient(90deg,var(--step,#337d91),var(--to,#527c9e));
}
.wb-process button::before { content:""; position:absolute; z-index:1; left:16px; bottom:5px; width:8px; height:8px; background:var(--step,#337d91); border-radius:50%; }
.wb-process button:first-child::after { left:16px; }
.wb-process button:last-child::after { right:16px; }
.wb-process button[data-board-area="planning"] { --step:#527c9e; --to:#418575; }
.wb-process button[data-board-area="execution"] { --step:#418575; --to:#927651; }
.wb-process button[data-board-area="administration"] { --step:#927651; --to:#c0b290; }
.wb-process button:hover, .wb-process button[aria-pressed="true"] { background: #ffffff78; }
.wb-process button[aria-pressed="true"]::before { box-shadow:0 0 0 3px #ffffff,0 0 0 4px var(--step,#337d91); }
.wb-process button:focus-visible { outline-offset: -4px; }
.wb-process button span { display: grid; gap: 2px; }
.wb-process b { font-size: .95rem; }
.wb-process small { font-size: .81rem; color: var(--wb-muted); }
.wb-process strong { font-size: 1.45rem; font-weight: 650; color: var(--wb-ink); font-variant-numeric: tabular-nums; }
.wb-layout { display: grid; grid-template-columns: minmax(0,1.82fr) minmax(255px,.92fr); align-items: stretch; gap: 0; border: 1px solid var(--wb-line); border-radius: 14px; overflow: hidden; background:#fff; box-shadow:0 4px 18px #314b5c09; }
.wb-register, .wb-inspector, .wb-registers { min-width: 0; }
.wb-layout > [data-board-detail] { border-left:1px solid #d6e3e6; background:linear-gradient(135deg,#f4f8fa,#f4f8f7 66%,#f9faf7); }
.wb-register > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 15px 7px; }
.wb-register select { width: auto; min-height: 32px; font-size: .86rem; }
.wb-search { display: flex; align-items: center; gap: 8px; padding: 0 15px 10px; }
.wb-search input { min-height: 34px; padding-block: 5px; font-size: .87rem; border: 1px solid #c4d1d9; background: #f8fafb; }
.wb-search button, .wb-pager button, .wb-empty button { white-space: nowrap; border: 1px solid var(--wb-line); background: white; color: var(--wb-blue); border-radius: 4px; padding: 4px 9px; font-size: .83rem; min-height: 30px; }
.wb-search [hidden] { display: none; }
.wb-colnames, .wb-row { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(0,1fr) minmax(74px,.62fr); align-items: center; gap: 12px; padding: 8px 15px; }
.wb-colnames { background: #f2f5f7; border-block: 1px solid var(--wb-line); color: var(--wb-muted); font-weight: 600; font-size: .78rem; }
.wb-row { position: relative; text-decoration: none; color: var(--wb-ink); min-height: 52px; border-bottom: 1px solid #e6ebee; }
.wb-row.selected { background: #edf4f7; }
.wb-row.selected::before { position: absolute; content: ""; inset: 0 auto 0 0; width: 3px; background: #286086; }
.wb-row:hover { background: #f1f6f8; }
.wb-row:focus-visible { outline-offset: -3px; }
.wb-record { display: grid; gap: 3px; min-width: 0; }
.wb-record strong { font-size: .92rem; line-height: 1.25; }
.wb-record small, .wb-status, .wb-owner { color: var(--wb-muted); font-size: .81rem; line-height: 1.35; }
.wb-record small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-status { color: #354f5b; }
.wb-status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #718799; margin-right: 5px; }
.wb-status i[data-area="crm"] { background: #337d91; }
.wb-status i[data-area="execution"] { background: #418575; }
.wb-status i[data-area="administration"] { background: #927651; }
.wb-list-foot { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 6px 15px; color: var(--wb-muted); font-size: .82rem; }
.wb-empty { padding: 9px 15px; }
.wb-pager { display: flex; gap: 5px; }
.wb-inspector { padding: 16px; scroll-margin-top: 12px; }
.wb-inspector-title > span, .wb-next small { color: var(--wb-muted); font-size: .79rem; font-weight: 620; }
.wb-inspector h2 { margin-top: 4px; line-height: 1.25; }
.wb-facts { margin: 12px 0; display: grid; gap: 5px; font-size: .86rem; }
.wb-facts div { display: grid; grid-template-columns: 56px 1fr; gap: 10px; }
.wb-facts dt { color: var(--wb-muted); }
.wb-facts dd { margin: 0; }
.wb-next { display: grid; padding: 10px 12px; gap: 4px; border-radius: 10px; background: linear-gradient(110deg,#dfeef0,#eaf3ef); }
.wb-next strong { font-size: .99rem; }
.wb-action { justify-self: start; margin-top: 4px; text-decoration: none; }
.wb-documents { margin-top: 12px; }
.wb-documents h3 { font-size: .86rem; margin: 0 0 5px; }
.wb-documents a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 27px; color: var(--wb-muted); text-decoration: none; border-top: 1px solid #e3eaee; font-size: .83rem; }
.wb-documents strong { color: var(--wb-blue); font-weight: 600; }
.wb-documents a:hover strong { text-decoration: underline; }
.wb-timeline { margin-top: 10px; padding: 8px 0 0; }
.wb-timeline summary { font-size: .88rem; }
.wb-timeline summary span { font-weight: 450; color: var(--wb-muted); margin-left: 6px; }
.wb-timeline ol { margin: 8px 0 0; padding: 0 5px; list-style: none; }
.wb-timeline li { position: relative; display: flex; gap: 8px; align-items: center; color: var(--wb-muted); font-size: .83rem; min-height: 21px; }
.wb-timeline i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid #b5c2c8; background: white; z-index: 1; }
.wb-timeline li:not(:last-child)::after { content: ""; position: absolute; left: 3px; top: 13px; bottom: -9px; border-left: 1px solid #cfdae0; }
.wb-timeline .completed i { background:#4c8b78; border-color:#4c8b78; }
.wb-timeline .current { color:var(--wb-ink); font-weight:700; }
.wb-timeline .current i { background:var(--wb-blue); border-color:var(--wb-blue); }
.wb-registers { display: flex; flex-wrap: wrap; align-items: stretch; border-block:1px solid var(--wb-line); }
.wb-registers a { flex: 1 1 85px; display: grid; align-content:center; gap: 2px; padding: 8px 11px; text-decoration: none; color: var(--wb-ink); }
.wb-registers a:first-child { border-left: 0; }
.wb-registers a:hover { background: var(--wb-light); }
.wb-registers span { font-size: .8rem; color: var(--wb-muted); }
.wb-registers strong { font-size: 1.07rem; font-variant-numeric: tabular-nums; }
.flow-context { margin: 0 0 14px; padding: 12px 16px; background: #eef4f7; border: 1px solid #cdd9e0; border-left: 3px solid #335e7c; border-radius: 6px; color: var(--wb-ink); }
.flow-context-heading, .flow-context-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow-context-heading h2, .flow-context h3 { font-size: 1.01rem; margin: 0; }
.flow-context small, .flow-context-notice { font-size: .84rem; color: var(--wb-muted); }
.flow-context-steps { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 0; margin: 0; list-style: none; font-size: .8rem; color: var(--wb-muted); }
.flow-context-steps [aria-current] { color: var(--wb-blue); font-weight: 700; }
.flow-context-actions a { font-size: .89rem; }
@media (min-width:851px) {
  .layout { grid-template-columns: 218px minmax(0,1fr); }
  .layout .rail { padding: 15px 12px; gap: 12px; }
  .layout .brand { margin: 0 2px 3px; padding: 9px 2px; }
  .layout .top { padding: 9px clamp(15px,2vw,30px); }
  .layout .body { padding: 17px clamp(15px,2vw,30px) 35px; }
  .layout .pagehead { margin: 0 0 12px; }
  .layout .pagehead > button { min-height: 35px; }
}
@media (max-width:1120px) {
  .wb-layout { grid-template-columns: minmax(0,1.6fr) minmax(230px,1fr); }
  .wb-colnames,.wb-row { grid-template-columns: minmax(0,1.5fr) minmax(95px,.9fr); gap: 8px; }
  .wb-colnames span:last-child, .wb-row .wb-owner { display: none; }
  .wb-process button { padding: 9px; }
}
@media (max-width:780px) {
  .workboard { gap: 10px; }
  .wb-layout { grid-template-columns: minmax(0,1fr); }
  .wb-layout > [data-board-detail] { border-left:0; border-top:1px solid var(--wb-line); }
  .wb-process { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wb-process button { min-height: 48px; padding-bottom:16px; }
  .wb-process button:nth-child(3) { border-left: 0; }
  .wb-process small { display:none; }
  .wb-process strong { font-size: 1.12rem; }
  .wb-row { min-height: 52px; }
  .wb-colnames, .wb-row { padding-inline: 11px; }
  .wb-registers { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .wb-registers a { min-height: 45px; border: 0; border-bottom: 1px solid var(--wb-line); }
  .wb-inspector { padding: 12px; }
  .wb-list-foot { padding-inline: 11px; }
  .wb-register > header, .wb-search { padding-inline: 11px; }
  .wb-search input,.wb-register select { min-height: 40px; font-size: 1rem; }
  .wb-action,.layout .pagehead .wb-primary { min-height: 44px; }
  .flow-context-steps { gap: 2px 8px; }
  .layout .pagehead { flex-wrap: wrap; }
}
@media(max-width:570px) {
  .layout .top select { field-sizing:content; width:auto; max-width:34vw; padding-inline:7px 17px; }
  .layout .pagehead:has(.wb-primary) { flex-wrap:nowrap; gap:6px; }
  .pagehead:has(.wb-primary) [data-refresh] { min-width:42px; min-height:44px; width:42px; padding:0; font-size:0; position:relative; }
  .pagehead:has(.wb-primary) [data-refresh]::before { content:""; width:12px; height:12px; border:2px solid #48616f; border-right-color:transparent; border-radius:50%; }
  .pagehead:has(.wb-primary) [data-refresh]::after { content:""; position:absolute; top:13px; left:23px; border-right:2px solid #48616f; border-bottom:2px solid #48616f; width:5px; height:5px; }
}
@media print { .wb-search,.wb-primary,.wb-pager,.flow-context-actions { display: none; } }
