:root {
    color-scheme: light;
    --ink: #162132;
    --muted: #68768a;
    --line: #dfe5ed;
    --surface: #ffffff;
    --canvas: #f3f6fa;
    --navy: #153b63;
    --blue: #2d83c5;
    --green: #17976f;
    --purple: #7456c8;
    --amber: #d48a1d;
    --danger: #b42318;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-height: 100vh; }
a { color: #1769a5; }
.site-header { min-height: 72px; padding: 14px clamp(20px, 5vw, 72px); background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { color: var(--navy); text-decoration: none; font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; display: grid; place-items: center; }
.site-brand-logo { display: block; width: auto; max-width: 210px; height: 44px; object-fit: contain; object-position: left center; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.user-label { color: var(--muted); font-size: .92rem; }
.page-shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 72px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
h1, h2 { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.05; letter-spacing: -.045em; margin-bottom: 10px; }
h2 { font-size: 1.15rem; }
.eyebrow { text-transform: uppercase; color: var(--blue); font-size: .74rem; font-weight: 800; letter-spacing: .16em; margin-bottom: 12px; }
.muted { color: var(--muted); line-height: 1.6; }
.role-pill { background: #e7f1f8; color: var(--navy); border: 1px solid #c7dbe9; border-radius: 999px; padding: 8px 14px; font-weight: 700; }
.auth-card { width: min(480px, 100%); margin: 34px auto; background: var(--surface); padding: clamp(28px, 6vw, 50px); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 70px rgba(25, 51, 75, .09); }
.auth-card-wide { width: min(680px, 100%); }
label { display: block; margin: 18px 0 7px; font-weight: 700; font-size: .9rem; }
input, select, textarea { width: 100%; min-height: 48px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 13px; font: inherit; color: var(--ink); background: #fff; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(45, 131, 197, .16); border-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.button { border: 0; border-radius: 10px; min-height: 42px; padding: 9px 16px; font: inherit; font-weight: 750; cursor: pointer; }
.button-primary { background: var(--navy); color: #fff; }
.button-primary:hover { background: #0e2f50; }
.button-success { background: #08724f; color: #fff; }
.button-success:hover { background: #055c3f; }
.button-danger { background: #b42318; color: #fff; }
.button-danger:hover { background: #8f1c13; }
.button-quiet { color: var(--navy); background: #edf3f8; }
.button-full { width: 100%; margin-top: 24px; }
.auth-switch { margin: 25px 0 0; text-align: center; color: var(--muted); }
.alert { border-radius: 12px; padding: 13px 15px; margin: 0 0 18px; border: 1px solid; }
.alert-error { background: #fff1f0; color: var(--danger); border-color: #ffccc7; }
.alert-success { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 8px 28px rgba(30, 55, 75, .04); }
.metric-link { color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.metric-link:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(30, 55, 75, .1); }
.metric-card { border-top-width: 4px; }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card strong { display: block; margin: 12px 0 9px; font-size: 2.15rem; line-height: 1; }
.accent-blue { border-top-color: var(--blue); }
.accent-purple { border-top-color: var(--purple); }
.accent-green { border-top-color: var(--green); }
.accent-amber { border-top-color: var(--amber); }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.status-list { margin: 0; }
.status-list div { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #edf0f4; }
.status-list div:last-child { border-bottom: 0; }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; font-weight: 800; }

/* Administration shell */
.admin-body { background: #f4f7fb; }
.admin-frame { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, #071a2d 0%, #0b2944 58%, #081b2f 100%); color: #dce8f2; padding: 16px 12px 14px; display: flex; flex-direction: column; z-index: 30; box-shadow: 8px 0 30px rgba(7,26,45,.13); scrollbar-width: thin; scrollbar-color: #285270 transparent; transition: padding .2s ease; }
.admin-brand-row { display: flex; align-items: center; gap: 6px; min-height: 57px; padding: 0 1px 14px; border-bottom: 1px solid rgba(166,205,231,.13); }
.admin-brand { min-width: 0; flex: 1; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 2px; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
.admin-brand strong { font-size: 1.25rem; font-weight: 820; letter-spacing: -.025em; white-space: nowrap; }
.admin-brand strong span { color: #2bb8ed; }
.admin-brand small { margin-top: 5px; color: #91a9bd; font-size: .48rem; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; white-space: nowrap; }
.compact-brand-mark { width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid #22b8e8; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(27,187,232,.16), rgba(33,213,191,.04)); box-shadow: inset 0 0 16px rgba(35,196,235,.1); color: #42c9ef; font-size: 1.45rem; font-weight: 850; font-style: italic; }
.admin-brand-logo { display: block; width: auto; max-width: 174px; height: 43px; object-fit: contain; object-position: left center; transition: width .2s ease, height .2s ease; }
.sidebar-collapse { width: 27px; height: 32px; flex: 0 0 27px; border: 1px solid rgba(132,188,224,.18); border-radius: 8px; display: grid; place-items: center; background: rgba(30,76,110,.38); color: #afc6d8; font: 400 1.35rem/1 system-ui, sans-serif; cursor: pointer; transition: color .18s ease, background .18s ease, transform .2s ease; }
.sidebar-collapse:hover { color: #fff; background: rgba(37,111,157,.55); }
.admin-nav { display: grid; gap: 3px; margin-top: 14px; }
.admin-nav a, .nav-parent { position: relative; width: 100%; min-height: 44px; border: 1px solid transparent; padding: 7px 8px; border-radius: 10px; display: flex; align-items: center; gap: 9px; color: #b5c4d1; background: transparent; text-decoration: none; font: inherit; font-weight: 650; font-size: .88rem; text-align: left; cursor: pointer; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.admin-nav a:hover, .nav-parent:hover { border-color: rgba(117,178,216,.13); background: rgba(27,79,116,.33); color: #f4f9fc; }
.admin-nav .nav-direct.active, .nav-group.active > .nav-parent { border-color: rgba(35,192,229,.2); color: #fff; background: linear-gradient(90deg, rgba(11,111,164,.62), rgba(13,76,119,.45)); box-shadow: inset 3px 0 #28d5c1, 0 5px 16px rgba(2,20,36,.12); }
.nav-icon { width: 30px; height: 30px; min-width: 30px; border: 1px solid rgba(136,185,216,.16); border-radius: 8px; display: grid; place-items: center; color: #a9c4d8; background: rgba(17,58,88,.45); }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-nav a:hover .nav-icon, .nav-parent:hover .nav-icon { color: #e9f8ff; border-color: rgba(81,185,231,.3); }
.admin-nav .nav-direct.active .nav-icon, .nav-group.active > .nav-parent .nav-icon { border-color: rgba(37,213,203,.45); background: rgba(25,154,184,.22); color: #77e8df; }
.nav-chevron { margin-left: auto; color: #7895aa; font-size: 1.35rem; font-weight: 300; transition: transform .18s ease, color .18s ease; }
.nav-parent:hover .nav-chevron, .nav-group.active > .nav-parent .nav-chevron { color: #bfdae9; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 21px; margin-left: auto; padding: 2px 6px; border-radius: 7px; color: #fff; font-size: .67rem; font-weight: 800; line-height: 1; box-shadow: 0 3px 9px rgba(0,0,0,.16); }
.nav-parent .nav-count + .nav-chevron { margin-left: 0; }
.nav-item-label { min-width: 0; }
.nav-submenu .nav-count { flex: 0 0 auto; }
.nav-count-success { background: #1fae87; }
.nav-count-warning { background: #c38a2c; }
.nav-count-danger { background: #c4574a; }
.nav-group.open > .nav-parent .nav-chevron { transform: rotate(90deg); }
.nav-submenu { display: grid; gap: 1px; margin: 3px 0 8px 16px; padding: 5px; border: 1px solid rgba(83,144,184,.15); border-radius: 11px; background: rgba(8,35,57,.58); box-shadow: inset 0 1px 0 rgba(255,255,255,.025); }
.nav-submenu[hidden] { display: none; }
.nav-submenu a, .nav-submenu-item { min-height: 36px; padding: 6px 7px; border-radius: 7px; display: flex; align-items: center; gap: 8px; font-size: .76rem; font-weight: 570; color: #9fb3c3; }
.nav-submenu a:hover { border-color: transparent; background: rgba(37,93,132,.36); }
.nav-submenu a.active { border-color: rgba(31,199,205,.12); color: #fff; background: linear-gradient(90deg, rgba(15,123,165,.38), rgba(11,64,98,.2)); box-shadow: inset 2px 0 #28d5c1; }
.nav-submenu-item.nav-disabled { color: #5f788a; cursor: not-allowed; }
.submenu-icon { width: 19px; height: 19px; min-width: 19px; display: grid; place-items: center; color: #829db0; }
.submenu-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-submenu a:hover .submenu-icon, .nav-submenu a.active .submenu-icon { color: #bfeaf3; }
.nav-submenu-separator { height: 1px; margin: 5px -5px; background: rgba(146,190,217,.2); }
.nav-pending { padding: 7px; color: #668195; font-size: .71rem; font-style: italic; }
.admin-sidebar-foot { margin-top: auto; padding: 13px 8px 0; border-top: 1px solid rgba(154,196,221,.13); color: #7693a8; font-size: .67rem; }
.environment-dot { width: 7px; height: 7px; background: #34d2a0; border-radius: 50%; display: inline-block; margin-right: 7px; box-shadow: 0 0 0 3px rgba(52,210,160,.1); }
.sidebar-collapsed .admin-frame { grid-template-columns: 82px minmax(0, 1fr); }
.sidebar-collapsed .admin-sidebar { padding-right: 9px; padding-left: 9px; }
.sidebar-collapsed .admin-brand-row { gap: 3px; }
.sidebar-collapsed .admin-brand { flex: 0 0 auto; }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .nav-direct > span:last-child, .sidebar-collapsed .nav-parent > span:not(.nav-icon), .sidebar-collapsed .admin-sidebar-foot { display: none; }
.sidebar-collapsed .compact-brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
.sidebar-collapsed .admin-brand-logo { width: 38px; max-width: 38px; height: 38px; object-fit: contain; }
.sidebar-collapsed .sidebar-collapse { width: 21px; flex-basis: 21px; transform: rotate(180deg); }
.sidebar-collapsed .admin-nav a, .sidebar-collapsed .nav-parent { justify-content: center; padding-right: 5px; padding-left: 5px; }
.sidebar-collapsed .nav-submenu { display: none !important; }
.admin-main { min-width: 0; }
.admin-topbar { height: 66px; padding: 0 clamp(20px, 3vw, 42px); background: rgba(255,255,255,.96); border-bottom: 1px solid #e5ebf1; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 20; box-shadow: 0 5px 18px rgba(24,52,78,.035); backdrop-filter: blur(12px); }
.topbar-title { font-size: .84rem; color: var(--muted); font-weight: 750; }
.admin-topbar .header-actions { margin-left: auto; }
.account-menu { position: relative; }
.account-menu summary { min-height: 44px; padding: 4px 9px 4px 5px; border: 1px solid transparent; border-radius: 12px; display: flex; align-items: center; gap: 9px; color: var(--ink); cursor: pointer; list-style: none; user-select: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { border-color: #d6e0e9; background: #f6f9fb; }
.account-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-size: .86rem; font-weight: 850; }
.account-chevron { color: var(--muted); font-size: .9rem; transition: transform .18s ease; }
.account-menu[open] .account-chevron { transform: rotate(180deg); }
.account-dropdown { position: absolute; top: calc(100% + 9px); right: 0; width: min(280px, calc(100vw - 28px)); padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(22,33,50,.16); z-index: 40; }
.account-dropdown-header { padding: 9px 10px 12px; border-bottom: 1px solid #edf0f4; margin-bottom: 5px; }
.account-dropdown-header strong, .account-dropdown-header span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown-header strong { font-size: .9rem; }
.account-dropdown-header span { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.account-dropdown a, .account-signout { width: 100%; min-height: 40px; padding: 9px 10px; border: 0; border-radius: 8px; display: flex; align-items: center; gap: 10px; background: transparent; color: #354459; text-decoration: none; font: inherit; font-size: .84rem; font-weight: 650; text-align: left; cursor: pointer; }
.account-dropdown a > span, .account-signout > span { width: 18px; color: #748294; text-align: center; }
.account-dropdown a:hover, .account-dropdown a.active, .account-signout:hover { background: #edf4f9; color: var(--navy); }
.account-dropdown form { margin: 5px 0 0; padding-top: 5px; border-top: 1px solid #edf0f4; }
.account-signout { color: var(--danger); }
.menu-toggle { display: none; border: 0; background: #eaf1f7; color: var(--navy); width: 42px; height: 42px; border-radius: 10px; font-size: 1.3rem; }
.admin-content { width: min(1500px, 100%); padding: clamp(26px, 4vw, 52px); margin: 0 auto; }
.compact-heading { align-items: center; margin-bottom: 24px; }
.compact-heading h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.compact-heading p { margin-bottom: 0; }
.read-only-pill { background: #fff7e8; color: #915b09; border: 1px solid #f2d49f; border-radius: 999px; padding: 8px 13px; font-weight: 750; font-size: .8rem; }
.connected-pill { background: #e8f8f1; color: #08724f; border: 1px solid #abe2cb; border-radius: 999px; padding: 8px 13px; font-weight: 750; font-size: .8rem; white-space: nowrap; }
.sidebar-scrim { display: none; }

/* Graphical administration dashboard */
.dashboard-page { --dash-blue: #2f8bea; --dash-purple: #805ad5; --dash-green: #18a978; --dash-amber: #ef9418; }
.dashboard-page-heading { align-items: flex-start; margin-bottom: 24px; }
.dashboard-page-heading h1 { margin-bottom: 8px; }
.dashboard-page-heading .muted { margin: 0; }
.dashboard-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.dashboard-range { min-height: 44px; padding: 3px 4px 3px 12px; border: 1px solid #d8e3ec; border-radius: 12px; display: flex; align-items: center; gap: 7px; background: #fff; box-shadow: 0 4px 16px rgba(23,54,80,.04); }
.dashboard-control-icon { color: var(--blue); font-size: .9rem; }
.dashboard-range select { width: auto; min-height: 34px; border: 0; border-radius: 8px; padding: 4px 26px 4px 2px; background-color: transparent; color: var(--navy); font-size: .79rem; font-weight: 750; }
.dashboard-range select:focus { outline: 2px solid rgba(45,131,197,.16); }
.dashboard-range button { min-height: 33px; border: 0; border-radius: 8px; padding: 6px 10px; background: #eaf3fa; color: var(--navy); font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer; }
.dashboard-range button:hover { background: #dcecf7; }
.dashboard-refresh { width: 44px; height: 44px; border: 1px solid #d8e3ec; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--blue); text-decoration: none; font-size: 1.45rem; line-height: 1; box-shadow: 0 4px 16px rgba(23,54,80,.04); transition: transform .18s ease, box-shadow .18s ease; }
.dashboard-refresh:hover { transform: rotate(35deg); box-shadow: 0 8px 22px rgba(23,54,80,.1); }
.dashboard-heading-actions .role-pill { min-height: 42px; display: inline-flex; align-items: center; }

.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.dashboard-kpi { --kpi-color: var(--dash-blue); --kpi-soft: #eaf5ff; position: relative; min-width: 0; min-height: 174px; padding: 20px 19px 66px; border: 1px solid #dce6ee; border-top: 3px solid var(--kpi-color); border-radius: 16px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 13px; align-items: start; overflow: hidden; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 9px 28px rgba(23,54,80,.045); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.dashboard-kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--kpi-color) 30%, #dce6ee); box-shadow: 0 15px 34px rgba(23,54,80,.1); }
.dashboard-kpi-purple { --kpi-color: var(--dash-purple); --kpi-soft: #f1ecff; }
.dashboard-kpi-green { --kpi-color: var(--dash-green); --kpi-soft: #e8f8f2; }
.dashboard-kpi-amber { --kpi-color: var(--dash-amber); --kpi-soft: #fff3df; }
.dashboard-kpi-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--kpi-soft); color: var(--kpi-color); }
.dashboard-kpi-icon svg, .dashboard-card-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-kpi-copy { min-width: 0; }
.dashboard-kpi-label { display: block; color: #627186; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-kpi-copy strong { display: block; margin: 8px 0 5px; color: #0e1f36; font-size: clamp(1.8rem, 2.2vw, 2.18rem); line-height: 1; letter-spacing: -.035em; }
.dashboard-kpi-copy small { display: block; color: #6c7c91; font-size: .72rem; line-height: 1.35; }
.dashboard-trend { min-width: 64px; display: grid; justify-items: end; color: #6b7b8f; text-align: right; }
.dashboard-trend b { color: #0e9d70; font-size: .76rem; white-space: nowrap; }
.dashboard-trend small { max-width: 74px; margin-top: 5px; font-size: .58rem; line-height: 1.25; }
.dashboard-trend-down b { color: #c45144; }
.dashboard-trend-flat b { color: #6f7d8d; }
.dashboard-sparkline { position: absolute; right: 10px; bottom: 4px; left: 10px; width: calc(100% - 20px); height: 60px; color: var(--kpi-color); pointer-events: none; }
.dashboard-avatar-stack { position: absolute; left: 83px; bottom: 15px; display: flex; align-items: center; }
.dashboard-avatar-stack i { width: 31px; height: 31px; margin-left: -7px; border: 3px solid #fff; border-radius: 50%; display: grid; place-items: center; background: #5a9bec; color: #fff; font-size: .63rem; font-style: normal; font-weight: 800; box-shadow: 0 3px 8px rgba(22,54,80,.08); }
.dashboard-avatar-stack i:first-child { margin-left: 0; }
.dashboard-avatar-stack i:nth-child(2) { background: #8d72db; }
.dashboard-avatar-stack i:nth-child(3) { background: #4ebf9b; }
.dashboard-avatar-stack i:nth-child(4) { width: auto; min-width: 31px; padding: 0 7px; border-radius: 16px; background: #edf2f7; color: #58687b; }
.dashboard-mini-donut { --donut-value: 0%; position: absolute; right: 18px; bottom: 17px; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--dash-amber) var(--donut-value), #edf1f5 0); isolation: isolate; }
.dashboard-mini-donut::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; z-index: -1; }
.dashboard-mini-donut b, .dashboard-mini-donut small { display: block; text-align: center; line-height: 1; }
.dashboard-mini-donut b { color: #14243a; font-size: .88rem; }
.dashboard-mini-donut small { margin-top: 3px; color: #7b8798; font-size: .52rem; }

.dashboard-analytics-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.dashboard-card { min-width: 0; padding: 20px; border: 1px solid #dce6ee; border-radius: 16px; background: #fff; box-shadow: 0 9px 28px rgba(23,54,80,.045); }
.dashboard-activity-card { grid-column: span 9; }
.dashboard-status-card { grid-column: span 3; }
.dashboard-mix-card { grid-column: span 4; }
.dashboard-quote-card { grid-column: span 5; }
.dashboard-invoice-card { grid-column: span 3; }
.dashboard-card-heading { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.dashboard-card-heading > div:first-child { min-width: 0; display: flex; align-items: center; gap: 10px; }
.dashboard-card-heading h2 { margin: 0; color: #10223a; font-size: .96rem; }
.dashboard-card-heading p { margin: 4px 0 0; color: #7a8798; font-size: .67rem; }
.dashboard-card-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; color: var(--dash-blue); }
.dashboard-card-icon svg { width: 22px; height: 22px; }
.dashboard-card-meta { display: flex; align-items: center; justify-content: flex-end; gap: 12px; color: #68788d; font-size: .66rem; white-space: nowrap; }
.dashboard-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.dashboard-card-meta b { padding: 7px 9px; border: 1px solid #dce5ed; border-radius: 8px; color: #506278; background: #f9fbfd; font-size: .63rem; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 8px; }
.legend-blue { background: var(--dash-blue); }
.legend-purple { background: var(--dash-purple); }
.legend-green { background: var(--dash-green); }
.legend-amber { background: var(--dash-amber); }
.legend-gray { background: #a7b3c2; }
.dashboard-line-chart { position: relative; min-height: 250px; margin: 8px -4px -7px; }
.dashboard-line-chart svg { display: block; width: 100%; height: 250px; overflow: visible; }
.dashboard-chart-gridline { stroke: #e9eef3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.dashboard-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dashboard-chart-line-blue { stroke: var(--dash-blue); }
.dashboard-chart-line-purple { stroke: var(--dash-purple); }
.dashboard-chart-label { fill: #7a8797; font-size: 10px; }
.dashboard-chart-empty { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: #778699; font-size: .78rem; text-align: center; }

.dashboard-status-content { min-height: 250px; padding-top: 17px; display: grid; align-content: center; justify-items: center; gap: 19px; }
.dashboard-status-donut { position: relative; width: 142px; height: 142px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--dash-green) 0 var(--completed-end), var(--dash-blue) var(--completed-end) var(--processing-end), var(--dash-amber) var(--processing-end) var(--new-end), #e7edf2 var(--new-end) 360deg); box-shadow: 0 7px 20px rgba(21,59,99,.08); }
.dashboard-status-donut::after { content: ""; position: absolute; inset: 17px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px #eef2f6; }
.dashboard-status-donut > div { position: relative; z-index: 1; text-align: center; }
.dashboard-status-donut strong, .dashboard-status-donut span { display: block; }
.dashboard-status-donut strong { color: #0e1f36; font-size: 1.25rem; }
.dashboard-status-donut span { margin-top: 4px; color: #788699; font-size: .65rem; }
.dashboard-status-legend { width: 100%; margin: 0; display: grid; gap: 7px; }
.dashboard-status-legend div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dashboard-status-legend dt { display: inline-flex; align-items: center; gap: 7px; color: #6b7a8d; font-size: .68rem; }
.dashboard-status-legend dd { margin: 0; color: #14243a; font-size: .72rem; font-weight: 850; }

.dashboard-progress-list { display: grid; gap: 17px; margin-top: 24px; }
.dashboard-progress-list > div > span { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #68798e; font-size: .74rem; }
.dashboard-progress-list b { font-weight: 650; }
.dashboard-progress-list strong { color: #16263b; font-size: .8rem; }
.dashboard-progress-list > div > i { height: 12px; border-radius: 999px; display: block; overflow: hidden; background: #e9eef3; }
.dashboard-progress-list em { display: block; min-width: 3px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2384ea, #65b4f5); }
.dashboard-progress-list .purple em { background: linear-gradient(90deg, #724fd3, #a78aec); }

.dashboard-quote-body { min-height: 132px; margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) 95px; gap: 17px; align-items: stretch; }
.dashboard-quote-bars { min-width: 0; height: 132px; padding: 8px 5px 0; border-bottom: 1px solid #dfe6ed; display: flex; align-items: flex-end; justify-content: space-around; gap: 4px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, #edf1f5 32px); }
.dashboard-quote-bars > span { min-width: 4px; height: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.dashboard-quote-bars i { width: min(7px, 42%); min-height: 3px; border-radius: 3px 3px 0 0; display: block; background: linear-gradient(180deg, #5fb1f4, #2f8bea); }
.dashboard-quote-bars i + i { background: linear-gradient(180deg, #a589ec, #805ad5); }
.dashboard-quote-totals { margin: 0; display: grid; align-content: center; gap: 16px; }
.dashboard-quote-totals div { padding-bottom: 12px; border-bottom: 1px solid #edf1f4; }
.dashboard-quote-totals div:last-child { border-bottom: 0; padding-bottom: 0; }
.dashboard-quote-totals dt { display: flex; align-items: center; gap: 7px; color: #6b7b8f; font-size: .66rem; }
.dashboard-quote-totals dd { margin: 6px 0 0 15px; color: #10223a; font-size: 1.14rem; font-weight: 850; }

.dashboard-invoice-card { text-align: center; }
.dashboard-invoice-card .dashboard-card-heading { text-align: left; }
.dashboard-gauge { position: relative; width: 160px; height: 94px; margin: 13px auto 0; }
.dashboard-gauge svg { width: 160px; height: 94px; overflow: visible; }
.dashboard-gauge path { fill: none; stroke-width: 13; stroke-linecap: round; }
.dashboard-gauge-track { stroke: #e7edf2; }
.dashboard-gauge-value { stroke: var(--dash-amber); }
.dashboard-gauge > div { position: absolute; right: 0; bottom: 7px; left: 0; }
.dashboard-gauge strong, .dashboard-gauge span { display: block; }
.dashboard-gauge strong { color: #10223a; font-size: 1.3rem; line-height: 1; }
.dashboard-gauge span { margin-top: 5px; color: #718096; font-size: .66rem; }
.dashboard-invoice-amount { margin: 5px 0 0; color: #718096; font-size: .68rem; }
.dashboard-invoice-amount strong { color: #25364c; }
.dashboard-invoice-foot { margin: 15px 0 0; padding-top: 12px; border-top: 1px solid #edf1f4; display: flex; justify-content: space-between; gap: 12px; color: #6d7b8e; font-size: .62rem; }

@media (max-width: 1260px) {
    .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-activity-card { grid-column: span 8; }
    .dashboard-status-card { grid-column: span 4; }
    .dashboard-mix-card, .dashboard-invoice-card { grid-column: span 4; }
    .dashboard-quote-card { grid-column: span 8; }
}

@media (max-width: 980px) {
    .dashboard-activity-card, .dashboard-status-card, .dashboard-mix-card, .dashboard-quote-card, .dashboard-invoice-card { grid-column: 1 / -1; }
    .dashboard-status-content { min-height: 0; grid-template-columns: auto minmax(160px, 260px); justify-content: center; }
    .dashboard-card-meta { flex-wrap: wrap; }
}

@media (max-width: 700px) {
    .dashboard-page-heading { flex-direction: column; }
    .dashboard-heading-actions { width: 100%; justify-content: flex-start; }
    .dashboard-kpi-grid { grid-template-columns: 1fr; }
    .dashboard-card-heading { flex-direction: column; }
    .dashboard-card-meta { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .dashboard-range { width: 100%; }
    .dashboard-range select { min-width: 0; flex: 1; }
    .dashboard-heading-actions .role-pill { display: none; }
    .dashboard-kpi { grid-template-columns: 46px minmax(0, 1fr); padding-right: 15px; }
    .dashboard-kpi-icon { width: 46px; height: 46px; }
    .dashboard-trend { position: absolute; top: 20px; right: 15px; }
    .dashboard-quote-body { grid-template-columns: 1fr; }
    .dashboard-quote-totals { grid-template-columns: 1fr 1fr; }
    .dashboard-status-content { grid-template-columns: 1fr; }
}

/* Digitizing workspace */
.workspace-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.workspace-summary article { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.workspace-summary span, .workspace-summary small { display: block; color: var(--muted); }
.workspace-summary strong { display: block; font-size: 1.75rem; margin: 8px 0 5px; }
.workspace-tabs { display: flex; gap: 6px; margin-bottom: -1px; position: relative; z-index: 1; padding-left: 14px; }
.workspace-tabs a { color: var(--muted); font-weight: 750; text-decoration: none; padding: 13px 18px; border-radius: 11px 11px 0 0; }
.workspace-tabs a span { margin-left: 6px; font-size: .75rem; background: #e9eef4; border-radius: 999px; padding: 3px 7px; }
.workspace-tabs a.active { color: var(--navy); background: #fff; border: 1px solid var(--line); border-bottom-color: #fff; }
.data-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 8px 28px rgba(30,55,75,.035); }
.filter-bar { display: grid; grid-template-columns: minmax(250px, 1.8fr) minmax(145px, .8fr) minmax(145px, .8fr) minmax(145px, .8fr) auto; gap: 12px; align-items: end; padding-bottom: 20px; border-bottom: 1px solid #edf0f4; }
.filter-bar label { margin: 0; }
.filter-bar label > span, .per-page span { display: block; font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; margin-bottom: 6px; }
.filter-bar input, .filter-bar select { min-height: 42px; }
.filter-actions { display: flex; gap: 7px; }
.filter-actions .button { display: inline-grid; place-items: center; text-decoration: none; white-space: nowrap; }
.table-meta { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 10px; color: var(--muted); font-size: .86rem; }
.table-meta p { margin: 0; }
.per-page { margin: 0; display: flex; align-items: center; gap: 8px; }
.per-page span { margin: 0; }
.per-page select { min-height: 36px; padding: 5px 28px 5px 9px; width: auto; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.data-table th { text-align: left; color: #66768a; font-size: .69rem; text-transform: uppercase; letter-spacing: .07em; padding: 12px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 14px 11px; border-bottom: 1px solid #edf0f4; vertical-align: middle; font-size: .87rem; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table td small { display: block; color: var(--muted); margin-top: 4px; }
.pending-orders-table { border-collapse: separate; border-spacing: 0 8px; }
.pending-orders-table th { padding-top: 8px; padding-bottom: 8px; border-bottom: 0; }
.pending-orders-table th:nth-child(6) { text-align: center; }
.pending-orders-table tbody td { background: #fff; border-top: 1px solid #e4eaf0; border-bottom: 1px solid #e4eaf0; transition: background .16s ease, border-color .16s ease; }
.pending-orders-table tbody td:first-child { border-left: 1px solid #e4eaf0; border-radius: 11px 0 0 11px; box-shadow: inset 3px 0 #d7e1e9; }
.pending-orders-table tbody td:last-child { border-right: 1px solid #e4eaf0; border-radius: 0 11px 11px 0; }
.pending-orders-table tbody tr:hover > td { background: #f8fafc; border-color: #d7e1e9; }
.pending-orders-table .pending-row-processing > td { background: #f0faf6; color: #19392f; border-color: #cfe9dd; }
.pending-orders-table .pending-row-processing > td:first-child { border-left-color: #cfe9dd; box-shadow: inset 4px 0 #1ca477; }
.pending-orders-table .pending-row-processing > td:last-child { border-right-color: #cfe9dd; }
.pending-orders-table .pending-row-processing:hover > td { background: #e8f7f0; border-color: #bde0d0; }
.pending-orders-table .pending-row-processing .order-link { color: #08724f; }
.pending-orders-table .pending-row-processing td small { color: #597268; }
.pending-orders-table .pending-row-processing .status-badge { background: #d9f2e6; color: #067647; box-shadow: inset 0 0 0 1px #b8e2ce; }
.pending-orders-table .pending-time-cell { min-width: 118px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pending-time-value { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 88px; min-height: 30px; padding: 5px 10px; border-radius: 999px; background: #eef3f7; color: #4d6072; box-shadow: inset 0 0 0 1px #dce5eb; font-size: .78rem; font-weight: 850; letter-spacing: .01em; }
.pending-time-value::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.pending-time-cell.pending-time-active .pending-time-value { background: #e3f6ed; color: #067647; box-shadow: inset 0 0 0 1px #bde4d1; }
.pending-time-cell.pending-time-overdue .pending-time-value { background: #fff0ef; color: #b42318; box-shadow: inset 0 0 0 1px #f1c3bf; }
.pending-orders-table .row-action { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 5px 10px; border: 1px solid #cbdce8; border-radius: 8px; background: #f7fbfe; }
.pending-orders-table .row-action:hover { border-color: #8bbad7; background: #edf7fc; }
.pending-orders-table .pending-row-processing .row-action { border-color: #acd8c5; background: rgba(255,255,255,.72); color: #08724f; }
.vector-pending-table { border-collapse: separate; border-spacing: 0 7px; }
.vector-pending-table th { padding-top: 8px; padding-bottom: 8px; border-bottom: 0; }
.vector-pending-table tbody td { background: #eef8ff; border-top: 1px solid #cfe4f2; border-bottom: 1px solid #cfe4f2; transition: background .16s ease, border-color .16s ease; }
.vector-pending-table tbody td:first-child { border-left: 1px solid #cfe4f2; border-radius: 10px 0 0 10px; box-shadow: inset 3px 0 #3d91cf; }
.vector-pending-table tbody td:last-child { border-right: 1px solid #cfe4f2; border-radius: 0 10px 10px 0; }
.vector-pending-table tbody tr:hover > td { background: #e2f3fd; border-color: #a9d2e9; }
.vector-pending-table.pending-orders-table .pending-row-processing > td { background: #f0faf6; border-color: #cfe9dd; }
.vector-pending-table.pending-orders-table .pending-row-processing > td:first-child { border-left-color: #cfe9dd; box-shadow: inset 4px 0 #1ca477; }
.vector-pending-table.pending-orders-table .pending-row-processing > td:last-child { border-right-color: #cfe9dd; }
.vector-pending-table.pending-orders-table .pending-row-processing:hover > td { background: #e8f7f0; border-color: #bde0d0; }
.quote-workflow-table { min-width: 1100px; border-collapse: separate; border-spacing: 0 7px; }
.quote-workflow-table th { padding-top: 8px; padding-bottom: 8px; border-bottom: 0; }
.quote-workflow-table tbody td { background: #eef8ff; border-top: 1px solid #cfe4f2; border-bottom: 1px solid #cfe4f2; transition: background .16s ease, border-color .16s ease; }
.quote-workflow-table tbody td:first-child { border-left: 1px solid #cfe4f2; border-radius: 10px 0 0 10px; box-shadow: inset 3px 0 #3d91cf; }
.quote-workflow-table tbody td:last-child { min-width: 250px; border-right: 1px solid #cfe4f2; border-radius: 0 10px 10px 0; }
.quote-workflow-table tbody tr:hover > td { background: #e2f3fd; border-color: #a9d2e9; }
.quote-workflow-table .quote-email-cell { max-width: 260px; color: #53677c; overflow-wrap: anywhere; }
.quote-workflow-table .status-sent { background: #e2f6ed; color: #067647; box-shadow: inset 0 0 0 1px #bde4d1; }
.quote-row-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.quote-row-actions form { margin: 0; }
.quote-action { min-height: 30px; padding: 5px 9px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font: inherit; font-size: .72rem; font-weight: 800; line-height: 1; text-decoration: none; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.quote-action:hover { transform: translateY(-1px); }
.quote-action span { font-size: .88rem; line-height: 1; }
.quote-action-update { border-color: #c9d9e5; background: #f5f9fc; color: #31536c; }
.quote-action-update:hover { border-color: #9bbbd0; background: #eaf3f9; }
.quote-action-proceed { border-color: #9ed8c2; background: #e8f8f1; color: #067647; }
.quote-action-proceed:hover { border-color: #70c5a5; background: #d9f3e7; }
.quote-action-delete { border-color: #efc4c0; background: #fff2f1; color: #b42318; }
.quote-action-delete:hover { border-color: #e49c96; background: #ffe6e3; }
.data-table .numeric { text-align: right; }
.order-link, .row-action { color: #1769a5; font-weight: 750; text-decoration: none; white-space: nowrap; }
.row-action { font-size: .8rem; }
.downloads-table { min-width: 880px; }
.download-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 230px; }
.download-action { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 6px 10px; border: 1px solid #bdd6e8; border-radius: 7px; background: #eef7fc; color: #1769a5; font-size: .73rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.download-action:hover { border-color: #7bb3d8; background: #dfeff9; }
.download-empty { font-size: .78rem; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: 4px 9px; background: #eef2f6; color: #536274; font-size: .73rem; font-weight: 800; white-space: nowrap; }
.status-new { background: #e8f3ff; color: #1769a5; }
.status-processing, .status-proceeded { background: #fff3dd; color: #915b09; }
.status-completed, .status-sent, .status-paid { background: #e8f8f1; color: #08724f; }
.empty-state { text-align: center; padding: 54px 20px !important; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--ink); margin-bottom: 7px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 2px 0; font-size: .83rem; }
.pagination a { text-decoration: none; font-weight: 750; }
.pagination a.disabled { opacity: .35; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.detail-breadcrumb { margin-bottom: 24px; }
.detail-breadcrumb a { text-decoration: none; font-weight: 700; font-size: .86rem; }
.detail-heading { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 22px; }
.detail-card h2 { padding-bottom: 14px; border-bottom: 1px solid #edf0f4; }
.detail-card dl { margin: 0; }
.detail-card dl div { display: grid; grid-template-columns: minmax(110px, .65fr) 1fr; gap: 18px; padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.detail-card dl div:last-child { border: 0; }
.detail-card dt { color: var(--muted); }
.detail-card dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.notes-card { margin-top: 18px; }
.notes-card p { white-space: normal; line-height: 1.65; }
.read-only-notice { margin-top: 18px; padding: 16px 18px; border: 1px solid #f0d39a; background: #fff9ec; border-radius: 12px; display: flex; gap: 10px 18px; color: #774d0a; }
.read-only-notice span { color: #8c681e; }

/* Digitizing write workflows */
.compact-filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 10px; align-items: end; padding-bottom: 18px; border-bottom: 1px solid #edf0f4; }
.compact-filter-bar label { margin: 0; }
.compact-filter-bar label > span { display: block; font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; margin-bottom: 6px; }
.compact-filter-bar .button { min-height: 48px; display: inline-grid; place-items: center; text-decoration: none; }
.inline-notice { margin-top: 18px; padding: 15px 17px; border: 1px solid #c8ddeb; background: #eef7fc; border-radius: 12px; display: flex; gap: 9px 16px; color: var(--navy); }
.inline-notice span { color: #526c82; }
.inline-notice-warning { border-color: #f0d39a; background: #fff9ec; color: #774d0a; }
.inline-notice-warning span { color: #8c681e; }
.record-form { display: block; }
.form-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 3vw, 30px); box-shadow: 0 8px 28px rgba(30,55,75,.035); }
.form-card-wide { margin-bottom: 20px; }
.form-card h2 { margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid #edf0f4; }
.form-card label { margin: 15px 0 0; }
.form-card label > span { display: block; margin-bottom: 7px; }
.form-card label b { color: var(--danger); }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .35fr); gap: 12px; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.5; overflow-wrap: anywhere; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid #edf0f4; }
.form-actions .button { display: inline-grid; place-items: center; text-decoration: none; }
.request-context { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.request-context div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.request-context span, .request-context strong { display: block; }
.request-context span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px; }
.request-context strong { overflow-wrap: anywhere; }
.completion-panel { margin-top: 20px; border: 1px solid #f0d39a; background: #fff9ec; border-radius: 15px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.completion-panel h2 { margin: 0 0 6px; }
.completion-panel p { margin: 0; color: #8c681e; }
.quote-context div { border-top: 3px solid #d9e8f2; }
.quote-context div:first-child { border-top-color: var(--blue); }
.quote-response-card { border-top: 3px solid #2d83c5; }
.quote-email-option { padding: 14px 15px; border: 1px solid #cbdde9; border-radius: 12px; display: flex; align-items: flex-start; gap: 11px; background: #f6fbfe; cursor: pointer; }
.quote-email-option input { width: 18px; min-height: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; accent-color: var(--blue); }
.form-card .quote-email-option > span { margin: 0; }
.quote-email-option strong, .quote-email-option small { display: block; }
.quote-email-option strong { color: #173a58; font-size: .86rem; }
.quote-email-option small { margin-top: 4px; color: var(--muted); font-size: .73rem; font-weight: 500; line-height: 1.4; }
.quote-status-note { margin-top: 14px; padding: 13px 14px; border: 1px solid #bde4d1; border-radius: 12px; display: flex; align-items: center; gap: 10px; background: #edf9f3; color: #067647; }
.quote-status-note > span { width: 27px; height: 27px; flex: 0 0 27px; border-radius: 50%; display: grid; place-items: center; background: #d6f2e4; font-weight: 900; }
.quote-status-note strong, .quote-status-note small { display: block; }
.quote-status-note small { margin-top: 3px; color: #477264; font-size: .73rem; }
.quote-proceed-panel { border-color: #bde4d1; background: #edf9f3; }
.quote-proceed-panel p { color: #477264; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }

/* Reports, users, and master edit */
.heading-action { display: inline-grid; place-items: center; text-decoration: none; white-space: nowrap; }
.status-disabled { background: #fff1f0; color: var(--danger); }
.report-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(460px, 1.7fr); gap: 20px; align-items: start; }
.report-filter-card h2, .report-chart-card h2 { margin-bottom: 7px; }
.report-filter-actions { justify-content: flex-start; }
.report-total { margin-top: 22px; padding: 20px; border-radius: 14px; background: #eef7fc; border: 1px solid #c8ddeb; }
.report-total span, .report-total strong { display: block; }
.report-total span { color: var(--muted); font-size: .82rem; }
.report-total strong { margin-top: 9px; color: var(--navy); font-size: 2.45rem; line-height: 1; }
.report-chart-heading { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid #edf0f4; }
.report-chart-heading p { margin: 0; }
.report-bars { display: grid; gap: 12px; padding-top: 20px; }
.report-bar-row { display: grid; grid-template-columns: 78px minmax(120px, 1fr) 48px; gap: 12px; align-items: center; }
.report-bar-label { color: var(--muted); font-size: .8rem; }
.report-bar-track { height: 15px; background: #e8eef4; border-radius: 999px; overflow: hidden; }
.report-bar-track i { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #55aae3); }
.report-bar-row strong { text-align: right; font-size: .84rem; }
.users-filter-bar { grid-template-columns: minmax(280px, 1.6fr) minmax(145px, .65fr) minmax(145px, .65fr) auto; }
.users-table { min-width: 1120px; }
.user-add-card { max-width: 900px; }
.user-security-grid { margin-top: 22px; }
.account-status-card form { margin-top: 24px; }
.account-settings { width: min(900px, 100%); margin: 0 auto; }
.account-tabs { display: flex; gap: 7px; margin-bottom: 20px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #eaf0f5; }
.account-tabs a { flex: 1; min-height: 42px; padding: 9px 14px; border-radius: 8px; display: grid; place-items: center; color: #5f6d7e; font-size: .86rem; font-weight: 750; text-align: center; text-decoration: none; }
.account-tabs a:hover { color: var(--navy); }
.account-tabs a.active { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(22,33,50,.08); }
.account-settings-card { max-width: 760px; margin: 0 auto; }
.password-settings-card { max-width: 660px; }
.account-card-heading { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid #edf0f4; }
.account-card-heading h2 { margin: 0 0 5px; padding: 0; border: 0; }
.account-card-heading p { margin: 0; }
.account-card-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px; display: grid; place-items: center; background: #e8f3fb; color: var(--navy); font-size: 1.25rem; font-weight: 800; }
.branding-settings { width: min(980px, 100%); }
.branding-form { display: grid; gap: 20px; }
.branding-title-card { max-width: none; }
.branding-asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.branding-asset-card { min-width: 0; }
.branding-preview { min-height: 124px; margin-top: 22px; padding: 16px; border: 1px dashed #bdcbd8; border-radius: 14px; display: grid; place-items: center; background: #f8fafc; overflow: hidden; }
.branding-preview img { display: block; max-width: 100%; max-height: 92px; object-fit: contain; }
.branding-preview img[hidden], .branding-preview-fallback[hidden] { display: none; }
.branding-preview-fallback { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-size: 1.65rem; font-weight: 850; }
.branding-favicon-preview .branding-preview-fallback, .branding-favicon-preview img { width: 64px; height: 64px; object-fit: contain; }
.branding-asset-card input[type="file"] { min-height: 46px; padding: 8px; background: #f8fafc; }
.branding-asset-card input[type="file"]::file-selector-button { min-height: 30px; margin-right: 10px; border: 0; border-radius: 7px; padding: 6px 10px; background: #e7f1f8; color: var(--navy); font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.branding-remove { margin-top: 16px !important; padding: 11px 12px; border: 1px solid #f0d39a; border-radius: 10px; display: flex !important; align-items: flex-start; gap: 9px; background: #fff9ec; color: #774d0a; font-size: .8rem !important; font-weight: 650 !important; }
.branding-remove input { width: 17px; min-height: 17px; height: 17px; margin: 1px 0 0; flex: 0 0 17px; }
.branding-remove span { margin: 0 !important; }
.branding-browser-preview { width: min(480px, 100%); min-height: 48px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 12px 12px 4px 4px; display: flex; align-items: center; gap: 10px; background: #e9edf2; color: #354459; box-shadow: 0 5px 16px rgba(22,33,50,.07); }
.branding-browser-preview strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.branding-tab-favicon { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; color: var(--blue); font-size: .72rem; }
.branding-tab-favicon img { display: block; width: 20px; height: 20px; object-fit: contain; }
.branding-tab-close { color: #718096; font-size: 1.1rem; }
.branding-form-actions { margin-top: 0; }
.master-orders-table { min-width: 860px; }
.master-edit-card { max-width: 900px; }
.danger-zone { margin-top: 22px; border-color: #f0b7b3; background: #fffafa; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.danger-zone h2 { margin-bottom: 7px; padding: 0; border: 0; }
.danger-zone p { margin: 0; max-width: 720px; }
.danger-zone form { flex: 0 0 auto; }

/* Accounts and work activities */
.account-entry-layout { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.35fr); gap: 20px; align-items: start; }
.account-entry-card { min-width: 0; }
.account-side-stack { display: grid; gap: 20px; min-width: 0; }
.cash-handler-card form .form-actions { justify-content: flex-start; }
.handler-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; padding-top: 17px; border-top: 1px solid #edf0f4; }
.handler-pills span { border: 1px solid #c8ddeb; border-radius: 999px; background: #eef7fc; color: var(--navy); padding: 5px 10px; font-size: .76rem; font-weight: 750; }
.account-chart-card .report-chart-heading strong { align-self: center; color: var(--navy); font-size: 1.35rem; white-space: nowrap; }
.account-month-bars { height: 190px; display: grid; grid-template-columns: repeat(12, minmax(18px, 1fr)); align-items: end; gap: 8px; margin-top: 20px; padding-top: 14px; border-bottom: 1px solid var(--line); }
.account-month-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 7px; text-align: center; }
.account-month-bar i { display: block; min-height: 2px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #55aae3, var(--blue)); }
.account-month-bar span { color: var(--muted); font-size: .65rem; padding-bottom: 5px; }
.account-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-filter-bar, .work-filter-bar { grid-template-columns: minmax(240px, 1.4fr) minmax(145px, .7fr) minmax(145px, .65fr) minmax(145px, .65fr) auto; }
.table-tools { display: flex; align-items: center; gap: 10px; }
.print-button { min-height: 36px; padding: 6px 12px; }
.account-ledger-table { min-width: 940px; }
.description-cell { max-width: 320px; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
.row-actions, .work-actions { display: flex; align-items: center; gap: 9px; }
.row-actions form, .work-actions form { margin: 0; }
.link-button { border: 0; padding: 0; background: transparent; color: #1769a5; font: inherit; font-size: .8rem; font-weight: 750; cursor: pointer; }
.link-button-danger { color: var(--danger); }
.account-edit-card { max-width: 900px; }
.work-start-grid { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(150px, .7fr) minmax(200px, 1fr) minmax(240px, 1.3fr); gap: 14px; }
.work-start-grid label { margin-top: 0; }
.work-active-panel { margin-top: 20px; }
.panel-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid #edf0f4; }
.panel-heading-row h2 { margin-bottom: 6px; }
.panel-heading-row p { margin: 0; }
.work-active-table { min-width: 1260px; }
.overall-work-table { min-width: 1420px; }
.work-row-running { background: #f2fbf7; }
.work-row-paused { background: #fff9ec; }
.work-timer { color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: .04em; white-space: nowrap; }
.work-actions { min-width: 260px; flex-wrap: wrap; }
.button-small { min-height: 32px; padding: 5px 9px; border-radius: 7px; font-size: .73rem; }

/* Customer portal */
.customer-body { background: #f2f6fa; }
.customer-sidebar { background: linear-gradient(180deg, #06182b 0%, #0a2b49 55%, #071b30 100%); }
.customer-sidebar .admin-sidebar-foot { color: #89a3b7; }
.customer-topbar { border-bottom-color: #dfe7ee; }
.customer-content { max-width: 1420px; }
.customer-welcome h1 { max-width: 820px; }
.customer-metrics .metric-card { min-height: 164px; }
.customer-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 20px; align-items: start; }
.customer-recent-panel { min-width: 0; }
.customer-recent-panel .panel-heading-row { margin-bottom: 4px; }
.customer-compact-table { min-width: 620px; }
.customer-quick-actions { padding: 24px; }
.customer-quick-actions h2 { margin-bottom: 7px; }
.customer-quick-actions > p { margin-top: 0; }
.quick-action-list { display: grid; gap: 9px; margin-top: 18px; }
.quick-action-list a { padding: 13px 14px; border: 1px solid #dce6ee; border-radius: 11px; display: block; color: var(--ink); text-decoration: none; background: #f9fbfd; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.quick-action-list a:hover { border-color: #9fc5df; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(23,70,103,.07); }
.quick-action-list strong, .quick-action-list span { display: block; }
.quick-action-list strong { color: var(--navy); font-size: .87rem; }
.quick-action-list span { margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.customer-filter-bar { grid-template-columns: minmax(220px, 1.5fr) minmax(135px, .7fr) minmax(140px, .65fr) minmax(140px, .65fr) auto; }
.customer-records-table { min-width: 850px; }
.customer-invoices-table { min-width: 960px; }
.customer-deliverables { margin-top: 18px; }
.customer-deliverables .panel-heading-row { padding-bottom: 17px; }
.customer-download-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.customer-download-grid a { min-width: 0; padding: 16px; border: 1px solid #c8ddeb; border-radius: 12px; display: grid; grid-template-columns: 31px minmax(0, 1fr); gap: 2px 9px; align-items: center; color: var(--navy); text-decoration: none; background: #f3f9fd; }
.customer-download-grid a:hover { border-color: #78b1d7; background: #e8f4fb; }
.customer-download-grid a > span { grid-row: span 2; width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: #dceef9; color: #1769a5; font-weight: 900; }
.customer-download-grid strong, .customer-download-grid small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-download-grid strong { font-size: .82rem; }
.customer-download-grid small { color: var(--muted); font-size: .67rem; }
.customer-revision-card { max-width: 960px; margin: 0 auto; }
.customer-revision-card .request-context { margin-top: 0; }
.customer-revision-card .request-context div { background: #f8fafc; }
.invoice-heading-actions { display: flex; align-items: center; gap: 10px; }
.invoice-total-card { margin: 0 0 20px; padding: 22px 24px; border: 1px solid #bcd8e9; border-radius: 16px; display: flex; align-items: baseline; gap: 12px; background: linear-gradient(135deg, #eaf6fc, #f8fcfe); color: var(--navy); }
.invoice-total-card span { color: var(--muted); font-size: .8rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.invoice-total-card strong { margin-left: auto; font-size: 2rem; line-height: 1; }
.invoice-total-card small { color: var(--muted); font-weight: 750; }
.customer-account-settings { width: min(1080px, 100%); }
.customer-profile-actions { padding: 20px 0 0; }

@media (max-width: 1100px) {
    .customer-dashboard-grid { grid-template-columns: 1fr; }
    .customer-filter-bar { grid-template-columns: 1fr 1fr; }
    .customer-filter-bar .search-field { grid-column: span 2; }
    .customer-download-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) { .metric-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) {
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .search-field { grid-column: span 2; }
    .filter-actions { align-self: end; }
    .account-entry-layout { grid-template-columns: 1fr; }
    .work-start-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .admin-frame { display: block; }
    .admin-sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .2s ease; width: 260px; }
    .sidebar-collapse { display: none; }
    .sidebar-open .admin-sidebar { transform: translateX(0); }
    .sidebar-scrim { position: fixed; inset: 0; z-index: 25; border: 0; background: rgba(10,28,45,.55); }
    .sidebar-open .sidebar-scrim { display: block; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .workspace-summary { grid-template-columns: 1fr; }
    .form-card-grid { grid-template-columns: 1fr; }
    .request-context { grid-template-columns: 1fr 1fr; }
    .report-layout { grid-template-columns: 1fr; }
    .branding-asset-grid { grid-template-columns: 1fr; }
    .account-filter-bar, .work-filter-bar { grid-template-columns: 1fr 1fr; }
    .account-filter-bar .search-field, .work-filter-bar .search-field { grid-column: span 2; }
}
@media (max-width: 620px) {
    .user-label { display: none; }
    .page-shell { padding-top: 28px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .metric-grid, .panel-grid, .form-grid { grid-template-columns: 1fr; }
    .auth-card { margin-top: 10px; }
    .admin-content { padding: 24px 16px 42px; }
    .admin-topbar { padding: 0 14px; }
    .admin-topbar .user-label, .topbar-title { display: none; }
    .account-menu summary { padding-right: 5px; }
    .account-chevron { display: none; }
    .filter-bar { grid-template-columns: 1fr; }
    .search-field { grid-column: auto; }
    .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .read-only-notice { flex-direction: column; }
    .workspace-tabs { padding-left: 0; }
    .compact-filter-bar { grid-template-columns: 1fr 1fr; }
    .compact-filter-bar .search-field { grid-column: 1 / -1; }
    .field-pair { grid-template-columns: 1fr; }
    .request-context { grid-template-columns: 1fr; }
    .completion-panel { align-items: stretch; flex-direction: column; }
    .users-filter-bar { grid-template-columns: 1fr; }
    .danger-zone { align-items: stretch; flex-direction: column; }
    .danger-zone form .button { width: 100%; }
    .report-bar-row { grid-template-columns: 68px minmax(100px, 1fr) 38px; gap: 8px; }
    .account-summary { grid-template-columns: 1fr; }
    .account-filter-bar, .work-filter-bar, .work-start-grid { grid-template-columns: 1fr; }
    .account-filter-bar .search-field, .work-filter-bar .search-field { grid-column: auto; }
    .account-month-bars { gap: 4px; }
    .account-month-bar span { font-size: .56rem; }
    .panel-heading-row { flex-direction: column; }
    .customer-download-grid { grid-template-columns: 1fr; }
    .invoice-heading-actions { width: 100%; justify-content: space-between; }
    .invoice-total-card { align-items: flex-start; flex-wrap: wrap; }
    .invoice-total-card strong { width: 100%; margin: 3px 0 0; }
}

@media print {
    .admin-sidebar, .admin-topbar, .sidebar-scrim, .page-heading .heading-action, .filter-bar, .table-tools, .pagination, .row-actions, .customer-no-print { display: none !important; }
    .admin-frame { display: block; }
    .admin-content { width: 100%; padding: 0; }
    .data-panel { border: 0; box-shadow: none; padding: 0; }
    .data-table { min-width: 0; }
    .invoice-total-card, .detail-card { break-inside: avoid; box-shadow: none; }
}

/* Phase 2I notification centre */
.notification-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid #d8e4ef; border-radius: 12px; background: #fff; color: #29445d; text-decoration: none; }
.notification-bell:hover, .notification-bell.active { background: #edf7ff; color: #1666a8; border-color: #b9daf2; }
.notification-bell .nav-icon { width: 20px; height: 20px; margin: 0; }
.notification-bell > span:last-child { position: absolute; top: -5px; right: -6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 800; }
.notification-workspace { max-width: 1040px; margin: 0 auto; }
.notification-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.notification-filters { display: flex; align-items: center; gap: 8px; margin: 20px 0; }
.notification-filters a { padding: 8px 14px; border: 1px solid #c9ddea; border-radius: 999px; color: #31516b; text-decoration: none; font-weight: 700; }
.notification-filters a.active { background: #1569a8; color: #fff; border-color: #1569a8; }
.notification-filters span { margin-left: auto; color: #6d8293; font-size: 13px; }
.notification-list { display: grid; gap: 10px; }
.notification-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 17px 18px; border: 1px solid #dce7ee; border-radius: 15px; background: #f8fbfd; color: #28475f; text-decoration: none; transition: .18s ease; }
.notification-item:hover { transform: translateY(-1px); border-color: #afd2e8; box-shadow: 0 8px 22px rgba(34, 79, 111, .08); }
.notification-item.unread { background: #edf8ff; border-color: #b9ddf2; }
.notification-dot { width: 9px; height: 9px; border-radius: 50%; background: #a9bac6; }
.notification-item.unread .notification-dot { background: #1686c8; box-shadow: 0 0 0 4px rgba(22, 134, 200, .12); }
.notification-copy { display: grid; gap: 4px; }
.notification-copy strong { color: #173a55; }
.notification-copy span { color: #4f697c; line-height: 1.45; }
.notification-copy small { color: #7a8e9d; }
.notification-state { padding: 5px 9px; border-radius: 999px; background: #e9eef2; color: #607685; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.notification-item.unread .notification-state { background: #d5efff; color: #0873b6; }
@media (max-width: 680px) {
    .notification-heading { display: grid; }
    .notification-filters { flex-wrap: wrap; }
    .notification-filters span { width: 100%; margin: 4px 0 0; }
    .notification-item { grid-template-columns: 10px minmax(0, 1fr); }
    .notification-state { display: none; }
}

/* Admin invoice workflows */
.invoice-page-heading { align-items: center; }
.invoice-export-button { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; box-shadow: 0 8px 18px rgba(8,114,79,.16); }
.invoice-export-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.invoice-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.invoice-summary-card { min-width: 0; padding: 18px 20px; border: 1px solid #d9e5ee; border-radius: 16px; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 15px; align-items: center; background: #fff; box-shadow: 0 7px 24px rgba(30,55,75,.035); }
.invoice-summary-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.15rem; font-weight: 900; }
.invoice-summary-card small, .invoice-summary-card span { display: block; }
.invoice-summary-card small { color: #64748b; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invoice-summary-card strong { display: block; margin: 3px 0 2px; color: #102a43; font-size: 1.7rem; line-height: 1.05; }
.invoice-summary-card div > span { color: #718096; font-size: .76rem; }
.invoice-summary-unpaid { border-top: 3px solid #d48a1d; }
.invoice-summary-unpaid .invoice-summary-icon { color: #9a5d08; background: #fff2d8; }
.invoice-summary-paid { border-top: 3px solid #17976f; }
.invoice-summary-paid .invoice-summary-icon { color: #08724f; background: #e3f6ed; }
.invoice-summary-all { border-top: 3px solid #2d83c5; }
.invoice-summary-all .invoice-summary-icon { color: #1769a5; background: #e6f3fb; }
.invoice-tabs { display: inline-flex; gap: 4px; margin-bottom: 14px; padding: 4px; border: 1px solid #dbe5ed; border-radius: 12px; background: #eaf1f6; }
.invoice-tabs a { min-height: 39px; padding: 8px 14px; border-radius: 9px; display: inline-flex; align-items: center; gap: 8px; color: #617386; text-decoration: none; font-size: .83rem; font-weight: 800; }
.invoice-tabs a b { min-width: 23px; min-height: 21px; padding: 2px 6px; border-radius: 999px; display: inline-grid; place-items: center; background: rgba(98,116,134,.12); font-size: .68rem; }
.invoice-tabs a.active { color: #0f3456; background: #fff; box-shadow: 0 3px 9px rgba(30,55,75,.09); }
.invoice-tabs a.active b { color: #1769a5; background: #e2f2fc; }
.invoice-panel { border-radius: 18px; }
.invoice-filter-bar { grid-template-columns: minmax(230px, 1.4fr) minmax(115px, .55fr) minmax(145px, .72fr) minmax(145px, .72fr) minmax(145px, .72fr) auto; }
.invoice-filter-bar.without-status { grid-template-columns: minmax(250px, 1.5fr) minmax(120px, .55fr) minmax(145px, .7fr) minmax(145px, .7fr) auto; }
.invoice-export-hint { margin: 12px 2px 0; color: #64748b; font-size: .76rem; }
.invoice-table-meta { padding-top: 13px; }
.invoice-table { min-width: 1180px; border-collapse: separate; border-spacing: 0 8px; }
.invoice-table th { padding-top: 7px; padding-bottom: 7px; border-bottom: 0; }
.invoice-table tbody td { background: #eef8ff; border-top: 1px solid #cfe4f2; border-bottom: 1px solid #cfe4f2; transition: background .16s ease, border-color .16s ease; }
.invoice-table tbody td:first-child { border-left: 1px solid #cfe4f2; border-radius: 11px 0 0 11px; box-shadow: inset 4px 0 #3d91cf; }
.invoice-table tbody td:last-child { border-right: 1px solid #cfe4f2; border-radius: 0 11px 11px 0; }
.invoice-table tbody tr:hover > td { background: #e4f4fd; border-color: #aed4e9; }
.invoice-table .invoice-empty-row td { border: 1px dashed #cbdce8; border-radius: 12px; box-shadow: none; background: #f8fbfd; }
.invoice-reference { color: #0d619c; font-weight: 850; text-decoration: none; white-space: nowrap; }
.invoice-reference:hover { text-decoration: underline; }
.invoice-unique-id { display: inline-block; max-width: 160px; color: #435c71; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invoice-email-state { min-height: 26px; padding: 4px 9px; border-radius: 999px; display: inline-flex; align-items: center; font-size: .7rem; font-weight: 850; white-space: nowrap; }
.invoice-email-sent { color: #067647; background: #dff5e9; box-shadow: inset 0 0 0 1px #b6e2ca; }
.invoice-email-not-sent { color: #9a5d08; background: #fff1d6; box-shadow: inset 0 0 0 1px #efd39c; }
.invoice-email-resend { color: #a3362c; background: #fff0ee; box-shadow: inset 0 0 0 1px #efc1bd; }
.invoice-token { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .73rem; color: #52677a; }
.invoice-actions { min-width: 236px; display: flex; align-items: center; gap: 6px; }
.invoice-actions form { margin: 0; }
.invoice-action { width: 32px; height: 32px; padding: 0; border: 1px solid #bad5e6; border-radius: 8px; display: inline-grid; place-items: center; color: #246b9b; background: rgba(255,255,255,.78); cursor: pointer; text-decoration: none; transition: transform .15s ease, color .15s ease, background .15s ease, border-color .15s ease; }
.invoice-action:hover { transform: translateY(-1px); color: #0e4f7c; border-color: #82b4d4; background: #fff; }
.invoice-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.invoice-action-danger { color: #b42318; border-color: #ecc4c0; }
.invoice-action-danger:hover { color: #8f1c13; border-color: #e19b95; background: #fff2f1; }
.invoice-action.copy-complete { width: auto; min-width: 58px; padding: 0 8px; color: #067647; border-color: #9dd7bd; background: #e6f7ef; }
.copy-feedback { font-size: .66rem; font-weight: 850; }

.invoice-detail-heading { align-items: center; }
.invoice-heading-actions .button { display: inline-grid; place-items: center; text-decoration: none; }
.invoice-document { overflow: hidden; border: 1px solid #dbe5ed; border-radius: 20px; background: #fff; box-shadow: 0 14px 40px rgba(30,55,75,.055); }
.invoice-document-header { min-height: 102px; padding: 26px 30px; border-bottom: 1px solid #dbe5ed; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(120deg, #f7fbfe, #edf7fc); }
.invoice-document-brand { display: flex; align-items: center; gap: 12px; }
.invoice-brand-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #153b63, #2d83c5); font-size: 1.35rem; font-weight: 900; }
.invoice-document-brand strong, .invoice-document-brand small { display: block; }
.invoice-document-brand strong { color: #123758; font-size: 1.08rem; }
.invoice-document-brand small { margin-top: 4px; color: #6c8193; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.invoice-document-title { text-align: right; }
.invoice-document-title span, .invoice-document-title strong { display: block; }
.invoice-document-title span { color: #2877af; font-size: .72rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.invoice-document-title strong { margin-top: 5px; color: #102a43; font-size: 1.45rem; }
.invoice-address-grid { padding: 28px 30px 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.invoice-address-grid > div:last-child { padding-left: 30px; border-left: 1px solid #e3eaf0; }
.invoice-address-grid small, .invoice-address-grid strong { display: block; }
.invoice-address-grid small { margin-bottom: 8px; color: #2d83c5; font-size: .67rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.invoice-address-grid strong { color: #173955; }
.invoice-address-grid p { margin: 8px 0 0; color: #65768a; font-size: .83rem; line-height: 1.65; }
.invoice-metadata { margin: 0 30px 26px; padding: 16px 18px; border: 1px solid #cfe4f2; border-radius: 13px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; background: #eef8ff; }
.invoice-metadata small, .invoice-metadata strong { display: block; }
.invoice-metadata small { margin-bottom: 5px; color: #668095; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invoice-metadata strong { color: #123957; font-size: .83rem; overflow-wrap: anywhere; }
.invoice-items-wrap { overflow-x: auto; }
.invoice-document .invoice-items-wrap { margin: 0 30px; }
.invoice-items-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.invoice-items-table th { padding: 11px 12px; color: #fff; background: #153b63; text-align: left; font-size: .66rem; letter-spacing: .07em; text-transform: uppercase; }
.invoice-items-table th:first-child { border-radius: 9px 0 0 9px; }
.invoice-items-table th:last-child { border-radius: 0 9px 9px 0; }
.invoice-items-table td { padding: 13px 12px; border-bottom: 1px solid #e7edf2; color: #53677a; font-size: .82rem; }
.invoice-items-table tbody tr:nth-child(even) td { background: #f7fbfd; }
.invoice-items-table .numeric { text-align: right; white-space: nowrap; }
.invoice-items-table.compact { min-width: 620px; }
.invoice-document-bottom { padding: 25px 30px 31px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 50px; align-items: start; }
.invoice-notes small { color: #2d83c5; font-size: .67rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.invoice-notes p { margin: 9px 0 0; color: #66788a; font-size: .82rem; line-height: 1.65; }
.invoice-totals { margin: 0; }
.invoice-totals div { padding: 8px 11px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #617487; font-size: .84rem; }
.invoice-totals dd { margin: 0; color: #263e52; font-weight: 750; }
.invoice-totals .invoice-grand-total { margin-top: 5px; padding: 13px 14px; border-radius: 10px; color: #123957; background: #e8f5fd; font-weight: 850; }
.invoice-totals .invoice-grand-total dd { color: #0e5789; font-size: 1rem; }
.invoice-detail-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.invoice-detail-strip article { min-width: 0; padding: 16px 18px; border: 1px solid #dbe5ed; border-radius: 13px; background: #fff; }
.invoice-detail-strip small, .invoice-detail-strip strong, .invoice-detail-strip span { display: block; }
.invoice-detail-strip small { color: #718096; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invoice-detail-strip strong { margin: 7px 0 4px; color: #173955; font-size: .87rem; overflow-wrap: anywhere; }
.invoice-detail-strip span { color: #8190a0; font-size: .71rem; }
.invoice-detail-token { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.invoice-operations { margin-top: 18px; padding: 19px 21px; border: 1px solid #eed5a2; border-radius: 15px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fffaf0; }
.invoice-operations h2 { margin: 0 0 5px; font-size: 1rem; }
.invoice-operations p { margin: 0; color: #896a2f; font-size: .82rem; }
.invoice-operation-actions { display: flex; gap: 8px; }
.invoice-operation-actions form { margin: 0; }

.invoice-edit-context div { border-top: 3px solid #b8d9ec; }
.invoice-edit-context div:first-child { border-top-color: #2d83c5; }
.invoice-edit-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .72fr); gap: 20px; align-items: start; }
.invoice-edit-lines { min-width: 0; }
.form-card-heading { padding-bottom: 13px; border-bottom: 1px solid #edf0f4; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-card-heading h2 { margin: 0; padding: 0; border: 0; }
.form-card-heading .eyebrow { margin-bottom: 6px; }
.form-card-heading > strong { min-width: 61px; padding: 6px 9px; border-radius: 999px; color: #1769a5; background: #e5f3fc; text-align: center; font-size: .7rem; }
.invoice-edit-lines .invoice-items-wrap { margin-bottom: 22px; }
.invoice-edit-totals { position: sticky; top: 88px; border-top: 3px solid #2d83c5; }
.invoice-edit-totals h2 { margin-bottom: 15px; }
.invoice-live-totals { margin: 0 0 22px; padding: 13px 15px; border: 1px solid #d4e6f2; border-radius: 12px; background: #f2f9fd; }
.invoice-live-totals div { padding: 7px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #5f7385; }
.invoice-live-totals dd { margin: 0; color: #183b57; font-weight: 800; }
.invoice-live-totals div:last-child { margin-top: 4px; padding-top: 12px; border-top: 1px solid #cfe2ee; color: #143d5e; font-weight: 850; }
.invoice-live-totals div:last-child dd { color: #0d619c; font-size: 1.08rem; }
.invoice-edit-totals label small { display: block; margin-top: 6px; color: #7a8998; font-size: .72rem; font-weight: 500; }
.invoice-paid-warning { margin-top: 17px; padding: 13px; border: 1px solid #aee0c9; border-radius: 11px; display: flex; gap: 10px; color: #067647; background: #ecfaf3; }
.invoice-paid-warning[hidden] { display: none; }
.invoice-paid-warning > span { width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #17976f; font-weight: 900; }
.invoice-paid-warning p { margin: 0; }
.invoice-paid-warning strong, .invoice-paid-warning small { display: block; }
.invoice-paid-warning small { margin-top: 4px; color: #477565; font-size: .71rem; line-height: 1.45; }
.form-actions.stacked { display: grid; grid-template-columns: 1fr 1.2fr; }

@media (max-width: 1180px) {
    .invoice-filter-bar, .invoice-filter-bar.without-status { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .invoice-filter-bar .search-field { grid-column: span 2; }
    .invoice-filter-bar .filter-actions { grid-column: auto; }
    .invoice-edit-grid { grid-template-columns: 1fr; }
    .invoice-edit-totals { position: static; }
}

@media (max-width: 780px) {
    .invoice-summary, .invoice-detail-strip { grid-template-columns: 1fr; }
    .invoice-address-grid { grid-template-columns: 1fr; gap: 24px; }
    .invoice-address-grid > div:last-child { padding: 24px 0 0; border-top: 1px solid #e3eaf0; border-left: 0; }
    .invoice-metadata { grid-template-columns: 1fr 1fr; }
    .invoice-document-bottom { grid-template-columns: 1fr; gap: 24px; }
    .invoice-operations { align-items: stretch; flex-direction: column; }
    .invoice-operation-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .invoice-operation-actions .button { width: 100%; }
}

@media (max-width: 620px) {
    .invoice-page-heading .invoice-export-button { width: 100%; justify-content: center; }
    .invoice-tabs { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
    .invoice-tabs a { padding: 8px; justify-content: center; }
    .invoice-tabs a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .invoice-filter-bar, .invoice-filter-bar.without-status { grid-template-columns: 1fr; }
    .invoice-filter-bar .search-field, .invoice-filter-bar .filter-actions { grid-column: auto; }
    .invoice-detail-heading .invoice-heading-actions { align-items: stretch; display: grid; grid-template-columns: 1fr 1fr; }
    .invoice-detail-heading .invoice-heading-actions .status-badge { grid-column: 1 / -1; justify-content: center; }
    .invoice-document-header { padding: 20px; align-items: flex-start; }
    .invoice-document-brand small { display: none; }
    .invoice-document-title strong { font-size: 1rem; }
    .invoice-address-grid { padding: 23px 20px; }
    .invoice-metadata { margin: 0 20px 22px; grid-template-columns: 1fr; }
    .invoice-document .invoice-items-wrap { margin: 0 20px; }
    .invoice-document-bottom { padding: 23px 20px 27px; }
    .invoice-operation-actions { grid-template-columns: 1fr; }
    .form-actions.stacked { grid-template-columns: 1fr; }
}

@media print {
    .invoice-heading-actions, .invoice-detail-strip, .invoice-operations, .invoice-tabs, .invoice-summary { display: none !important; }
    .invoice-document { border: 0; box-shadow: none; }
}
.paypal-checkout-card{align-items:flex-start;background:linear-gradient(135deg,#eef7ff,#fff);border:1px solid #bddcf8;border-radius:18px;display:grid;gap:28px;grid-template-columns:minmax(0,1fr) minmax(280px,360px);margin-top:24px;padding:26px;box-shadow:0 14px 35px rgba(24,87,141,.09)}
.paypal-checkout-card h2{color:#102a43;margin:5px 0 8px}.paypal-checkout-card p{color:#526b80;margin:0;max-width:620px}.paypal-checkout-card #paypal-button-container{min-height:45px;width:100%}.paypal-checkout-card .paypal-payment-message{font-size:.88rem;grid-column:1/-1;min-height:1.2em}.paypal-checkout-card .paypal-payment-message.is-error{color:#b42318}
@media(max-width:760px){.paypal-checkout-card{grid-template-columns:1fr;padding:20px}.paypal-checkout-card .paypal-payment-message{grid-column:1}}
