/* ESS Invoice Monitor — light stationery and desktop controls */
:root {
    color-scheme: light;
    --ink: #1d1d1d;
    --navy: #1e3151;
    --burgundy: #8b3333;
    --paper: #fffef9;
    --desk: #eae7df;
    --muted: #69685f;
    --line: #d6d2c7;
    --rule: #dce2e7;
    --paper-shadow: 0 1px 2px #3f38221a, 0 5px 12px #3f38220d;
    --bevel: inset 0 1px 0 #fff, 0 1px 1px #473c2226;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background-color: var(--desk); background-image: repeating-linear-gradient(0deg,#fff3 0,#fff3 1px,transparent 1px,transparent 4px),repeating-linear-gradient(90deg,#82796506 0,#82796506 1px,transparent 1px,transparent 4px); font: 14px/1.55 "Segoe UI",Arial,sans-serif; }
a { color: inherit; text-decoration: none; }
button,input,select,textarea { font: inherit; }
button,a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 4px; }
h1,h2,h3,p { margin: 0; }
h1 { font: 400 33px/1.2 Georgia,"Times New Roman",serif; color: var(--navy); letter-spacing: -.7px; overflow-wrap: anywhere; }
h2 { font: 600 18px/1.35 Georgia,"Times New Roman",serif; color: var(--navy); }
h3 { font-size: 14px; font-weight: 600; }
small,.small { font-size: 12px; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.full-width { width: 100%; }
.preserve-lines { white-space: pre-line; overflow-wrap: anywhere; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; letter-spacing: 1.3px; margin-bottom: 10px; }

/* A light desktop toolbar with physical index tabs. */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.sidebar { display: flex; align-items: center; gap: 42px; min-height: 91px; padding: 19px max(32px,calc((100vw - 1320px)/2)); background: linear-gradient(#faf8f2,#e5e1d7); border-bottom: 1px solid #bfb9ac; box-shadow: inset 0 1px #fff,0 2px 4px #443f3314; }
.brand { display: inline-flex; align-items: center; gap: 11px; font: 700 24px/1.1 Georgia,serif; color: var(--navy); letter-spacing: .8px; flex-shrink: 0; }
.brand-logo { display: block; width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.brand-caption { display: block; margin-top: 6px; color: #666458; font: 500 9px/1.4 "Segoe UI",sans-serif; letter-spacing: 1.4px; }
.sidebar nav { display: flex; align-self: stretch; align-items: end; gap: 5px; margin-bottom: -20px; padding-top: 5px; }
.nav-item { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 13px 23px 15px; border: 1px solid #c9c4b8; border-bottom: 0; border-radius: 8px 8px 0 0; background: linear-gradient(#eeeae0,#dfdbcf); box-shadow: inset 0 1px #fff9; font-size: 13px; color: #615f55; text-shadow: 0 1px #fff9; }
.nav-item:hover { background: linear-gradient(#faf8f1,#e9e4d8); color: var(--navy); }
.nav-item.active { background: linear-gradient(#fffef9,#f4f0e6); color: var(--navy); font-weight: 600; border-color: #b8b1a1; position: relative; box-shadow: inset 0 3px var(--burgundy),0 -2px 5px #52472d08; }
.nav-item.active::after { content: ""; position: absolute; height: 2px; bottom: -1px; left: 0; right: 0; background: #f4f0e6; }
.sidebar-bottom { margin-left: auto; min-width: 0; }
.admin-card { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 31px; height: 34px; flex-shrink: 0; border: 1px solid #c7c2b7; border-radius: 3px; background: #f8f5ed; color: var(--navy); font: 600 15px Georgia,serif; box-shadow: inset 0 1px #fff,0 1px 2px #0001; }
.admin-card>div { max-width: 150px; min-width: 0; }
.admin-card strong { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-card small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 7px; border: 1px solid #bcb8ae; border-radius: 4px; background: linear-gradient(#fffef9,#e0ddd3); color: #52534e; box-shadow: var(--bevel); }
.icon-button:hover { color: var(--burgundy); }
.icon-button:active { background: #e1ded5; box-shadow: inset 0 2px 3px #5f563426; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { width: 100%; max-width: 1384px; margin: 0 auto; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 32px; color: var(--muted); font-size: 11px; }
.topbar strong { font-weight: 500; color: #4b4b47; }
.crumb-divider { margin: 0 10px; color: #918d83; }
.topbar-date { display: flex; align-items: center; gap: 8px; }
.topbar-date .icon { width: 14px; height: 14px; }
.mobile-signout { display: none; }
main#main { flex: 1; width: 100%; max-width: 1384px; padding: 13px 32px 35px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
.page-heading p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.footer { max-width: 1384px; width: 100%; margin: 0 auto; padding: 16px 32px 25px; display: flex; justify-content: space-between; gap: 15px; font-size: 11px; color: #706c63; }
.footer span:first-child { font-family: Georgia,serif; }

/* Restrained bevels: controls sit above the paper. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 10px 17px; border: 1px solid #b8b4a9; border-bottom-color: #a5a093; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; background: linear-gradient(#fffef9,#e6e2d7); color: #424641; box-shadow: var(--bevel); }
.button .icon { width: 16px; height: 16px; }
.button:hover { filter: brightness(1.035); }
.button:active { transform: translateY(1px); box-shadow: inset 0 2px 3px #0002; }
.primary { color: #fffaf6; background: linear-gradient(#a14b49,var(--burgundy)); border-color: #762c2b; border-bottom-color: #5d2323; box-shadow: inset 0 1px 0 #ffffff4d,0 2px 0 #652828,0 3px 4px #663d2724; text-shadow: 0 -1px #561f1f; }
.primary:active { background: var(--burgundy); }
.secondary { background: linear-gradient(#fffef9,#e8e4da); color: var(--navy); }
.quiet { background: transparent; color: var(--muted); border-color: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--burgundy); background: linear-gradient(#fffaf7,#f1e3dd); border-color: #c7a49b; }
.panel { min-width: 0; border: 1px solid #c9c3b6; border-radius: 3px; background: var(--paper); box-shadow: var(--paper-shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 21px 24px; background: linear-gradient(#fffef9,#f8f5ec); border-bottom: 1px solid #ddd7c9; }
.panel-heading p { color: var(--muted); font-size: 11px; margin-top: 5px; }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--navy); font-size: 12px; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link .icon { width: 14px; height: 14px; }

/* Account summary: one paper register, with ruled columns. */
.summary-sheet { margin-bottom: 29px; border: 1px solid #c5bfae; background: var(--paper); box-shadow: 0 2px 1px #fffaf1,0 3px 0 #cbc4b5,0 6px 10px #4c402915; border-radius: 2px; }
.summary-label { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 22px; border-bottom: 1px solid #d9d1c0; background: linear-gradient(#faf7ee,#ede8da); color: var(--navy); font-family: Georgia,serif; font-size: 14px; }
.summary-label span { color: var(--muted); font: 10px "Segoe UI",sans-serif; text-transform: uppercase; letter-spacing: .8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.stat-card { min-width: 0; padding: 18px 23px 17px; border-right: 1px solid #d7dcd9; background: linear-gradient(0deg,#f7f5ee99,transparent 28%); }
.stat-card:last-child { border-right: 0; }
.stat-card:hover { background-color: #f5f2e9; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #555951; font-size: 12px; margin-bottom: 13px; }
.stat-icon { display: grid; place-items: center; width: 22px; height: 22px; color: #7b7c72; }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-icon.blue { color: var(--navy); }
.stat-icon.red { color: var(--burgundy); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 550; }
.currency { color: var(--muted); font-size: .76em; font-weight: 400; }
.stat-card>.money { display: block; color: var(--navy); font: 400 clamp(22px,2vw,29px)/1.3 Georgia,serif; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.5px; overflow-wrap: anywhere; white-space: normal; }
.stat-card>.money .currency { font: 400 10px "Segoe UI",sans-serif; letter-spacing: .6px; margin-right: 3px; }
.stat-note { display: block; margin-top: 13px; color: var(--muted); font-size: 11px; }
.overdue-card>.money,.overdue-card .stat-note { color: var(--burgundy); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,2.45fr) minmax(275px,1fr); gap: 26px; align-items: start; }
.dashboard-aside { min-width: 0; display: grid; gap: 26px; }
.recent-panel { min-height: 350px; border-top: 3px double #9caaa9; }
.recent-panel .panel-heading { padding-left: 29px; }
.settlement-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 19px 22px 13px; }
.settlement-summary strong { font: 400 32px Georgia,serif; color: var(--navy); }
.settlement-summary strong small { font-size: 17px; margin-left: 2px; }
.settlement-summary>span { color: var(--muted); font-size: 11px; }
.settlement-track { display: flex; height: 12px; margin: 0 22px; padding: 2px; background: #e5e3d9; border: 1px solid #b9b8ac; border-radius: 2px; box-shadow: inset 0 1px 2px #6d665233; }
.settlement-track span { width: var(--progress); background: linear-gradient(#66809b,#1e3151); border-radius: 1px; box-shadow: inset 0 1px #ffffff55; }
.settlement-legend { display: grid; grid-template-columns: 1fr 1fr; margin: 19px 22px; border-block: 1px solid var(--rule); }
.settlement-legend a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; }
.settlement-legend a:first-child { border-right: 1px solid var(--rule); padding-right: 15px; }
.settlement-legend a:last-child { padding-left: 15px; }
.settlement-legend a>span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.settlement-legend strong { font: 400 20px Georgia,serif; color: var(--navy); }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #7d7a72; flex-shrink: 0; }
.blue-dot { background: var(--navy); }
.gray-dot { background: #9b9280; }
.red-dot { background: var(--burgundy); }
.due-panel { background: #fffdf4; border-top: 3px solid #c8bc98; }
.due-panel .panel-heading { background: #f8f2df; }
.followup-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 10px; padding: 16px 22px; border-top: 1px solid #e0dfcf; background-image: linear-gradient(90deg,transparent 11px,#b55b5b20 11px,#b55b5b20 12px,transparent 12px); }
.followup-item:first-child { border-top: 0; }
.followup-item:hover { background-color: #f5f1df; }
.followup-client { min-width: 0; }
.followup-client strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.followup-client small { display: block; color: var(--muted); font: 11px/1.5 Consolas,monospace; margin-top: 3px; }
.followup-item>.money { align-self: start; color: var(--navy); font-size: 12px; }
.followup-item .currency { display: none; }
.followup-due { display: flex; justify-content: space-between; align-items: center; gap: 8px; grid-column: 1/-1; color: var(--muted); font-size: 11px; }

/* Ruled ledgers and stamped status marks. */
.table-scroll { overflow-x: auto; position: relative; scrollbar-color: #b9b5a9 #f2eee3; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 12px; background: var(--paper); }
th { padding: 12px 20px; background: #eeeade; border-bottom: 1px solid #bdc4c8; border-right: 1px solid #d4d8d4; color: #545c60; font-size: 11px; font-weight: 600; }
td { padding: 16px 20px; border-bottom: 1px solid #dbe1e1; border-right: 1px solid #e3e6e0; color: #3d4245; }
th:last-child,td:last-child { border-right: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f8f7f0; }
tbody tr:hover { background: #edf0ea; }
.recent-panel td:first-child { border-left: 3px double #b5777738; }
.invoice-link { color: var(--navy); font: 600 12px Consolas,"Courier New",monospace; }
.invoice-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.cell-subtitle { display: block; margin-top: 6px; max-width: 205px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.cell-title { display: block; max-width: 205px; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 27px; padding: 4px 9px; border: 1px solid currentColor; border-radius: 3px; font: 700 12px/1.4 "Segoe UI",sans-serif; text-transform: uppercase; letter-spacing: .45px; white-space: nowrap; box-shadow: inset 0 1px 0 #ffffff66; }
.badge>span { display: none; }
.badge-paid { color: #20532c; background: #c7e6cb; border-color: #487751; }
.badge-settled { color: var(--navy); background: #d3e3f6; border-color: #476486; }
.badge-unpaid { color: #593400; background: #f6c75a; border-color: #9a650b; }
.badge-pending { color: #71350e; background: #ffd1a6; border-color: #b46b2c; }
.badge-overdue { color: #ffffff; background: var(--burgundy); border-color: #682626; }
.overdue-text { display: block; color: var(--burgundy); font-size: 11px; font-weight: 700; margin-top: 5px; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 47px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 47px; height: 53px; background: linear-gradient(#fff,#f0ecdf); color: #7b827e; border: 1px solid #cbc8ba; border-radius: 2px; box-shadow: 2px 2px 0 #eee9dc,3px 3px 0 #cfc8b8; margin-bottom: 21px; }
.empty-icon .icon { width: 24px; height: 24px; }
.empty-state h3 { color: var(--navy); font: 600 17px Georgia,serif; }
.empty-state p { font-size: 12px; color: var(--muted); max-width: 320px; margin: 10px 0 23px; }
.empty-inline { display: flex; align-items: center; gap: 12px; padding: 23px; }
.empty-inline>.icon { color: var(--navy); }
.empty-inline strong { font-size: 12px; font-weight: 600; }
.empty-inline p { color: var(--muted); font-size: 11px; margin-top: 4px; }

/* White writing fields, with narrow inset edges. */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { color: #4c504b; font-size: 12px; font-weight: 600; }
.field input,.field select,.field textarea,.search-input input { width: 100%; min-height: 43px; padding: 11px 12px; border: 1px solid #b8b8ac; border-top-color: #a9ada4; border-radius: 3px; background: #fffffc; color: var(--ink); box-shadow: inset 0 2px 3px #595b4410,0 1px #fff; font-size: 13px; }
.field input:focus,.field select:focus,.field textarea:focus,.search-input input:focus { outline: 2px solid #7085a04d; outline-offset: 1px; border-color: #6c809a; background: #fff; }
input::placeholder,textarea::placeholder { color: #797b72; opacity: 1; font-size: 12px; }
.field textarea { resize: vertical; min-height: 93px; line-height: 1.6; }
.field select { background: linear-gradient(#fffffb,#efeee6); padding-right: 26px; box-shadow: inset 0 1px #fff,0 1px 1px #0000000d; }
.field input:disabled { background: #eceae3; color: #7d7b73; cursor: not-allowed; }
.field input[aria-invalid=true] { border-color: var(--burgundy); }
.required,.field-error { color: var(--burgundy); }
.field-error { font-size: 12px; }
input[type=date] { min-width: 0; }
input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 1000px #fffdf1 inset; }
.filters { padding: 23px 24px; background: #f5f2e9; border-bottom: 1px solid #d8d2c2; }
.filter-primary { display: grid; grid-template-columns: minmax(0,2fr) repeat(2,minmax(0,1fr)); gap: 18px; }
.filter-secondary { display: flex; align-items: end; flex-wrap: wrap; gap: 18px; margin-top: 20px; }
.filter-secondary>.field { flex: 1; max-width: 185px; }
.search-input { position: relative; }
.search-input>.icon { position: absolute; left: 13px; top: 13px; width: 17px; height: 17px; color: #7d827d; }
.search-input input { padding-left: 39px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; min-height: 43px; color: #565a54; font-size: 12px; white-space: nowrap; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--navy); }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }
.list-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; padding: 14px 24px; color: var(--muted); font-size: 12px; }
.list-summary strong { font-weight: 600; color: var(--ink); }
.list-summary .money { color: var(--navy); margin-left: 10px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; background: #f8f6ef; }
.pagination>div { display: flex; align-items: center; gap: 14px; }
.back-link { display: inline-block; font-size: 12px; color: var(--muted); margin-bottom: 11px; }
.back-link:hover { color: var(--navy); text-decoration: underline; }
.form-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(280px,1fr); gap: 26px; align-items: start; }
.form-section { padding: 27px; }
.form-main>.panel+.panel { margin-top: 26px; }
.section-title { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 3px double #c9cbbf; }
.section-title p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.section-number { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; color: var(--burgundy); border: 1px solid #bf9690; background: #fffaf3; font: 600 13px Georgia,serif; border-radius: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 23px; }
.span-2 { grid-column: span 2; }
.form-aside .panel { background: #f7f3e7; }
.upload-group { position: relative; padding: 18px 15px; margin-top: 25px; border: 1px solid #c8bd9f; border-radius: 0 3px 3px 3px; background: linear-gradient(#fffbeb,#f0e8cd); box-shadow: inset 0 1px #fff,0 2px 2px #65532210; overflow: visible; }
.upload-group::before { content: ""; position: absolute; top: -8px; left: -1px; width: 65px; height: 8px; border: 1px solid #c8bd9f; border-bottom: 0; border-radius: 4px 4px 0 0; background: #fffbeb; }
.upload-group label { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: #565344; font-size: 12px; font-weight: 600; }
.upload-group .icon { color: var(--navy); width: 15px; height: 15px; }
.upload-group input { font-size: 11px; width: 100%; color: #686455; }
.upload-group input::file-selector-button { cursor: pointer; border: 1px solid #b8b09a; border-radius: 3px; padding: 8px 10px; margin-right: 8px; background: linear-gradient(#fffefa,#e5e0d0); box-shadow: var(--bevel); color: var(--navy); font-size: 11px; }
.upload-group small { display: block; font-size: 11px; color: #6f6a5c; margin-top: 12px; }
.document-help { color: var(--muted); font-size: 12px; margin-top: 22px; }
.info-note { border: 1px solid #cfd6d9; border-left: 3px solid #6e839b; background: #f0f3f4; padding: 14px; color: #4e5f6b; font-size: 12px; margin-top: 23px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 27px; }
.alert { border: 1px solid #b9c6cc; padding: 15px 19px; border-radius: 3px; margin-bottom: 24px; font-size: 13px; box-shadow: inset 0 1px #fff9; }
.alert.success { display: flex; align-items: center; gap: 11px; background: #eaf0f3; color: var(--navy); }
.alert.error { border-color: #cea59a; background: #fbefe9; color: #7a302d; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }

/* Individual invoice sheets and account records. */
.heading-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(280px,1fr); gap: 26px; align-items: start; }
.detail-layout>div,.detail-layout>aside { min-width: 0; }
.invoice-sheet { position: relative; padding: 35px; border-radius: 0; border-top: 5px solid #ded8c8; box-shadow: 0 2px 0 #fffcf2,0 3px 0 #ccc5b5,0 7px 12px #3e332617; background: linear-gradient(90deg,transparent 16px,#b4777726 16px,#b4777726 17px,transparent 17px),var(--paper); }
.sheet-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 23px; padding-bottom: 25px; border-bottom: 3px double #a4afa8; }
.sheet-heading h2 { font-size: 26px; margin: 6px 0; overflow-wrap: anywhere; }
.sheet-heading .muted { font-size: 12px; }
.sheet-amount { text-align: right; }
.sheet-amount>.money { display: block; font: 400 28px/1.35 Georgia,serif; color: var(--navy); margin: 8px 0 16px; }
.sheet-amount>.money .currency { font-family: "Segoe UI",sans-serif; font-size: 12px; }
.badge-group { display: flex; justify-content: flex-end; gap: 9px; }
.bill-to { padding: 29px 0; }
.bill-to h3 { color: var(--navy); font: 600 18px Georgia,serif; margin-bottom: 9px; overflow-wrap: anywhere; }
.bill-to p { font-size: 13px; color: var(--muted); }
.details-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; border-top: 1px solid var(--rule); margin: 0; }
.details-grid>div { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.details-grid>div:nth-child(odd) { padding-right: 20px; }
.details-grid dt,.account-details dt { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.details-grid dd,.account-details dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.details-grid dd .badge { margin-left: 6px; }
.invoice-notes { padding-top: 24px; margin: 5px 0 28px; }
.invoice-notes p { color: #565b56; font-size: 13px; }
.sheet-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 19px; color: var(--muted); font-size: 11px; }
.documents-panel { padding-bottom: 23px; background: #f9f5e9; }
.documents-panel>.button { margin: 21px 23px 0; width: calc(100% - 46px); }
.document-category { padding: 18px 23px; border-bottom: 1px solid #ded7c2; }
.document-category h3 { font-size: 12px; color: #5f5949; margin-bottom: 12px; }
.document-item { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.document-item>a { display: flex; align-items: center; flex: 1; min-width: 0; gap: 11px; color: var(--navy); font-size: 12px; }
.document-item>a .icon { width: 16px; height: 16px; }
.document-item>a span { min-width: 0; overflow-wrap: anywhere; }
.document-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.delete-file { display: grid; place-items: center; width: 31px; height: 31px; color: var(--burgundy); border: 1px solid #c9b4a7; border-radius: 3px; background: linear-gradient(#fffcf7,#ebe2d6); font-size: 22px; line-height: 1; box-shadow: var(--bevel); }
.danger-zone { padding: 22px; margin-top: 25px; background: #f9f2e9; border: 1px solid #ccb7a5; border-radius: 3px; }
.danger-zone h3 { color: var(--burgundy); font-size: 13px; }
.danger-zone p { font-size: 12px; color: #75675c; margin: 9px 0 17px; }
.account-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.5fr); gap: 26px; max-width: 1020px; align-items: start; }
.account-details { margin: 25px 0; }
.account-details dd { padding-bottom: 15px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); }
.password-form { display: grid; gap: 23px; margin-top: 25px; }
.password-form .button { justify-self: start; }
.account-layout .form-section>p { font-size: 12px; margin-top: 9px; }

/* A clipped paper sign-in sheet, not a dark application panel. */
.login-body { min-height: 100svh; padding: 45px 24px; display: grid; place-items: center; }
.login-shell { width: 100%; max-width: 435px; }
.login-brand { display: flex; justify-content: center; margin-bottom: 39px; }
.login-panel { position: relative; padding: 40px 33px 33px; border: 1px solid #bcb4a3; border-top: 8px solid #d7cebb; border-radius: 2px; background-color: #fffdf5; background-image: linear-gradient(90deg,transparent 17px,#b5767633 17px,#b5767633 18px,transparent 18px); box-shadow: 0 2px 0 #fdf8ed,0 3px 0 #c6beab,0 5px 0 #f4efe1,0 6px 0 #c6beab,0 12px 20px #4f432324; }
.login-panel::before { content: ""; position: absolute; top: -18px; left: calc(50% - 46px); width: 92px; height: 27px; border: 1px solid #a2a49d; border-radius: 5px 5px 3px 3px; background: linear-gradient(#e8eae5 0%,#b9bdb8 18%,#f6f7f2 44%,#c3c7c0 65%,#e7eae3 100%); box-shadow: inset 0 1px #fff,0 3px 4px #343e3926; }
.login-heading { display: flex; align-items: center; gap: 13px; padding-bottom: 21px; border-bottom: 3px double #b8c0b7; }
.login-icon { display: grid; place-items: center; width: 39px; height: 43px; color: var(--navy); border: 1px solid #c7c2b3; border-radius: 3px; background: linear-gradient(#fefdf7,#eee9dc); box-shadow: inset 0 1px #fff; flex-shrink: 0; }
.login-heading h1 { font: 400 25px/1.2 Georgia,serif; letter-spacing: -.3px; }
.login-heading p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.login-form form { margin-top: 25px; display: grid; gap: 23px; }
.login-form .button { justify-content: space-between; min-height: 43px; margin-top: 3px; }
.login-form>.alert { margin: 23px 0 0; }
.login-footnote { display: flex; justify-content: center; align-items: center; gap: 7px; color: #716d62; font-size: 11px; margin-top: 24px; }
.login-footnote .icon { width: 13px; height: 13px; }
.sr-only,.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fffdf5; color: var(--navy); padding: 12px; border: 1px solid var(--navy); }

.audit-scope { margin-bottom: 18px; font-size: 12px; color: var(--muted); }
.audit-scope a { color: var(--navy); text-decoration: underline; }
.audit-summary { max-width: 240px; white-space: normal; }
.audit-actor { min-width: 160px; white-space: normal; overflow-wrap: anywhere; }
.audit-actor-name { display: block; color: var(--navy); font-size: 14px; }
.audit-actor-email { display: block; margin-top: 5px; color: var(--ink, #1d1d1d); font-size: 12px; }
.audit-actor-reference { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.audit-entry-metadata { margin-top: 22px; }
.audit-values-heading { margin: 25px 0 15px; }
.audit-values { table-layout: fixed; }
.audit-values th,.audit-values td { padding: 13px 10px; white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
.audit-values th:first-child { width: 24%; }
@media (max-width: 400px) { .sidebar nav { gap: 3px; } .nav-item { min-width: 0; } .nav-item .icon { display: none; } .audit-values th:first-child { width: 30%; } }

/* Responsive desk and paper layouts. */
@media (max-width: 1150px) {
    .sidebar { gap: 27px; padding-inline: 28px; }
    .nav-item { padding-inline: 18px; }
    .admin-card>div { max-width: 110px; }
    .dashboard-grid { grid-template-columns: minmax(0,2fr) minmax(255px,1fr); gap: 22px; }
    .stat-card { padding-inline: 19px; }
    .stat-card>.money { font-size: 25px; }
    th,td { padding-inline: 17px; }
    .form-layout,.detail-layout { grid-template-columns: minmax(0,1.8fr) minmax(270px,1fr); gap: 22px; }
    .form-section { padding: 23px; }
    .sheet-amount { text-align: left; }
    .badge-group { justify-content: flex-start; }
}
@media (max-width: 960px) {
    .sidebar { flex-wrap: wrap; gap: 18px 24px; padding: 18px 27px 0; }
    .sidebar nav { order: 3; width: 100%; margin-bottom: -1px; padding-top: 0; }
    .nav-item { min-height: 43px; }
    .sidebar-bottom { margin-left: auto; }
    .admin-card>div { max-width: 160px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-aside { grid-template-columns: minmax(0,1fr) minmax(0,1.3fr); align-items: start; }
    .form-layout,.detail-layout,.account-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .stat-card:nth-child(2) { border-right: 0; }
    .stat-card:nth-child(-n+2) { border-bottom: 1px solid #d7dcd9; }
    .stat-card>.money { font-size: 28px; }
    .filter-actions { margin-left: 0; }
    .sheet-heading { flex-wrap: nowrap; }
    .sheet-amount { text-align: right; }
    .badge-group { justify-content: flex-end; }
}
@media (max-width: 650px) {
    .sidebar { padding: 19px 22px 0; gap: 19px; }
    .brand { font-size: 22px; gap: 10px; }
    .brand-logo { width: 44px; height: 44px; }
    .brand-caption { font-size: 8px; }
    .sidebar-bottom { display: none; }
    .sidebar nav { gap: 5px; }
    .nav-item { flex: 1; justify-content: center; padding: 12px 11px; font-size: 12px; gap: 7px; }
    .nav-item .icon { width: 16px; height: 16px; }
    .topbar { height: 56px; padding-inline: 22px; font-size: 10px; }
    .topbar-date { margin-left: auto; font-size: 10px; }
    .topbar-date .icon { display: none; }
    .mobile-signout { display: block; margin-left: auto; }
    .mobile-signout .icon-button { width: 30px; height: 30px; }
    main#main { padding: 17px 22px 29px; }
    h1 { font-size: 29px; }
    .page-heading { flex-wrap: wrap; gap: 18px; margin-bottom: 24px; }
    .page-heading p { font-size: 12px; }
    .summary-label { padding: 11px 17px; }
    .summary-label span { font-size: 9px; }
    .stat-card { padding: 16px 18px; }
    .stat-card>.money { font-size: 25px; }
    .stat-card>.money .currency { display: block; font-size: 9px; margin-bottom: 4px; }
    .stat-label { font-size: 11px; }
    .stat-note { font-size: 10px; }
    .dashboard-aside { grid-template-columns: 1fr; }
    .panel-heading { padding: 19px 21px; }
    .recent-panel .panel-heading { padding-left: 21px; }
    .panel-heading h2 { font-size: 17px; }
    .footer { padding: 13px 22px 24px; font-size: 10px; }
    .filter-primary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
    .search-field { grid-column: 1/-1; }
    .filter-secondary { gap: 16px; }
    .filter-secondary>.field { max-width: none; min-width: calc(50% - 8px); }
    .checkbox-label { flex: 1; font-size: 11px; }
    .filters { padding: 21px; }
    .list-summary { padding: 15px 21px; font-size: 11px; }
    .pagination { flex-direction: column; align-items: start; padding: 21px; }
    .form-section { padding: 23px; }
    .form-grid { grid-template-columns: 1fr; gap: 22px; }
    .span-2 { grid-column: auto; }
    .section-title { gap: 11px; }
    .section-title h2 { font-size: 17px; }
    .heading-actions { gap: 11px; }
    .invoice-sheet { padding: 28px; }
    .sheet-heading { flex-wrap: wrap; }
    .sheet-amount { text-align: left; }
    .badge-group { justify-content: flex-start; }
    .details-grid { grid-template-columns: 1fr; }
    .details-grid>div:nth-child(odd) { padding-right: 0; }
    .login-panel { padding: 36px 28px 28px; }
    .login-heading h1 { font-size: 24px; }
}
@media (max-width: 400px) {
    .topbar-date { display: none; }
    .sidebar { padding-inline: 17px; }
    .nav-item { padding-inline: 8px; font-size: 11px; }
    main#main { padding-inline: 17px; }
    .stat-card { padding-inline: 13px; }
    .stat-card>.money { font-size: 22px; }
    .stat-icon { width: 18px; }
    .summary-label { font-size: 13px; }
    .summary-label span { font-size: 8px; }
    .filter-actions { gap: 4px; }
    .filter-actions .button { padding-inline: 10px; font-size: 11px; }
    .pagination>div { gap: 8px; }
    .pagination .button { padding-inline: 10px; }
    .login-body { padding-inline: 21px; }
    .login-panel { padding-inline: 24px; }
    .login-heading { gap: 10px; }
    .login-heading h1 { font-size: 22px; }
    .login-icon { width: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
    :root { color-scheme: light; --ink: #111; --muted: #555; --line: #ddd; }
    body { background: white; color: #111; font-size: 12px; }
    .sidebar,.topbar,.footer,.page-heading,.detail-layout>aside,.alert,.skip-link { display: none !important; }
    .workspace { margin: 0; }
    main#main { padding: 0; max-width: none; }
    .detail-layout { display: block; }
    .invoice-sheet { border: 0; box-shadow: none; padding: 0; background: white; overflow: visible; }
    .invoice-sheet *,.invoice-sheet .eyebrow,.invoice-sheet .currency { color: #222 !important; box-shadow: none !important; }
    .badge { background: white !important; border-color: #888; }
    .sheet-heading { flex-wrap: nowrap; }
    .sheet-amount { text-align: right; }
    .badge-group { justify-content: flex-end; }
    .invoice-notes,.details-grid,.bill-to { break-inside: avoid; }
    .details-grid { grid-template-columns: 1fr 1fr; }
    .sheet-footer { margin-top: 20px; }
}
