:root {
  color-scheme: light;
  --ink: #182435;
  --muted: #4b5c70;
  --soft: #e1e7ef;
  --paper: #fff;
  --page: #f3f6fa;
  --navy: #14263e;
  --blue: #2258a6;
  --blue-dark: #194885;
  --danger: #9a2b24;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
h1, h2, p, dl, dd { margin: 0; }
h1, h2 { letter-spacing: -.035em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 3px solid #437acd; outline-offset: 3px; }
h1:focus { outline: none; }
.entry { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; background: var(--navy); }
.entry-card { width: min(100%, 28rem); background: white; padding: 2.5rem; border-radius: 1rem; }
.entry-card > .brand-mark { margin-bottom: 1.15rem; }
.entry-card h1 { font-size: 2rem; }
.entry-card p { margin: .45rem 0 1.45rem; color: var(--muted); line-height: 1.5; }
.entry-card form { display: grid; gap: 1rem; }
.password-control { display: flex; gap: .4rem; margin-top: .35rem; }
.password-control input { flex: 1; margin-top: 0; }
.password-toggle { flex: none; min-width: 3.65rem; padding: .35rem .55rem; border: 1px solid #bac8d8; border-radius: .45rem; background: white; color: var(--blue-dark); font-size: .85rem; font-weight: 650; }
.password-toggle:hover { background: #eaf1fc; }
.demo-accounts { display: grid; gap: .55rem; margin-top: .3rem; border-top: 1px solid var(--soft); padding-top: 1rem; }
.demo-accounts span { color: var(--muted); font-size: .875rem; }
.demo-accounts button, .back { background: transparent; color: var(--blue-dark); border: 0; padding: .15rem 0; text-align: left; width: fit-content; font-weight: 650; font-size: .9rem; }
.demo-accounts button:hover, .back:hover { text-decoration: underline; }
.workspace { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 2rem; padding: 1.5rem 1rem 1rem; background: var(--navy); color: white; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: .75rem; padding: 0 .35rem; font-weight: 720; letter-spacing: -.025em; }
.brand-mark { width: 2.5rem; height: 2.5rem; background: #2766ba; color: white; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 1.4rem; font-weight: 750; line-height: 1; letter-spacing: 0; }
.brand small, .identity small { display: block; color: #b8cbe4; font-size: .8rem; font-weight: 450; letter-spacing: 0; margin-top: .15rem; overflow-wrap: anywhere; }
.nav { display: grid; gap: .35rem; }
.nav button { text-align: left; color: #dde8f6; background: transparent; border: 1px solid transparent; border-radius: .55rem; padding: .57rem .7rem; white-space: nowrap; font-weight: 600; font-size: .93rem; }
.nav button span:first-child { font-size: 1.1rem; margin-right: .45rem; }
.nav button:hover, .nav button[aria-current="page"] { background: #233c5e; border-color: #34527b; color: white; }
.identity { margin-top: auto; border-top: 1px solid #354a65; padding: .9rem .25rem .15rem; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .55rem; font-size: .83rem; }
.identity-mark { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: .45rem; background: #345b86; color: white; font-weight: 750; }
.signout { grid-column: 2; width: fit-content; padding: .15rem 0; border: 0; background: none; color: #d2e1f1; font-size: .825rem; text-decoration: underline; text-underline-offset: .15em; }
.content { min-width: 0; }
.topbar { height: 3.75rem; padding: 0 clamp(1rem, 3.6vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: white; border-bottom: 1px solid var(--soft); color: var(--muted); font-size: .9rem; }
.preview-label { background: #eaf1fc; color: #214a82; padding: .28rem .6rem; border-radius: .4rem; white-space: nowrap; font-size: .8rem; font-weight: 650; }
.content-inner { max-width: 90rem; margin: auto; padding: 2rem clamp(1rem, 3.6vw, 3rem) 3rem; }
.page-heading { margin-bottom: 1.55rem; }
.page-heading h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 735; line-height: 1.12; }
.page-heading p, .card-heading p { margin-top: .4rem; color: var(--muted); line-height: 1.5; }
.form-layout, .detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13.25rem, 17.5rem); gap: 1.15rem; align-items: start; }
.form-main { display: grid; gap: 1.15rem; }
.card { background: white; border: 1px solid var(--soft); border-radius: .75rem; padding: 1.25rem; min-width: 0; box-shadow: 0 1px 2px #15355708; }
.card-heading { margin-bottom: 1rem; }
.card-heading h2 { font-size: 1.17rem; font-weight: 735; }
.card-heading p { font-size: .9rem; margin-top: .25rem; }
.fields { display: grid; gap: .85rem; align-items: start; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields .wide { grid-column: 1 / -1; }
label { display: block; font-size: .875rem; font-weight: 650; color: #293a51; }
label .optional { font-size: .8rem; color: var(--muted); font-weight: 400; margin-left: .22rem; }
input, select, textarea, output.line-total { display: block; width: 100%; min-width: 0; margin-top: .35rem; border-radius: .45rem; border: 1px solid #bac8d8; background: white; padding: .55rem .65rem; color: var(--ink); min-height: 2.55rem; font-weight: 450; font-size: 1rem; }
input::placeholder, textarea::placeholder { color: #69798d; opacity: 1; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
select { text-overflow: ellipsis; }
textarea { resize: vertical; }
fieldset { min-inline-size: 0; border: 0; padding: 0; margin: 1rem 0 0; }
fieldset legend { font-size: .92rem; font-weight: 730; padding: 0 0 .55rem; }
.primary, .secondary { border-radius: .47rem; padding: .62rem .95rem; min-height: 2.6rem; text-align: center; font-weight: 680; font-size: .92rem; }
.primary { background: var(--blue); color: white; border: 1px solid var(--blue); }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { border: 1px solid #b5c6db; background: #f5f8fd; color: var(--blue-dark); }
.secondary:hover:not(:disabled) { background: #eaf1fc; }
.summary { position: sticky; top: 1rem; }
.summary button { width: 100%; }
.summary-values { margin: .3rem 0 1rem; }
.summary-values div { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; font-size: .925rem; }
.summary-values dt { color: var(--muted); }
.summary-values dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-values .summary-total { border-top: 1px solid var(--soft); margin-top: .45rem; padding-top: .85rem; align-items: center; }
.summary-total dt { color: var(--ink); font-weight: 670; }
.summary-total dd { font-size: 1.35rem; letter-spacing: -.035em; }
.summary-note, .copy-note { color: var(--muted); font-size: .84rem; margin-top: .75rem; line-height: 1.45; }
.form-alert, .field-error { color: var(--danger); font-size: .85rem; margin-bottom: .55rem; }
.field-error { display: block; margin: .35rem 0 0; }
.product-line { background: #f8fafd; position: relative; border: 1px solid var(--soft); border-radius: .55rem; padding: .45rem .8rem .85rem; margin-top: .75rem; }
.product-line legend { padding: 0 .35rem; }
.product-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-fields .product-name { grid-column: span 2; }
output.line-total { background: #eef3f9; border-color: #d8e2ef; font-weight: 630; }
.remove-line { position: absolute; top: -.73rem; right: .65rem; font-size: .81rem; padding: .12rem .35rem; background: #f8fafd; color: var(--blue-dark); border: 0; border-radius: .25rem; }
.remove-line:hover { text-decoration: underline; }
.add-line, .load-more { margin-top: .9rem; }
.history-heading { display: flex; justify-content: space-between; gap: 1.15rem; align-items: end; }
.filter { min-width: 10.5rem; }
.order-list { padding: 0; }
.list-message { color: var(--muted); padding: 1.35rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; text-align: left; }
th, td { padding: .76rem 1rem; border-bottom: 1px solid var(--soft); }
th { color: #364b65; background: #f8fafd; font-size: .84rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.table-order { color: var(--blue-dark); background: transparent; border: 0; padding: 0; font-weight: 720; text-align: left; overflow-wrap: anywhere; }
.table-order:hover { text-decoration: underline; }
.row-note { display: block; color: var(--muted); font-size: .8rem; margin-top: .25rem; overflow-wrap: anywhere; }
.load-more { margin: .85rem 1rem; }
.badge { display: inline-block; padding: .25rem .55rem; border-radius: .35rem; background: #e9f0fc; color: #214d85; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge[data-status="In Review"] { background: #f6edd8; color: #704b13; }
.badge[data-status="Processing"] { background: #eee9fb; color: #513e7c; }
.badge[data-status="Shipped"] { background: #e0f2e8; color: #235d40; }
.badge[data-status="Cancelled"] { background: #f9e9e7; color: #8f2a23; }
.notice { margin-bottom: 1rem; padding: .8rem 1rem; background: #e8f3fc; color: #1f4673; border: 1px solid #cadef4; border-radius: .55rem; font-size: .95rem; }
.back { margin-bottom: .85rem; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.detail-header h1 { overflow-wrap: anywhere; }
.detail-layout > div { display: grid; gap: 1.15rem; }
.detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; }
.detail-fields dt { color: var(--muted); font-size: .82rem; font-weight: 630; }
.detail-fields dd { margin-top: .2rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-product { border-top: 1px solid var(--soft); padding: .9rem 0; }
.detail-product:last-child { padding-bottom: 0; }
.detail-product h3 { font-size: 1rem; margin: 0 0 .75rem; overflow-wrap: anywhere; }
.detail-card-actions { display: grid; gap: .65rem; margin-bottom: 1rem; }
.activity { margin: 0; padding: 0; list-style: none; }
.activity li { border-top: 1px solid var(--soft); padding: .7rem 0; }
.activity time { display: block; font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.copy-fallback { font-family: ui-monospace, monospace; font-size: .85rem; }
@media (max-width: 1100px) {
  .form-layout, .detail-layout { grid-template-columns: minmax(0, 1fr) minmax(12.5rem, 14rem); }
  .workspace { grid-template-columns: 12rem minmax(0, 1fr); }
  .fields.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 870px) {
  .form-layout, .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
}
@media (max-width: 740px) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; padding: .85rem 1rem; gap: .65rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .brand { padding: 0; }
  .nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; order: 3; }
  .identity { display: flex; margin: 0; border: 0; padding: 0; }
  .identity-mark, .identity-text { display: none; }
  .topbar { height: 3rem; }
  .content-inner { padding-top: 1.25rem; }
  .card { padding: 1rem; }
  .order-list { padding: 0; }
  .product-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-heading { align-items: start; flex-direction: column; }
}
@media (max-width: 385px) {
  .fields.two, .fields.three, .product-fields, .detail-fields { grid-template-columns: minmax(0, 1fr); }
  .product-fields .product-name { grid-column: auto; }
}
