:root {
  color-scheme: light;
  --canvas: #f3f5f8;
  --paper: #fff;
  --navy: #142d49;
  --ink: #172d45;
  --muted: #546579;
  --line: #dce4ed;
  --pale: #eff5fa;
  --blue: #145b95;
  --blue-deep: #104b7d;
  --teal: #147364;
  --shadow: 0 1px 2px #132f4910, 0 5px 16px #132f4907;
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--blue-deep); text-underline-offset: .18em; }
a:hover { color: var(--blue); }
button, input, select, textarea { font: inherit; }
input, select, textarea { color: var(--ink); }
:focus-visible { outline: 3px solid #2e84cd; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; }
button:not(:disabled), summary, select { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.25vw, 2.55rem); letter-spacing: -.036em; font-weight: 720; line-height: 1.14; }
h2 { font-size: 1.13rem; letter-spacing: -.013em; line-height: 1.3; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 1rem; left: 1rem; background: white; padding: 1rem; z-index: 4; }
.site-header { background: var(--navy); color: #fff; }
.header-inner, .nav-inner, .page { max-width: 1300px; margin: 0 auto; padding-left: 30px; padding-right: 30px; }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; gap: 12px; align-items: center; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand:hover, .account-name:hover { color: #fff; }
.brand strong { display: block; font-size: .9rem; letter-spacing: .09em; }
.brand small { display: block; color: #d1e0ec; font-size: .78rem; margin-top: 1px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #89dfc1; display: grid; place-items: center; }
.brand-mark::before { content: ""; width: 17px; height: 10px; border: solid var(--navy); border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-44deg); }
.account { display: flex; align-items: center; gap: .9rem; font-size: .87rem; }
.account-name { color: #ebf2f9; text-decoration: none; display: flex; gap: .5rem; align-items: center; white-space: nowrap; }
.account-icon { width: 1.4rem; height: 1.4rem; border: 1px solid #adc3d7; border-radius: 50%; display: inline-grid; place-items: center; position: relative; }
.account-icon::before { content: ""; height: 5px; width: 5px; background: #d6e5f1; border-radius: 50%; transform: translateY(-3px); }
.account-icon::after { content: ""; position: absolute; width: 9px; height: 4px; bottom: 4px; background: #d6e5f1; border-radius: 6px 6px 1px 1px; }
.leave { background: transparent; color: #fff; padding: 6px 11px; border: 1px solid #71859b; border-radius: 6px; font-size: .84rem; }
.leave:hover { background: #ffffff19; }
.nav-band { background: #fff; border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: thin; }
.nav-inner a { text-decoration: none; white-space: nowrap; color: var(--muted); font-size: .91rem; padding: 14px 0 12px; border-bottom: 3px solid transparent; font-weight: 600; }
.nav-inner a.active { color: var(--blue-deep); border-bottom-color: var(--blue); }
.page { padding-top: 34px; padding-bottom: 52px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.2rem; margin-bottom: 24px; }
.page-heading p { margin-top: 8px; }
.period-picker { min-width: 184px; }
.period-picker label, .work-controls label, .auth-card label, .form-fields label { display: block; font-size: .83rem; font-weight: 650; margin-bottom: 5px; }
.field-pair { display: flex; gap: .5rem; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea { border: 1px solid #c5d3e0; background: var(--paper); padding: 8px 11px; border-radius: 7px; min-height: 42px; width: 100%; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); flex-shrink: 0; }
textarea { resize: vertical; }
input::placeholder { color: #627587; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.card-header { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.card-header .muted { font-size: .83rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; border: 1px solid transparent; border-radius: 7px; padding: 8px 13px; font-size: .87rem; font-weight: 675; line-height: 1.3; text-align: center; text-decoration: none; }
.button.primary { color: white; background: var(--blue); border-color: var(--blue); }
.button.primary:hover:not(:disabled) { background: var(--blue-deep); }
.button.danger { color: white; background: #a4302c; border-color: #a4302c; }
.button.danger:hover:not(:disabled) { background: #832622; }
.delete-link, .delete-link:hover { color: #a4302c; }
.button.secondary { color: var(--blue-deep); background: #f4f8fc; border-color: #cbdce9; }
.button.secondary:hover, .button.ghost:hover { background: #e6f0f8; }
.button.ghost { color: var(--blue-deep); background: transparent; }
.button.full { width: 100%; }
.entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(262px, 305px); gap: 20px; align-items: start; }
.entry-aside { display: grid; align-content: start; gap: 15px; }
form.entry-grid .entry-aside { position: sticky; top: 20px; }
.estimate-card, .month-card { padding: 18px; }
.estimate-card { border-top: 3px solid #247e74; }
.estimate-card h2 { margin-bottom: 13px; }
#estimate { background: #eff8f6; padding: 14px; margin-bottom: 14px; border-radius: 8px; min-height: 119px; }
.estimate-label { color: #31695f; font-size: .81rem; font-weight: 650; }
.estimate-value { font-size: 2rem; font-weight: 720; letter-spacing: -.035em; color: #164f46; }
.estimate-error { color: #a4302c; font-size: .9rem; }
.estimate-card > p { margin-top: 9px; text-align: center; }
.month-card dl { margin: 12px 0; }
.month-card dl div { display: flex; gap: 8px; justify-content: space-between; padding: 8px 0; font-size: .85rem; border-bottom: 1px solid var(--line); }
.month-card dl dt { color: var(--muted); }
.month-card dd { margin: 0; text-align: right; font-weight: 650; }
.month-card > a { display: inline-flex; gap: 5px; font-size: .85rem; font-weight: 650; text-decoration: none; }
.month-card > p { margin: 10px 0; }
.work-controls { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 20px; }
.work-controls .date-field { width: 172px; }
.search-field { flex: 1; min-width: 175px; }
.search-field input { padding-left: 33px !important; background: var(--paper) radial-gradient(circle at 15px 17px, transparent 4px, #637b91 4.5px, #637b91 5.5px, transparent 6px) !important; }
.search-field { position: relative; }
.search-field::after { content: ""; position: absolute; width: 7px; height: 1.5px; background: #637b91; left: 18px; bottom: 15px; transform: rotate(46deg); pointer-events: none; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
thead th { background: var(--pale); color: #415970; font-weight: 650; font-size: .79rem; text-align: left; }
th, td { padding: 11px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
tbody th { font-size: .9rem; font-weight: 620; }
tbody td { font-size: .9rem; }
tbody tr:hover { background: #f9fbfd; }
.operations th:first-child { padding-left: 20px; }
.operations th:nth-child(2), .operations .rate { white-space: nowrap; width: 105px; }
.operations th:last-child, .operations .quantity { width: 170px; }
.operations .quantity input { min-height: 36px !important; max-width: 105px; padding: 5px 8px !important; text-align: right; font-variant-numeric: tabular-nums; }
.operations .quantity input:disabled { background: #f1f3f5; }
.sent-marker { display: block; font-weight: 550; color: var(--teal); }
.issues summary { color: var(--blue-deep); font-weight: 640; }
.issues li { margin-bottom: 6px; }
.notice { margin: 0 0 16px; padding: 11px 14px; border: 1px solid #cddcea; border-radius: 8px; background: #f1f7fc; }
.notice.error, .errorlist { color: #962f28; }
.notice.error { border-color: #e6bdb9; background: #fff3f0; }
.notice.success { color: #125647; background: #e9f7ef; border-color: #c0e4d4; }
.empty { padding: 20px !important; color: var(--muted); font-size: .94rem; }
.scroll { overflow-x: auto; }
.card.scroll { max-width: 100%; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table .status { white-space: nowrap; }
.status { display: inline-block; font-size: .77rem; border-radius: 4px; padding: 3px 6px; font-weight: 675; color: #43566a; background: #e9eef3; }
.status.submitted { color: #784f17; background: #fff0d5; }
.status.approved { color: #156451; background: #e3f6ef; }
.sheet-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding: 4px 4px 0; background: #e5edf4; border: 1px solid #cad7e3; border-radius: 8px 8px 0 0; }
.sheet-tabs a { flex: 0 0 auto; padding: 8px 10px; border: 1px solid transparent; border-radius: 5px 5px 0 0; color: var(--ink); font-size: .84rem; text-decoration: none; white-space: nowrap; }
.sheet-tabs a[aria-current="page"] { background: var(--paper); box-shadow: inset 0 -3px var(--blue); font-weight: 700; }
.sheet-tabs + .sheet-scroll { border-top: 0; border-radius: 0 0 9px 9px; }
.month-table th, .month-table td { text-align: right; min-width: 43px; white-space: nowrap; padding: 5px 8px; border-right: 1px solid #cad5e0; height: 29px; }
.month-table .operation-column { position: sticky; left: 0; z-index: 1; text-align: left; padding-left: 12px; min-width: 210px; max-width: 245px; white-space: normal; background: var(--paper); }
.sheet-op-label { white-space: pre-wrap; }
.month-table thead th { text-align: center; font-weight: 700; }
.month-table thead .operation-column, .month-table .book-totals { background: #a6423c; color: #fff; }
.month-table .book-totals { min-width: 72px; }
.month-table .book-value { background: #e0ebf7; color: var(--ink); }
.month-table .empty-column { background: #f3f5f7; }
.month-table .sheet-highlight { background: #fff1ad; color: var(--ink); }
.month-table td.approved { background: #e9f7f2; color: #174c41; }
.month-table td.submitted { background: #fff3da; color: #6b4a1e; }
.month-table tfoot tr:first-child > * { border-top: 2px solid #8aa4bc; }
.month-table tfoot td.sheet-note { text-align: left; color: var(--muted); }
.sheet-action { display: block; width: fit-content; margin: 2px 0 3px; font-size: .77rem; }
.sheet-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 12px; color: var(--muted); font-size: .83rem; }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; background: #ffe1a1; margin-right: .5rem; }
.request-item { border-top: 1px solid var(--line); padding: 10px 0; margin-top: 9px; font-size: .87rem; overflow-wrap: anywhere; }
.request-item p { margin: 4px 0; }
.settings-card { max-width: 650px; padding: 20px; }
.settings-card h2, .settings-card > p, .settings-card h1 { margin-bottom: 12px; }
.form-fields input:not([type="checkbox"]), .form-fields textarea { display: block; margin-top: 4px; }
.form-fields input[type="checkbox"] { vertical-align: middle; margin: 0 5px 0 0; }
.stack { display: grid; gap: 11px; }
.stack p { margin: 0; }
.stack label { margin-bottom: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.staff-actions { margin-bottom: 12px; }
.operation-picker { min-width: 0; margin: 0; padding: 12px; border: 1px solid #cad7e3; border-radius: 8px; }
.operation-picker legend { font-size: .9rem; font-weight: 650; padding: 0 4px; }
.operation-picker input[type="search"] { width: 100%; }
.operation-choices { max-height: 18rem; overflow-y: auto; margin-top: 7px; }
.operation-choices label[data-operation] { align-items: center; display: flex; gap: 6px; padding: 7px 4px; }
.operation-choices label[hidden] { display: none; }
.auth-card { max-width: 436px; margin: 42px auto; padding: 26px; border-top: 3px solid #247e74; }
.auth-card .stack { margin-top: 20px; }
.auth-card p { margin-top: 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric { padding: 14px 19px; }
.metric span, .metric strong { display: block; }
.metric span { font-size: .83rem; color: var(--muted); }
.metric strong { font-size: 1.75rem; font-weight: 700; }
.metric-total strong { font-size: clamp(1.15rem, 2.4vw, 1.75rem); overflow-wrap: anywhere; }
.manager-filter, .manager-filter-dates {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(210px, .85fr); align-items: end;
}
.manager-filter-label, .manager-filter-period legend { display: block; padding: 0; margin-bottom: 5px; font-size: .83rem; font-weight: 650; }
.manager-filter-menu { position: relative; }
.manager-filter-menu summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px;
  padding: 8px 11px; border: 1px solid #c5d3e0; border-radius: 7px; background: var(--paper); list-style: none;
}
.manager-filter-menu summary::-webkit-details-marker { display: none; }
.manager-filter-menu summary span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.manager-filter-menu summary::after {
  content: ""; flex: 0 0 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.manager-filter-menu[open] summary { border-color: var(--blue); }
.manager-filter-options {
  position: absolute; z-index: 2; inset: calc(100% + 5px) 0 auto; padding: 4px;
  border: 1px solid #c5d3e0; border-radius: 8px; background: var(--paper); box-shadow: var(--shadow);
}
.manager-filter-menu-actions {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.manager-filter-menu-actions .button { min-height: 40px; padding: 5px 8px; font-size: .8rem; }
.manager-filter-choices { max-height: min(15rem, 38vh); overflow-y: auto; overscroll-behavior: contain; }
.manager-filter-options label {
  display: flex; align-items: center; gap: 8px; min-height: 42px; margin: 0; padding: 7px;
  border-radius: 5px; overflow-wrap: anywhere; cursor: pointer;
}
.manager-filter-options label:hover, .manager-filter-options label:focus-within { background: var(--pale); }
.manager-filter-options p { padding: 6px; }
.manager-filter-period { grid-column: 1 / -1; min-width: 0; padding: 0; margin: 0; border: 0; }
.manager-filter-dates { gap: 5px 14px; }
.manager-filter-dates input { display: block; min-width: 0; }
.manager-filter-period p { grid-column: 1 / -1; }
.manager-filter-actions { grid-column: 3; grid-row: 1; }
.manager-filter-dates input[type="date"], .manager-filter-actions .button { min-height: 44px; }
.manager-filter-error { margin-left: 20px; margin-right: 20px; }
.bulk-form { padding: 0 20px 14px; }
.manager-table th:first-child { min-width: 118px; }
.review-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.manager-table .review-select-cell { width: 52px; min-width: 0; padding: 4px 8px; text-align: center; }
.review-select-cell label { display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; cursor: pointer; }
.manager-table table td { line-height: 1.25; }
.table-note, .change-detail summary { display: block; font-size: .77rem; color: var(--muted); }
.change-detail { margin-top: 4px; }
.change-detail summary { cursor: pointer; text-decoration: underline; }
.change-detail p { padding-top: 4px; font-size: .78rem; }
.issues { font-size: .84rem; }
.issues ul { padding-left: 16px; }
.back-link { display: inline-block; margin-bottom: 14px; font-weight: 640; font-size: .89rem; text-decoration: none; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px; font-size: .83rem; }
@media (max-width: 920px) {
  .header-inner, .nav-inner, .page { padding-left: 20px; padding-right: 20px; }
  .entry-grid { gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(230px, 262px); }
}
@media (max-width: 540px), (min-width: 731px) and (max-width: 840px) {
  .manager-filter { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(105px, .85fr); }
  .manager-filter-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  .manager-filter-actions { grid-column: 1 / -1; grid-row: auto; margin-top: 5px; }
}
@media (max-width: 730px) {
  .header-inner, .nav-inner, .page { padding-left: 14px; padding-right: 14px; }
  .header-inner { min-height: 64px; gap: .4rem; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 8px; }
  .brand { gap: 7px; }
  .brand strong { font-size: .77rem; }
  .brand small { font-size: .7rem; }
  .account { gap: .5rem; }
  .account-icon { display: none; }
  .nav-inner { gap: 19px; }
  .nav-inner a { font-size: .81rem; padding-top: 11px; padding-bottom: 10px; }
  .page { padding-top: 22px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 16px; gap: 12px; }
  .page-heading p { font-size: .88rem; }
  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  form.entry-grid .entry-aside { position: static; }
  .page:has(.estimate-card) { padding-bottom: 125px; }
  .estimate-card { position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; border-radius: 9px 9px 0 0;
    padding: 8px 12px max(10px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px #132f491d;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .estimate-card h2, .estimate-card > p, .estimate-card #estimate .small { display: none; }
  .estimate-card #estimate { min-height: 0; padding: 5px 8px; margin: 0; }
  .estimate-card .estimate-value { font-size: 1.23rem; }
  .estimate-card .estimate-label { font-size: .73rem; }
  .estimate-card .estimate-error { font-size: .75rem; }
  .estimate-card .button { max-width: 165px; min-height: 44px; padding: 7px 9px; font-size: .78rem; }
  .work-controls, .card-header { padding-left: 12px; padding-right: 12px; }
  .operations th, .operations td { padding: 8px 6px; }
  .operations th:first-child { padding-left: 12px; }
  .operations th:nth-child(2), .operations .rate { width: auto; }
  .operations th:last-child, .operations .quantity { width: 104px; }
  .operations .rate, .operations th { font-size: .8rem; }
  .operations .quantity input { min-height: 42px !important; font-size: 1rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .metric { padding: 9px; }
  .metric span { font-size: .73rem; }
  .metric strong { font-size: 1.38rem; }
  .metric-total strong { font-size: clamp(1.1rem, 5vw, 1.38rem); }
  .month-table .operation-column { min-width: 146px; max-width: 160px; }
  .responsive thead { display: none; }
  .responsive tbody, .responsive tr { display: block; }
  .responsive tbody tr { display: grid; grid-template-columns: 1fr 1fr; padding: 9px 12px; border-top: 1px solid var(--line); gap: 4px; }
  .responsive tbody tr:first-child { border-top: 0; }
  .responsive tbody tr > * { display: block; border: 0; padding: 3px 0; min-width: 0; }
  .responsive tbody th, .responsive .empty { grid-column: 1 / -1; grid-row: 1; }
  .responsive .account-actions-cell { grid-column: 1 / -1; }
  .manager-table.with-selection tbody th[scope="row"] { grid-column: 1; }
  .manager-table .review-select-cell { grid-column: 2; grid-row: 1; justify-self: end; width: auto; padding: 0; }
  .manager-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manager-filter-status { grid-column: 1 / -1; }
  .manager-filter-error { margin-left: 12px; margin-right: 12px; }
  .bulk-form { padding-left: 12px; padding-right: 12px; }
  .responsive td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .7rem; }
}
@media (max-width: 400px) {
  .account-name { font-size: .7rem; }
  .leave { padding: 5px; font-size: .73rem; }
  .work-controls { gap: 9px; }
  .work-controls .date-field { width: 141px; }
  .search-field { min-width: 141px; }
}
