:root { color: var(--ink, #1c1917); background: var(--page, #f4f7f5); font-family: var(--body-font, "Segoe UI", sans-serif); line-height: 1.45; }
body { margin: 0; }
a { color: #6d28d9; text-decoration: none; }
a:hover, a:focus, a:visited { text-decoration: none; }
[hidden] { display: none !important; }
header { display: flex; flex-wrap: nowrap; gap: 1rem; align-items: center; height: 5rem; min-height: 5rem; max-height: 5rem; padding: 0 1.2rem; background: var(--header, #12382c); color: var(--header-ink, #f4f7f5); position: relative; z-index: 20; overflow: visible; }
.brand { color: inherit; font-weight: 700; text-decoration: none; display: flex; gap: 0.75rem; align-items: center; height: 5rem; min-width: 0; max-width: 24rem; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { height: 5rem; width: auto; max-width: 16rem; object-fit: contain; object-position: left center; padding: 0.4rem 0; box-sizing: border-box; }
.app-name { margin: 0; flex: 1 1 auto; min-width: 0; text-align: center; font-family: var(--heading-font, "Segoe UI", sans-serif); font-size: clamp(1rem, 1.5vw, 1.6rem); font-weight: 700; line-height: 1.15; }
nav { display: flex; align-items: center; }
.menu-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.menu-button { display: none; font-weight: 700; text-decoration: none; color: inherit; }
.site-links { display: flex; gap: 0.7rem; align-items: center; }
.site-links > a, nav details.menu summary { color: var(--header-ink, #f4f7f5); font-weight: 700; text-decoration: none; }
.site-links > a:hover, .site-links > a:focus, .site-links > a:visited,
nav details.menu summary:hover, nav details.menu summary:focus { color: var(--header-ink, #f4f7f5); text-decoration: none; }
nav details.menu { position: relative; }
nav details.menu summary { list-style: none; cursor: pointer; }
nav details.menu summary::-webkit-details-marker { display: none; }
nav details.menu summary::after { content: " ▾"; }
nav details.menu > div { position: absolute; top: calc(100% + 0.55rem); right: 0; min-width: 16rem; background: white; color: #1c1917; border-radius: 4px; padding: 0.3rem 0; z-index: 30; box-shadow: 0 8px 24px rgba(28, 25, 21, 0.28); }
nav details.menu a { display: block; color: #1c1917; font-weight: 700; text-decoration: none; padding: 0.5rem 0.9rem; }
nav details.menu a:hover, nav details.menu a:focus, nav details.menu a:visited { text-decoration: none; background: #eef4f1; }
button, .button { background: #111; color: white; border: 0; border-radius: 4px; padding: 0.55rem 0.8rem; font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { background: #d6d3d1; color: #57534e; cursor: not-allowed; }
main { padding: 1.2rem; max-width: 1100px; }
h1, h2, h3 { font-family: var(--heading-font, "Segoe UI", sans-serif); }
label { display: grid; gap: 0.25rem; margin: 0.6rem 0; }
input, select, textarea { font: inherit; padding: 0.45rem; border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; background: white; width: 100%; box-sizing: border-box; }
textarea { min-height: 5rem; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 0.45rem; border-bottom: 1px solid var(--muted, #d6d3d1); vertical-align: top; }
th .sort { display: inline-flex; gap: 0.15rem; margin-left: 0.3rem; }
th .sort a { color: inherit; opacity: 0.45; }
th .sort a.on { opacity: 1; }
.notice { background: #fff4d6; border: 1px solid #d6d3d1; padding: 0.7rem; }
.actions, .cards { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.cards a { background: white; color: inherit; padding: 0.9rem; border-radius: 4px; }
.company-form, dialog .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 1rem; }
.wide, .company-form button, .swatches { grid-column: 1 / -1; }
.setup-note, fieldset { background: white; border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; padding: 0.8rem 1rem; margin: 0.8rem 0; }
fieldset legend { font-weight: 700; padding: 0 0.3rem; }
.show-password, .tick { display: flex; align-items: center; gap: 0.4rem; margin: 0.2rem 0; }
.show-password input, .tick input, .role-opt input { width: auto; }
.ticks, .role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.3rem 0.8rem; }
.record-search { max-width: 28rem; }
.record-search input { width: 100%; }
tr.selected { background: #fff4d6; }
tr.selectable, table.record-table tbody tr { cursor: pointer; }
.table-scroll { overflow-x: auto; }
dialog.record-dialog { border: 0; border-radius: 6px; padding: 1.2rem; width: min(64rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; background: var(--page, #f4f7f5); }
.dialog-head { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; }
.dialog-head button.on { background: #12382c; }
dialog.record-dialog::backdrop, #roles-backdrop.is-open { background: rgba(28, 25, 21, 0.45); }
#roles-backdrop { display: none; }
#roles-backdrop.is-open { display: block !important; position: fixed; inset: 0; z-index: 9998; }
#roles-pop { display: none; }
#roles-pop.is-open { display: block !important; position: fixed; z-index: 9999; top: 4.25rem; left: 50%; transform: translateX(-50%); width: min(32rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 5.5rem); overflow: auto; padding: 0.9rem 1rem; border-radius: 4px; background: white; }
dialog.letter-pop { border: 0; border-radius: 8px; padding: 1.2rem 1.4rem; }
dialog.letter-pop::backdrop { background: rgba(28, 25, 21, 0.45); }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.colour-block { position: relative; display: block; height: 5.5rem; }
.colour-block input[type="color"] { height: 100%; padding: 0; }
.colour-hint { position: absolute; left: 0.4rem; right: 0.4rem; bottom: 0.4rem; text-align: center; font-size: 0.78rem; background: rgba(255,255,255,0.92); pointer-events: none; }
.table-empty { margin: 0.4rem 0; }
@media (max-width: 800px) {
  .menu-button { display: inline; }
  .site-links { display: none; position: absolute; top: 5rem; right: 0.6rem; left: 0.6rem; background: white; color: #1c1917; padding: 0.4rem; border-radius: 4px; flex-direction: column; align-items: stretch; }
  .menu-toggle:checked ~ .site-links { display: flex; }
  .site-links > a, nav details.menu summary, nav details.menu a { color: #1c1917; }
  nav details.menu > div { position: static; box-shadow: none; }
  .company-form, dialog .grid, .swatches { grid-template-columns: 1fr; }
  main { overflow-x: auto; }
}
