:root {
  font: 15px/1.55 "Segoe UI", system-ui, sans-serif;
  color: #112f42;
  background: #f4f6f8;
  --navy: #0c2f45;
  --ink: #112f42;
  --gold: #bc9255;
  --gold-dark: #765422;
  --gold-light: #f7efe3;
  --muted: #526474;
  --border: #dce3e9;
  --white: #fff;
  --shadow: 0 3px 14px #112f4209;
}
* { box-sizing: border-box; }
body { margin: 0; display: flex; min-height: 100vh; }
aside {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  width: 236px; flex: none; padding: 27px 17px 18px;
  display: flex; flex-direction: column; background: var(--white);
  border-right: 1px solid var(--border);
}
.brand { display: block; width: 166px; max-width: 100%; margin: 0 8px 26px; }
.brand img { display: block; width: 100%; height: auto; }
.nav-label, .eyebrow, .account small {
  font-size: 10px; letter-spacing: .14em; font-weight: 750; text-transform: uppercase;
}
.nav-label { color: var(--gold-dark); padding: 0 12px; }
nav { display: grid; gap: 5px; margin: 9px 0 22px; }
nav a, .nav-more summary {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 11px;
  border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600;
}
nav a svg { flex: none; }
nav a:hover, .nav-more summary:hover { color: var(--navy); background: #f0f4f7; }
nav a[aria-current], nav a.active { background: var(--navy); color: var(--white); }
nav a[aria-current] svg, nav a.active svg { color: #e8c695; }
.nav-more { border-top: 1px solid var(--border); margin-top: 9px; padding-top: 8px; }
.nav-more summary { display: list-item; cursor: pointer; }
.nav-more a { margin-left: 12px; }
aside footer { margin-top: auto; border-top: 1px solid var(--border); padding: 14px 4px 0; }
.account { display: flex; align-items: center; gap: 9px; overflow-wrap: anywhere; }
.account small { display: block; color: var(--gold-dark); }
.account-email { font-size: 12px; }
.avatar {
  display: grid; place-items: center; flex: 0 0 34px; height: 34px;
  border-radius: 50%; color: var(--navy); background: var(--gold-light); font-weight: 750;
}
aside footer form { margin-top: 12px; }
aside footer button { width: 100%; }
main {
  width: 100%; min-width: 0; max-width: 1400px; margin: 0 auto;
  padding: 38px clamp(20px, 4vw, 58px) 56px;
}
main.guest { max-width: 510px; margin: clamp(28px, 10vh, 108px) auto 0; }
.guest-brand { width: 185px; margin: 0 0 24px; }
header { margin-bottom: 24px; padding-bottom: 17px; border-bottom: 1px solid var(--border); }
.eyebrow { color: var(--gold-dark); }
h1 { margin: 5px 0 0; font-size: clamp(29px, 4vw, 43px); line-height: 1.12; letter-spacing: -.045em; }
h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: -.02em; }
a { color: var(--navy); text-underline-offset: 3px; }
p { margin: 0 0 12px; }
.home-header {
  margin-bottom: 0; border: 0; border-radius: 17px 17px 0 0; padding: 27px 30px 7px;
  background: var(--navy); color: var(--white);
}
.home-header .eyebrow { color: #e8c695; }
.home-intro {
  padding: 0 30px 26px; margin: 0 0 20px; border-radius: 0 0 17px 17px;
  border-bottom: 3px solid var(--gold); background: var(--navy); color: #d7e3ed;
}
.quick-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.quick-choice {
  display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 192px;
  padding: 19px; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  background: var(--white); color: var(--ink); text-decoration: none;
  transition: border-color .16s, box-shadow .16s;
}
.quick-choice:hover { border-color: var(--gold); box-shadow: 0 7px 22px #112f4215; }
.quick-choice h2 { font-size: 21px; margin: 11px 0 2px; }
.quick-choice p { color: var(--muted); margin-bottom: 15px; }
.quick-icon {
  display: grid; place-items: center; width: 41px; height: 41px; border-radius: 10px;
  background: var(--gold-light); color: var(--navy);
}
.quick-action {
  display: flex; align-items: center; gap: 7px; margin-top: auto;
  color: var(--navy); font-size: 13px; font-weight: 750;
}
.quick-action svg { width: 16px; height: 16px; color: var(--gold-dark); flex: none; }
.card, .table-wrap, .empty {
  padding: 18px; margin: 12px 0; border: 1px solid var(--border);
  border-radius: 13px; background: var(--white); box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.table-wrap { overflow: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; }
th { background: #edf2f6; font-size: 12px; font-weight: 750; }
td { border-top: 1px solid var(--border); }
tbody tr:hover { background: #f9fafb; }
td a { font-weight: 650; }
.empty { color: var(--muted); background: #f8fafb; box-shadow: none; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  background: var(--gold-light); color: var(--gold-dark); font-size: 12px; font-weight: 700; white-space: nowrap;
}
button, .button {
  display: inline-block; width: max-content; max-width: 100%; padding: 9px 14px;
  border: 1px solid transparent; border-radius: 8px; background: var(--navy); color: var(--white);
  text-decoration: none; font: inherit; font-weight: 650; cursor: pointer;
}
button:hover, .button:hover { background: #174b68; }
.button.danger { background: #fff; color: #9c2828; border-color: #dfb9b9; }
.button.danger:hover { background: #fceeee; }
.secondary { background: var(--white); color: var(--navy); border-color: #bdcad4; }
.secondary:hover { background: #edf2f6; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #8a6028; outline-offset: 3px; }
input, select, textarea {
  width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid #bdcad4;
  border-radius: 8px; background: var(--white); color: inherit; font: inherit;
}
label { display: grid; gap: 5px; min-width: 0; font-size: 13px; font-weight: 650; }
.checkbox-field { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; width: fit-content; }
.checkbox-field input { width: 16px; height: 16px; margin: 0; accent-color: var(--navy); }
.password-control { display: grid; gap: 5px; min-width: 0; }
.password-entry { position: relative; }
.password-entry input { padding-inline-end: 42px; }
.password-entry button {
  position: absolute; inset-block: 1px; inset-inline-end: 1px; width: 38px; padding: 0;
  display: grid; place-items: center; color: var(--muted); background: transparent;
}
.password-entry button:hover { color: var(--navy); background: #edf2f6; }
.password-entry button svg { display: block; width: 17px; height: 17px; }
.password-entry button[hidden], .password-eye-off, .password-entry .is-visible .password-eye { display: none; }
.password-entry .is-visible .password-eye-off { display: block; }
input[readonly] { background: #edf2f6; }
form { display: grid; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 13px; }
.actions { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.actions form { display: flex; align-items: end; flex-wrap: wrap; }
.muted { color: var(--muted); }
.compose { gap: 19px; padding: clamp(16px, 3vw, 27px); }
.compose-section { padding-top: 15px; border-top: 1px solid var(--border); }
.compose-section:first-of-type { border-top: 0; padding-top: 0; }
.compose-section summary { cursor: pointer; font-weight: 700; }
.compose-section[open] summary { margin-bottom: 12px; }
.compose-section textarea { margin-top: 5px; }
.compose-section label:has(textarea) { margin-top: 12px; }
.line {
  min-width: 0; margin: 0 0 11px; padding: 13px; border: 1px solid var(--border);
  border-radius: 9px; background: #f8fafc;
}
legend { padding: 0 6px; color: var(--gold-dark); font-size: 12px; font-weight: 750; }
.compose .actions { justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--border); }
.print-sheet { max-width: 850px; margin: auto; }
.print-sheet h1 { margin-bottom: 20px; }
.print-sheet .card { break-inside: avoid; }
.draft { font-size: 20px; letter-spacing: .16em; font-weight: 800; color: var(--muted); }

@media (max-width: 900px) {
  .quick-choices { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (max-width: 700px) {
  body { display: block; }
  aside { position: static; width: auto; height: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { width: 136px; margin: 0 0 6px; }
  .nav-label { display: none; }
  nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
  nav a, .nav-more summary { min-height: 35px; padding: 6px 8px; font-size: 13px; }
  nav a svg { width: 15px; height: 15px; }
  .nav-more { border-top: 0; padding: 0; margin: 0; }
  aside footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  aside footer form { margin: 0; }
  aside footer button { padding: 5px 10px; }
  main { padding-top: 22px; }
  .home-header, .home-intro { padding-inline: 20px; }
  .quick-choice { min-height: 155px; }
  .guest-brand { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .quick-choice { transition: none; }
}
@page { size: letter; margin: .55in; }
@media print {
  body { display: block; background: white; }
  aside, header, .no-print { display: none; }
  main { padding: 0; max-width: none; }
  .table-wrap { overflow: visible; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  .card, .table-wrap { border: 0; padding: 0; box-shadow: none; }
}

.live-totals { padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.live-totals dl { margin: 0; }.live-totals dl div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.live-totals dd { margin: 0; font-variant-numeric: tabular-nums; }.live-totals dl div:last-child { border-top: 1px solid var(--border); margin-top: 7px; padding-top: 10px; font-weight: 750; font-size: 18px; }
.live-totals p { margin: 8px 0 0; font-size: 12px; }.approval-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px; margin: 16px 0; border: 1px solid #d8bd92; border-radius: 12px; background: var(--gold-light); }.approval-notice p { margin: 2px 0 0; }


/* Compact controls shared by invoice, quotation and purchase order pages. */
.document-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--white); box-shadow: var(--shadow);
}
.document-context { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; }
.document-status-label { display: flex; align-items: center; gap: 9px; }
.document-status-label > span:last-child { color: var(--muted); font-size: 12px; font-weight: 600; }
.document-related { font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.document-related:hover { color: var(--navy); text-decoration: underline; }
.document-related span { margin-left: 3px; color: var(--gold-dark); }
.document-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.document-control, .document-primary-action button {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  min-height: 36px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 12px; line-height: 20px; font-weight: 650; text-decoration: none;
  color: var(--navy); background: var(--white); white-space: nowrap; cursor: pointer;
}
.document-control:hover { border-color: #b9c8d2; background: #f3f6f8; }
.document-control svg, .document-menu-panel svg { width: 16px; height: 16px; flex: none; }
.document-control-primary, .document-primary-action button { background: var(--navy); border-color: var(--navy); color: var(--white); }
.document-control-primary:hover, .document-primary-action button:hover { background: #174b68; color: var(--white); }
.document-primary-action { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.document-primary-action form { margin: 0; display: block; }
.document-menu { position: relative; }
.document-menu > summary { list-style: none; }
.document-menu > summary::-webkit-details-marker { display: none; }
.document-menu[open] > summary { background: #edf2f6; border-color: #b9c8d2; }
.document-menu-panel {
  position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: 230px;
  padding: 6px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--white); box-shadow: 0 12px 32px #112f4226;
}
.document-menu-panel form { margin: 0; display: block; }
.document-menu-panel a, .document-menu-panel button {
  display: flex; align-items: center; justify-content: flex-start; gap: 9px; width: 100%; min-height: 39px;
  padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--navy);
  text-decoration: none; font-size: 12px; line-height: 20px; font-weight: 600; text-align: left;
}
.document-menu-panel a:hover, .document-menu-panel button:hover { background: #f0f4f7; }
.document-menu-panel .document-delete { color: #a12a2a; border-top: 1px solid #edf0f3; border-radius: 0 0 6px 6px; margin-top: 4px; }
.document-menu-panel .document-delete:hover { color: #a12a2a; background: #fff2f2; }
.document-state-options { margin: -8px 0 20px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); }
.document-state-options > summary { display: flex; align-items: center; gap: 10px; width: fit-content; padding: 12px 0; cursor: pointer; font-size: 12px; font-weight: 650; list-style: none; }
.document-state-options > summary::-webkit-details-marker { display: none; }
.document-state-options > summary svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.document-state-options[open] > summary svg { transform: rotate(180deg); }
.document-state-options[open] > summary { border-bottom: 1px solid var(--border); width: 100%; }
.document-state-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 14px 0; }
.document-state-actions form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.document-state-actions label { flex: 1; min-width: 150px; }
.document-state-actions button { min-height: 36px; padding: 7px 12px; font-size: 12px; }
@media (max-width: 1100px) {
  .document-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .document-controls { justify-content: flex-start; }
}
@media (max-width: 700px) {
  .document-toolbar { padding: 12px; }
  .document-context { gap: 7px 12px; }
  .document-control, .document-primary-action button { min-height: 40px; }
  .document-state-actions, .document-state-actions form { align-items: stretch; width: 100%; }
}
