:root { color-scheme: light; --ink: #18283b; --panel: #f4f7fa; --line: #dce4ec; }
.table thead { --bs-table-bg: #e9ecef; }
[hidden] { display: none !important; }
body { color: var(--ink); background: #fff; margin: 0; }
.app-header { background: #18283b; padding: .45rem 1.25rem; min-height: 3rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem; }
.app-header a { color: white; text-decoration: none; font-weight: 700; }
.app-header span { font-weight: 400; color: #c4d4e4; margin-left: .5rem; }
.app-header a.btn:hover, .app-header a.btn:focus-visible { color: #18283b; }
.help-content { max-width: 74rem; }
.help-content section { scroll-margin-top: 1rem; margin-bottom: 2rem; }
.help-nav { columns: auto 15rem; }
.workspace { display: grid; grid-template-columns: 12rem minmax(0, 1fr); height: calc(100dvh - 3rem); }
.workspace-nav { background: var(--panel); padding: 1rem .6rem; border-right: 1px solid var(--line); overflow-y: auto; }
.workspace-nav a { display: block; color: var(--ink); padding: .45rem .6rem; text-decoration: none; }
.workspace-nav a:hover, .workspace-nav a:focus-visible { background: #e3ebf3; }
.workspace-nav a[aria-current=page], .catalog-tabs a[aria-current=page] { background: #dbe7f5; font-weight: 650; }
.workspace-content { padding: 1rem 1.5rem; min-width: 0; overflow: auto; }
.command-bar, .catalog-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .45rem 0 .8rem; }
.command-bar input { padding: .2rem .5rem; border: 1px solid #a8b8c8; border-radius: .2rem; }
.catalog-tabs a { padding: .35rem .6rem; text-decoration: none; border-radius: .2rem; }
tr[data-record] { cursor: pointer; }
tr[data-selected] > td { box-shadow: inset 0 0 0 100vmax #d8e8fc; }
dialog { width: min(48rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); border: 1px solid #8799ad; border-radius: .35rem; color: var(--ink); padding: 0; }
dialog.wide-editor { width: min(72rem, calc(100vw - 2rem)); }
dialog::backdrop { background: rgb(16 27 41 / .4); }
dialog .entry { background: white; border: 0; padding: 1rem; margin: 0; }
.dialog-body, .dialog-actions { padding: .8rem 1rem; }
.dialog-body p { margin-bottom: .35rem; }
.duration-fields { display: flex; flex-wrap: wrap; gap: .3rem .65rem; }
.duration-fields legend { float: none; width: auto; margin-bottom: .15rem; font-size: .9rem; }
.fields .duration-fields input { width: 5.5rem; }
.print-context { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .35rem .8rem; background: var(--panel); padding: .6rem; margin-bottom: .7rem; }
.print-context dt { font-size: .8rem; }
.print-context dd { margin: 0; }
.lookup { position: relative; display: block; min-width: min(15rem, 72vw); }
.lookup-field { display: flex; }
.fields .lookup-input { flex: 1; min-width: 0; width: 100%; border-radius: .2rem 0 0 .2rem; }
.lookup-toggle { border: 1px solid #a8b8c8; border-left: 0; border-radius: 0 .2rem .2rem 0; background: var(--panel); padding: 0 .55rem; }
.lookup-popup { position: absolute; z-index: 4; top: 100%; left: 0; min-width: 100%; width: max-content; max-width: min(24rem, 80vw); border: 1px solid #9babbc; box-shadow: 0 .25rem .6rem #18283b25; border-radius: .25rem; background: white; }
.lookup-options { display: block; max-height: 12rem; overflow: auto; }
.lookup-option, .lookup-empty { display: block; width: 100%; text-align: left; padding: .28rem .5rem; border: 0; background: white; color: var(--ink); overflow-wrap: anywhere; }
.lookup-option:hover, .lookup-highlight, .lookup-option[aria-selected=true] { background: #dbe7f5; }
.lookup-actions { display: flex; align-items: center; gap: .35rem; border-top: 1px solid var(--line); padding: .3rem; }
.lookup-dialog .command-bar { position: sticky; top: 0; background: white; z-index: 1; }
section { border-bottom: 1px solid var(--line); padding: .5rem 0 1.4rem; margin-bottom: .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
h4 { font-size: .94rem; }
.entry { background: var(--panel); border: 1px solid var(--line); padding: .75rem; margin: .5rem 0; }
.fields { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem .8rem; margin-bottom: .55rem; }
.fields label { display: grid; gap: .2rem; font-size: .875rem; }
.fields input, .fields select { border: 1px solid #a8b8c8; border-radius: .2rem; padding: .24rem .35rem; max-width: 100%; }
.fields input[type=number] { max-width: 12rem; }
.row-entry { border-top: 1px solid var(--line); padding-top: .4rem; }
.print-progress { display: grid; gap: .15rem; font-size: .82rem; }
.print-progress progress { width: min(100%, 10rem); accent-color: #9c6c00; }
.print-progress.elapsed progress { accent-color: #247652; }
@media (max-width: 750px) {
    .workspace { grid-template-columns: 1fr; height: auto; min-height: calc(100dvh - 3rem); }
    .workspace-nav { display: flex; flex-wrap: wrap; border-right: 0; }
    .workspace-content { padding: .75rem; overflow-x: auto; }
}
