/* Foundrel app: a plant control layout. Dark tool bar, a row of section tabs, dense tables and a line board. */
.app-body { --bar: 40px; background: var(--bg); font-size: 15px; }
.app-body .demo-bar { position: sticky; top: 0; z-index: 25; min-height: var(--bar); background: var(--accent-tint); border-bottom: 1px solid #c6d4dc; }
.code { font-family: var(--mono); font-size: .88em; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
a.code { text-decoration: none; } a.code:hover { text-decoration: underline; }
.muted { color: var(--ink-2); }
.late { color: var(--danger); font-weight: 700; }

/* Tool bar and section tabs */
.top { position: sticky; top: var(--bar); z-index: 20; }
.toolbar { display: flex; align-items: center; gap: 20px; min-height: 52px; padding: 6px 20px; background: var(--navy); color: #fff; }
.toolbar .brand img { border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.plant { display: inline-flex; align-items: center; gap: 8px; padding-left: 20px; border-left: 1px solid #45545e; color: #d3dce1; font-size: 14px; white-space: nowrap; }
.lamp { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #37a35b; }
.lamp.is-amber { background: #d98a1f; } .lamp.is-red { background: #d64541; }
.global-search { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; max-width: 440px; margin-left: auto; padding: 0 10px; border: 1px solid #4a5a64; border-radius: var(--radius); background: #2c3941; color: #cdd6db; }
.global-search input { flex: 1; min-width: 0; height: 34px; border: 0; background: none; color: #fff; outline: none; }
.global-search input::placeholder { color: #b9c6cd; }
.global-search:focus-within { border-color: #9fc0d3; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; margin: 0; padding: 4px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 18px 32px -16px rgba(15, 25, 32, .45); }
.results a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: var(--radius); color: inherit; text-decoration: none; }
.results a:hover { background: var(--accent-tint); }
.results a strong { font: 600 13px var(--mono); white-space: nowrap; }
.results span { color: var(--ink-2); font-size: 14px; min-width: 0; }
.results .none { padding: 8px 10px; color: var(--ink-2); }
.results.is-sheet { position: static; margin-top: 8px; border: 0; padding: 0; box-shadow: none; }
.results.is-sheet a { min-height: 48px; align-items: center; border-bottom: 1px solid var(--line); border-radius: 0; }
.clock { color: #cdd6db; font-size: 13.5px; white-space: nowrap; }
.user-wrap { position: relative; }
.userbtn { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 2px 8px 2px 3px; border: 1px solid #4a5a64; border-radius: var(--radius); background: none; color: #fff; text-align: left; cursor: pointer; }
.userbtn:hover { background: #2c3941; }
.userbtn .who { display: grid; line-height: 1.2; } .userbtn strong { font-size: 13.5px; } .userbtn small { color: #c3ced4; font-size: 12px; }
.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--radius); background: var(--accent-tint); color: var(--navy); font: 700 12.5px var(--head); }
.popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 230px; padding: 6px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 18px 32px -16px rgba(15, 25, 32, .45); }
.popover p { display: grid; padding: 6px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); } .popover p strong { color: var(--ink); font-size: 15px; }
.popover button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--radius); background: none; cursor: pointer; font-weight: 600; text-align: left; }
.popover button:hover { background: var(--accent-tint); }
.sections { background: var(--surface); border-bottom: 1px solid var(--line-2); }
.sections .tabs { display: flex; gap: 6px; margin: 0; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.sections .tabs::-webkit-scrollbar { display: none; }
.sections li { flex: none; }
.sections a { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 2px 11px 0; border-bottom: 3px solid transparent; color: var(--ink-2); font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; }
.sections a .icon { width: 16px; height: 16px; }
.sections a:hover { color: var(--ink); background: var(--bg); }
.sections a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.pill { min-width: 19px; padding: 0 5px; border-radius: 3px; background: var(--soft); color: var(--ink); font: 600 12px/19px var(--mono); text-align: center; }
.sections .pill { background: var(--accent); color: #fff; }
@media (max-width: 1380px) { .sections .tabs { gap: 4px; padding: 0 14px; } .sections a { padding-inline: 9px; font-size: 14px; } .sections a .icon { display: none; } }
@media (max-width: 1080px) { .plant, .clock { display: none; } }

.content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 16px 20px 40px; }
.content > * + * { margin-top: 12px; }
.content > .tabs + * { margin-top: 12px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; }
.page-head h1, .record-head h1, .locked h1 { font: 800 25px/1.2 var(--head); letter-spacing: -.01em; }
.page-head p { color: var(--ink-2); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actionbar:empty { display: none; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; text-decoration: none; }
.back .icon { width: 15px; height: 15px; }
.back + .record-head { margin-top: 6px; }
.record-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.record-head p { color: var(--ink-2); }
.record-id { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 3px; }
.record-id > .code { font-size: 14px; }

.card { min-width: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card h2, .m-group-head h2 { font: 700 15.5px/1.3 var(--head); }
.card-head a { font-size: 13.5px; font-weight: 600; }
.card-head a.code { font-size: 13px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.columns-wide { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.column { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.hint, .none, .list-count { color: var(--ink-2); font-size: 13.5px; }
.hint { margin-top: 8px; }
.none { padding: 6px 0; }
.total { display: flex; justify-content: flex-end; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; padding: 10px 14px 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.stat:hover { border-color: var(--accent); }
.stat.is-bad { border-left-color: var(--danger); } .stat.is-warn { border-left-color: #c2701c; }
.stat-name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.stat-value { font: 800 28px/1.25 var(--head); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.linestrip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--navy); border-radius: var(--radius-lg); background: #41525d; overflow: hidden; }
.linestrip a { display: grid; gap: 3px; padding: 10px 16px 12px; background: var(--navy); color: #fff; text-decoration: none; }
.linestrip a:hover { background: #2c3a43; }
.ls-top { display: flex; align-items: center; gap: 8px; } .ls-top strong { font: 700 15.5px var(--head); } .ls-top em { margin-left: auto; font-style: normal; font-size: 13px; color: #cdd6db; }
.ls-num { color: #cdd6db; font-size: 14px; } .ls-num b { color: #fff; font: 600 24px var(--mono); margin-right: 4px; }
.linestrip small { color: #b9c6cd; font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 3px; font-size: 12.5px; font-weight: 700; line-height: 1.55; white-space: nowrap; }
.tone-ok { background: var(--ok-tint); color: var(--ok); } .tone-neutral { background: var(--soft); color: var(--ink-2); } .tone-warn { background: var(--warn-tint); color: var(--warn); }
.tone-danger { background: var(--danger-tint); color: var(--danger); } .tone-info { background: var(--info-tint); color: var(--info); } .tone-wait { background: var(--wait-tint); color: var(--wait); }

/* Filters, segmented control */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.searchfield { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; max-width: 380px; min-height: 38px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.searchfield:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.searchfield input { flex: 1; min-width: 0; height: 36px; border: 0; background: none; color: var(--ink); outline: none; }
.filter-selects { display: flex; flex-wrap: wrap; gap: 10px; }
.filter { display: grid; gap: 0; }
.filter > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.filter select { min-height: 38px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.segmented { display: inline-flex; gap: 3px; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.content > .segmented { display: table; }
.content > .segmented button { margin-right: 3px; }
.segmented button { min-height: 32px; padding: 0 14px; border: 0; border-radius: var(--radius); background: none; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.segmented button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 30, 38, .2); }

/* Dense tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 7px 10px; background: #f4f6f7; border-bottom: 1px solid var(--line-2); text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.35; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-href] { cursor: pointer; }
tbody tr:hover td { background: #f3f7f9; }
td small { display: block; color: var(--ink-2); font-size: 12.5px; }
td strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.card > .table-wrap th:first-child, .card > .table-wrap td:first-child { padding-left: 8px; }
.card-flush > .table-wrap th:first-child, .card-flush > .table-wrap td:first-child { padding-left: 14px; }
.card-flush > .table-wrap th:last-child, .card-flush > .table-wrap td:last-child { padding-right: 14px; }
.woref { display: flex; align-items: center; gap: 6px; padding: 2px 0; white-space: nowrap; }
.meter { display: block; width: 100%; max-width: 130px; height: 6px; border-radius: 2px; background: var(--soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.empty { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; }
.empty h3 { font: 700 17px var(--head); } .empty p { color: var(--ink-2); } .empty .btn { margin-top: 6px; }

/* Compact record lists */
.mini li + li { border-top: 1px solid var(--line); }
.mini li > a, .mini li > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 6px 2px; color: var(--ink); text-decoration: none; }
.mini a:hover strong { color: var(--accent-dark); text-decoration: underline; }
.mini li span:first-child { display: grid; min-width: 0; line-height: 1.35; }
.mini strong { font-size: 14.5px; font-weight: 600; }
.mini small { color: var(--ink-2); font-size: 13px; }
.mini-end { display: grid; justify-items: end; flex: none; max-width: 48%; text-align: right; font-size: 14px; }
.queue > li { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 0; }
.queue > li + li { border-top: 1px solid var(--line); }
.queue div { display: grid; } .queue div span { color: var(--ink-2); font-size: 13.5px; }
.levels li + li { border-top: 1px solid var(--line); }
.levels a { display: grid; gap: 5px; padding: 7px 0 9px; color: var(--ink); text-decoration: none; }
.lv-name { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 10px; } .lv-name strong { font-size: 14px; font-weight: 600; } .lv-name small { color: var(--ink-2); font-size: 12.5px; }
.lv-bar { position: relative; height: 8px; border-radius: 2px; background: var(--soft); }
.lv-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); }
.lv-bar.is-low i { background: #c2701c; }
.lv-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }

/* The production line board */
.board-wrap { border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface); }
.board { min-width: 1180px; }
.board-row { display: grid; grid-template-columns: 124px repeat(8, minmax(0, 1fr)); }
.board-row + .board-row { border-top: 1px solid var(--line-2); }
.board-row > * + * { border-left: 1px solid var(--line); }
.board-head { background: var(--navy); color: #fff; }
.board-head > span { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 8px 8px 8px 10px; font: 700 13px/1.25 var(--head); }
.board-head > * + * { border-left-color: #43535e; }
.board-head b { min-width: 20px; padding: 0 4px; border-radius: 3px; background: #3d4e59; font: 600 12px/19px var(--mono); text-align: center; }
.line-cell { display: grid; align-content: start; gap: 3px; padding: 12px 10px; background: #f4f6f7; font-size: 13px; color: var(--ink-2); }
.line-cell strong { font: 700 14.5px/1.25 var(--head); color: var(--ink); }
.line-cell .lamp { width: 12px; height: 12px; margin-bottom: 3px; }
.cell { display: grid; align-content: start; grid-template-columns: minmax(0, 1fr); gap: 6px; min-height: 128px; padding: 6px; background: repeating-linear-gradient(0deg, transparent 0 23px, #f3f5f6 23px 24px); }
.cell-finished { background: #f4f8f5; }
.ticket { display: grid; gap: 6px; justify-items: start; min-width: 0; padding: 7px 7px 8px; background: var(--surface); border: 1px solid var(--line-2); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: 0 2px 4px -3px rgba(20, 30, 38, .4); }
.ticket.is-rush { border-top-color: #c2701c; }
.ticket.is-late { border-top-color: var(--danger); }
.ticket > a { display: grid; gap: 2px; width: 100%; color: var(--ink); text-decoration: none; }
.ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.ticket-top b { font: 600 15px var(--mono); }
.ticket strong { font-size: 13px; font-weight: 600; line-height: 1.25; }
.ticket small { color: var(--ink-2); font-size: 12px; line-height: 1.35; }
.ticket small .late { font-size: inherit; }
.ticket .rush { color: var(--warn); font-style: normal; font-weight: 700; }
.ticket .badge { white-space: normal; font-size: 12px; line-height: 1.4; }
.ticket .btn { width: 100%; min-height: 30px; padding: 3px 4px; font-size: 12.5px; white-space: normal; }

/* Records */
.steps { display: flex; margin: 0; padding: 10px 12px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.steps li { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; color: var(--ink-2); font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.steps li:not(:last-child)::after { content: ""; flex: 1; min-width: 6px; height: 2px; margin-right: 8px; background: var(--line-2); }
.steps li.is-done::after { background: var(--accent) !important; }
.steps i { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 2px solid var(--line-2); border-radius: var(--radius); font: 600 12px var(--mono); font-style: normal; }
.steps i .icon { width: 13px; height: 13px; }
.steps .is-done i { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps .is-now { color: var(--ink); } .steps .is-now i { border-color: var(--navy); background: var(--navy); color: #fff; }
@media (max-width: 1100px) and (min-width: 761px) { .steps { flex-wrap: wrap; gap: 8px 4px; } .steps li { flex: 0 0 auto; margin-right: 8px; } .steps li::after { display: none; } }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface); }
.callout > span { flex: 1 1 260px; min-width: 0; }
.callout > .icon { color: var(--accent); }
.callout-warn { border-color: #e0b27a; background: var(--warn-tint); color: #5c2d00; } .callout-warn > .icon { color: var(--warn); }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.facts > div + div { border-top: 1px solid var(--line); }
.facts dt { color: var(--ink-2); } .facts dd { font-weight: 600; text-align: right; }
.big { font: 800 22px var(--head); }
.log li { position: relative; display: grid; padding: 0 0 12px 20px; }
.log li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.log li:not(:last-child)::after { content: ""; position: absolute; left: 5.5px; top: 16px; bottom: -3px; width: 1px; background: var(--line-2); }
.log li:last-child { padding-bottom: 0; }
.log strong { font-weight: 600; font-size: 14px; } .log small { color: var(--ink-2); font-size: 13px; }
.splitbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.splitbar div { display: grid; padding: 10px 14px; border-radius: var(--radius-lg); }
.splitbar b { font: 800 30px/1.2 var(--head); } .splitbar span { font-weight: 600; font-size: 13.5px; }
.sb-pass { background: var(--ok-tint); color: var(--ok); } .sb-rework { background: var(--warn-tint); color: var(--warn); } .sb-reject { background: var(--danger-tint); color: var(--danger); }
.checks li { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.checks li + li { border-top: 1px solid var(--line); }
.checks em { margin-left: auto; font-style: normal; font-weight: 700; }
.checks .is-ok .icon, .checks .is-ok em { color: var(--ok); } .checks .is-bad .icon, .checks .is-bad em { color: var(--danger); }
.notetext { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.notice { border-color: #e0b27a; border-left: 4px solid #c2701c; }
.notice h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; } .notice h2 .icon { color: var(--warn); }
.notice li { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 6px 0; }
.notice li span { display: grid; } .notice li small { color: var(--ink-2); font-size: 13.5px; }
.fgstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fgstrip a { display: grid; align-content: space-between; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.fgstrip span { font-size: 13px; color: var(--ink-2); line-height: 1.3; } .fgstrip b { font: 800 22px var(--head); }
.locked { display: grid; justify-items: center; gap: 10px; max-width: 440px; margin: 56px auto; text-align: center; }
.locked > .icon { width: 34px; height: 34px; color: var(--accent); }
.locked p { color: var(--ink-2); }

/* Role screen */
.signin { max-width: 1040px; margin: 0 auto; padding: 44px 24px 60px; text-align: center; }
.signin h1 { margin-top: 26px; font: 800 30px/1.2 var(--head); }
.signin-sub { max-width: 600px; margin: 8px auto 0; color: var(--ink-2); }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.roles > li { display: grid; }
.role { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; height: 100%; padding: 20px; background: var(--surface); border: 1px solid var(--line-2); border-top: 4px solid var(--accent); border-radius: var(--radius-lg); text-align: left; cursor: pointer; }
.role:hover { border-color: var(--accent); box-shadow: 0 14px 26px -18px rgba(20, 30, 38, .5); }
.role-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius); background: var(--accent-tint); color: var(--accent-dark); }
.role-icon .icon { width: 22px; height: 22px; }
.role-title { margin-top: 10px; font: 800 19px var(--head); }
.role-name { color: var(--accent-dark); font-weight: 700; }
.role-short { display: none; }
.role-points { display: grid; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.role-points > span { display: flex; gap: 8px; line-height: 1.35; } .role-points .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }
.noscript { padding: 30px; text-align: center; }

/* Dialogs */
dialog { width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 30px 60px -24px rgba(10, 18, 24, .55); }
dialog::backdrop { background: rgba(18, 28, 35, .55); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 800 18px/1.25 var(--head); }
.icon-btn { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border: 0; border-radius: var(--radius); background: none; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--soft); }
.modal-body { overflow-y: auto; padding: 14px 18px 18px; min-height: 0; }
.modal-body > * + * { margin-top: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #f6f7f8; }
.modal-note { color: var(--ink-2); font-size: 14.5px; } .modal-note strong { color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid:empty { display: none; }
.form-grid.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.field { display: grid; align-content: start; gap: 4px; min-width: 0; }
.field > span, .checklist legend, .linerows legend { font-weight: 700; font-size: 13.5px; }
.field em { color: var(--ink-2); font-style: normal; font-weight: 400; font-size: 12.5px; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.error { color: var(--danger); font-size: 13.5px; font-weight: 700; } .error:empty { display: none; }
.form-error { padding: 9px 12px; border-radius: var(--radius); background: var(--danger-tint); color: var(--danger); font-weight: 700; }
.linerows { padding: 0; margin: 0; }
.linerows legend { margin-bottom: 6px; }
.linerows .error { display: block; margin-top: 6px; }
.linerow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 38px; gap: 8px; align-items: end; margin-bottom: 8px; }
.linerow-x { height: 40px; }
.checklist { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.checklist legend { padding: 0 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--accent); }
.matcheck li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.matcheck li span { display: grid; line-height: 1.35; } .matcheck small { color: var(--ink-2); font-size: 13.5px; }
.matcheck .is-ok .icon { color: var(--ok); } .matcheck .is-bad .icon, .matcheck .is-bad small { color: var(--danger); }
.addline { width: auto; }
.toasts { position: fixed; z-index: 60; right: 18px; bottom: 18px; display: grid; gap: 8px; max-width: 420px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-lg); background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 16px 30px -16px rgba(10, 18, 24, .7); }
.toast .icon { margin-top: 2px; color: #7ddb98; } .toast-warn .icon { color: #ffc476; }

@media (max-width: 1120px) {
  .columns, .columns-wide { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
/* Loading placeholder shown while a screen opens */
.page-skel { display: grid; grid-column: 1 / -1; align-content: start; gap: 14px; width: 100%; min-width: 0; padding: 2px; }
.page-skel i { display: block; height: 96px; border-radius: var(--radius-lg, 8px); background: linear-gradient(90deg, rgba(100, 112, 128, .13) 25%, rgba(100, 112, 128, .05) 50%, rgba(100, 112, 128, .13) 75%); background-size: 200% 100%; animation: skel-shimmer 1s linear infinite; }
.page-skel .sk-title { width: min(280px, 70%); height: 30px; }
.page-skel .sk-line { width: min(420px, 90%); height: 14px; }
.page-skel > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.page-skel .sk-block { height: 280px; }
@keyframes skel-shimmer { to { background-position: -200% 0; } }
@media (max-width: 760px) { .page-skel > div { grid-template-columns: minmax(0, 1fr); } .page-skel > div i { height: 68px; } }
.page-in > * { animation: page-in .3s ease-out both; }
@keyframes page-in { from { opacity: 0; } }
.page-skel.is-flush { box-sizing: border-box; padding: 22px 24px; }
