main > .container {
    padding: 70px 15px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.not-set {
    color: var(--bs-danger);
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px var(--bs-body-color);
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px var(--bs-body-color);
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: var(--bs-secondary-color);
}

.has-error .help-block,
.help-block:not(:empty) {
    color: var(--bs-danger);
    display: block;
    font-size: .8125rem;
    margin-top: .25rem;
}

.error-summary {
    color: var(--bs-danger-text-emphasis);
    background: var(--bs-danger-bg-subtle);
    border-left: 3px solid var(--bs-danger-border-subtle);
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* Keep the brand and expanded navigation on the same vertical center line. */
.navbar > .container,
.navbar > .container-fluid {
    align-items: center;
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-collapse,
    .navbar-expand-lg .navbar-nav {
        align-items: center;
    }
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    color: var(--bs-navbar-color);
}

@media (max-width: 767.98px) {
    .navbar-nav .nav-link.logout {
        display: block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.demo-mode-banner {
    align-items: center;
    background: #fff7d6;
    border: 1px solid #e7c85c;
    border-radius: .5rem;
    color: #594500;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: .7rem 1rem;
}

.demo-mode-banner strong {
    font-size: .875rem;
}

.demo-mode-banner span {
    font-size: .8125rem;
}

.system-detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-detail-grid > div {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.system-detail-grid span {
    color: var(--ei-muted);
    font-size: .78rem;
}

.system-detail-wide {
    grid-column: 1 / -1;
}

.system-detail-grid code {
    color: var(--ei-text);
    overflow-wrap: anywhere;
}

.system-check {
    align-items: center;
    border: 1px solid var(--ei-line);
    display: flex;
    justify-content: space-between;
    min-height: 48px;
    padding: .65rem .8rem;
}

.navbar-nav .nav-link.logout:focus,
.navbar-nav .nav-link.logout:hover {
    color: var(--bs-navbar-hover-color);
}

/* footer logo: light logo by default (light bg-body-tertiary), dark logo for dark theme */
.footer-logo-dark { display: none; }

[data-bs-theme="dark"] .footer-logo-light { display: none; }
[data-bs-theme="dark"] .footer-logo-dark  { display: inline-block; }

/* login inputs: seamless icon inside input (Volt style) */
.login-split-card .input-group {
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.login-split-card .input-group .input-group-text {
    background: transparent;
    border: 0;
    padding-left: 1rem;
    padding-right: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-split-card .input-group .form-control {
    border: 0;
    background: transparent;
}

.login-split-card .input-group .form-control:focus {
    box-shadow: none;
}

.login-split-card .input-group:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
}

/* validation styles for login split card (browsers with :has()) */
@supports selector(.input-group:has(.is-invalid)) {
    .login-split-card .input-group:has(.is-invalid) ~ .invalid-feedback {
        display: block;
        margin-top: .35rem;
        margin-bottom: .5rem;
    }

    .login-split-card .input-group:has(.is-invalid) {
        border-color: var(--bs-danger);
    }

    .login-split-card .input-group:has(.is-invalid):focus-within {
        box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
    }
}

/* fallback validation styles for login split card (browsers without :has()) */
@supports not selector(.input-group:has(.is-invalid)) {
    .login-split-card .invalid-feedback:not(:empty) {
        display: block;
        margin-top: .35rem;
        margin-bottom: .5rem;
    }

    .login-split-card .input-group .form-control.is-invalid {
        border: var(--bs-border-width) solid var(--bs-danger);
    }

    .login-split-card .input-group .form-control.is-invalid:focus {
        box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
    }
}

/* login split card */
.login-split-card {
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .10);
    background-color: var(--bs-gray-100);
    width: 100%;
    max-width: 900px;
}

.login-split-card-wide {
    max-width: 960px;
}

.login-brand-title {
    font-size: 1.75rem;
    line-height: 1.3;
}

.login-brand-text {
    font-size: .9rem;
}

.login-brand-panel {
    background: #17222d;
    position: relative;
    min-height: 480px;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(15, 118, 110, .92), rgba(23, 34, 45, .2) 68%);
    pointer-events: none;
}

.login-btn {
    background-color: #0f766e;
    border: 1px solid #0f766e;
    color: #fff;
    font-weight: 600;
    letter-spacing: .02em;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.login-btn:hover,
.login-btn:focus {
    background-color: #0b5f59;
    border-color: #0b5f59;
    color: #fff;
    box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .2);
    transform: translateY(-1px);
}

.login-btn:active,
.login-btn:active:focus {
    background-color: #084c48;
    border-color: #084c48;
    color: #fff;
    box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .24);
    transform: translateY(0);
}

.invokeep-brand {
    align-items: center;
    display: inline-flex;
    gap: .55rem;
}

.invokeep-brand-mark {
    height: 2rem;
    width: 2rem;
}

.invokeep-brand-word {
    color: #17222d;
    font-size: 1.05rem;
    font-weight: 750;
}

.invokeep-brand-accent {
    color: #0f766e;
}

.invokeep-login-brand {
    align-items: center;
    display: flex;
    font-size: 1.15rem;
    font-weight: 650;
    gap: .6rem;
    position: relative;
    z-index: 1;
}

.invokeep-login-brand img {
    height: 2rem;
    width: 2rem;
}

.invokeep-login-brand strong {
    color: #0f766e;
    font-weight: 750;
}

.login-brand-panel .invokeep-login-brand strong {
    color: #5ee0b5;
}

/* dark mode login card */
[data-bs-theme="dark"] .login-split-card {
    background-color: var(--bs-body-bg);
    box-shadow: 0 0 0 1px var(--bs-border-color), 0 4px 24px rgba(0, 0, 0, .4);
}

[data-bs-theme="dark"] .login-mobile-logo {
    filter: invert(1);
}

/* contact form textarea height */
.site-contact textarea.form-control {
    height: 140px;
}

/* captcha: blend with card background */
.site-contact img[src*="captcha"] {
    border-radius: var(--bs-border-radius);
    mix-blend-mode: multiply;
}

/* dark mode: invert captcha for visibility on dark background */
[data-bs-theme="dark"] .site-contact img[src*="captcha"] {
    mix-blend-mode: screen;
    filter: invert(1) hue-rotate(180deg);
}

/* centered page layout */
.site-login,
.site-contact,
.site-index,
.site-error,
.site-about,
.site-contact-success {
    flex: 1;
}

.site-error .site-error-content,
.site-about .site-about-content,
.site-contact-success .site-contact-success-content {
    width: 100%;
    max-width: 90%;
}

@media (min-width: 576px) {
    .site-error .site-error-content,
    .site-about .site-about-content,
    .site-contact-success .site-contact-success-content {
        max-width: 80%;
    }
}

@media (min-width: 768px) {
    .site-error .site-error-content,
    .site-about .site-about-content,
    .site-contact-success .site-contact-success-content {
        max-width: 60%;
    }
}

@media (min-width: 992px) {
    .site-error .site-error-content,
    .site-about .site-about-content,
    .site-contact-success .site-contact-success-content {
        max-width: 50%;
    }
}

/* hero banner */
.hero-banner {
    background: linear-gradient(135deg, #83C933 0%, #3a9cbd 40%, #40B3D8 100%);
    position: relative;
}

.hero-lead {
    max-width: 520px;
}

.hero-logo {
    height: 120px;
    opacity: .45;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 15% 85%, rgba(241, 138, 42, .3) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(131, 201, 51, .25) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(64, 179, 216, .15) 0%, transparent 60%);
    pointer-events: none;
}

/* extension cards */
.extension-card {
    transition: transform .15s ease-in-out, box-shadow .15s ease-in-out;
}

.extension-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12) !important;
}

.extension-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* dark mode: extension cards */
[data-bs-theme="dark"] .extension-card {
    background-color: var(--bs-body-bg);
    box-shadow: 0 0 0 1px var(--bs-border-color), 0 2px 8px rgba(0, 0, 0, .3);
}

[data-bs-theme="dark"] .extension-card:hover {
    box-shadow: 0 0 0 1px var(--bs-border-color), 0 8px 24px rgba(0, 0, 0, .4) !important;
}

/* Modern workspace sizing */
.ei-page {
    max-width: none;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    width: 100%;
}

#main {
    font-size: .925rem;
}

#main .form-control,
#main .form-select,
#main .btn {
    font-size: .925rem;
}

@media (max-width: 575.98px) {
    .ei-page {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Fast entity search */
.entity-smart-search-panel {
    overflow: visible;
    padding: .8rem;
    position: relative;
    z-index: 20;
}

.entity-smart-search {
    margin: 0 auto;
    max-width: 920px;
    position: relative;
}

.entity-smart-search-control {
    align-items: center;
    display: flex;
    position: relative;
}

.entity-smart-search-icon {
    border: 2px solid var(--ei-muted);
    border-radius: 50%;
    height: 15px;
    left: 1rem;
    pointer-events: none;
    position: absolute;
    width: 15px;
    z-index: 2;
}

.entity-smart-search-icon::after {
    background: var(--ei-muted);
    content: '';
    height: 2px;
    left: 10px;
    position: absolute;
    top: 11px;
    transform: rotate(45deg);
    width: 7px;
}

.entity-smart-search-input.form-control {
    border-color: var(--ei-line);
    border-radius: .5rem 0 0 .5rem;
    font-size: .95rem;
    min-height: 46px;
    padding-left: 2.8rem;
    padding-right: 4rem;
}

.entity-smart-search-submit {
    align-self: stretch;
    border-radius: 0 .5rem .5rem 0;
    min-width: 96px;
}

.entity-smart-search-clear {
    color: var(--ei-muted);
    font-size: .75rem;
    font-weight: 600;
    position: absolute;
    right: 108px;
    text-decoration: none;
    z-index: 2;
}

.entity-smart-search-clear:hover {
    color: var(--ei-accent);
    text-decoration: underline;
}

.entity-smart-search-hint {
    color: var(--ei-muted);
    font-size: .72rem;
    padding: .45rem .25rem 0;
}

.entity-smart-search-results {
    background: var(--ei-panel);
    border: 1px solid var(--ei-line);
    border-radius: .5rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
    left: 0;
    max-height: 390px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: 50px;
    z-index: 3000;
}

.entity-smart-search-result {
    align-items: center;
    background: var(--ei-panel);
    border-bottom: 1px solid var(--ei-line);
    color: var(--ei-text);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .75rem .9rem;
    text-decoration: none;
}

.entity-smart-search-result:last-child {
    border-bottom: 0;
}

.entity-smart-search-result:focus,
.entity-smart-search-result:hover,
.entity-smart-search-result.is-active {
    background: var(--ei-accent-soft);
    color: var(--ei-accent);
    outline: 0;
}

.entity-smart-search-result-content {
    display: grid;
    min-width: 0;
}

.entity-smart-search-result-content strong,
.entity-smart-search-result-content small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-smart-search-result-content strong {
    font-size: .82rem;
}

.entity-smart-search-result-content small {
    color: var(--ei-muted);
    font-size: .72rem;
    margin-top: .15rem;
}

.entity-smart-search-badge {
    background: var(--ei-accent-soft);
    border: 1px solid var(--ei-line);
    border-radius: .35rem;
    color: var(--ei-muted);
    flex: 0 0 auto;
    font-size: .67rem;
    font-weight: 600;
    padding: .2rem .4rem;
}

.entity-smart-search-empty,
.entity-smart-search-error,
.entity-smart-search-loading {
    color: var(--ei-muted);
    font-size: .78rem;
    padding: .9rem;
}

.entity-smart-search-empty {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.entity-smart-search-empty a {
    font-weight: 600;
}

.entity-smart-search-error {
    color: var(--bs-danger);
}

@media (max-width: 575.98px) {
    .entity-smart-search-panel {
        padding: .65rem;
    }

    .entity-smart-search-input.form-control {
        font-size: .82rem;
        min-width: 0;
    }

    .entity-smart-search-submit {
        min-width: 76px;
        padding-left: .7rem;
        padding-right: .7rem;
    }

    .entity-smart-search-clear {
        display: none;
    }

    .entity-smart-search-result {
        align-items: flex-start;
    }

    .entity-smart-search-badge {
        display: none;
    }
}

/* Compact responsive data lists */
.grid-view,
.table-responsive {
    overflow-x: auto;
}

.grid-view table,
.table-responsive table {
    min-width: max-content;
}

.ei-page .table {
    font-size: .875rem;
}

.ei-page .table > :not(caption) > * > * {
    padding: .45rem .6rem;
    white-space: nowrap;
}

.ei-page .table td {
    vertical-align: middle;
}

.ei-page .table input,
.ei-page .table select {
    font-size: .8125rem;
    padding: .3rem .45rem;
}

.invoice-form-page #invoice-lines-table {
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

.invoice-form-page #invoice-lines-table > :not(caption) > * > * {
    white-space: normal;
}

.invoice-form-page #invoice-lines-table .invoice-product-search,
.invoice-form-page #invoice-lines-table .invoice-description,
.invoice-form-page #invoice-lines-table .invoice-qty,
.invoice-form-page #invoice-lines-table .invoice-price,
.invoice-form-page #invoice-lines-table .invoice-gst,
.invoice-form-page #invoice-lines-table .invoice-discount,
.invoice-form-page #invoice-lines-table .invoice-amount {
    width: 100%;
}

.invoice-form-page #invoice-lines-table .invoice-product-search,
.invoice-form-page #invoice-lines-table .invoice-description {
    min-width: 0;
}

.customer-details-panel {
    background-color: var(--ei-accent-soft);
    border: 1px solid var(--ei-line);
    border-radius: .5rem;
    color: var(--ei-text);
    font-size: .8125rem;
    line-height: 1.45;
    padding: .6rem .75rem;
}

.customer-details-panel div + div {
    margin-top: .2rem;
}

.customer-details-panel .customer-shipping-address {
    white-space: pre-line;
}

.onboarding-panel {
    overflow: hidden;
}

.onboarding-head {
    align-items: center;
    border-bottom: 1px solid var(--ei-line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.onboarding-progress {
    align-items: baseline;
    background: var(--ei-accent-soft);
    border-radius: .4rem;
    color: var(--ei-text);
    display: flex;
    flex: 0 0 auto;
    gap: .35rem;
    padding: .45rem .7rem;
}

.onboarding-progress strong {
    font-size: 1rem;
}

.onboarding-progress span {
    color: var(--ei-muted);
    font-size: .75rem;
}

.onboarding-step {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    padding: 1rem 1.5rem;
}

.onboarding-step + .onboarding-step {
    border-top: 1px solid var(--ei-line);
}

.onboarding-step-number {
    align-items: center;
    background: var(--ei-accent);
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-size: .75rem;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.onboarding-step.is-complete .onboarding-step-number {
    background: #198754;
}

.onboarding-step.is-locked {
    background: color-mix(in srgb, var(--ei-panel) 82%, var(--ei-bg));
}

.onboarding-step.is-locked .onboarding-step-number {
    background: var(--ei-muted);
}

.onboarding-step-copy h3 {
    font-size: .9rem;
    font-weight: 700;
    margin: 0 0 .15rem;
}

.onboarding-step-copy p {
    color: var(--ei-muted);
    font-size: .8rem;
    margin: 0;
}

.onboarding-step-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.onboarding-status {
    color: #198754;
    font-size: .75rem;
    font-weight: 700;
}

.onboarding-status.is-locked {
    color: var(--ei-muted);
}

.empty-state-panel {
    align-items: center;
    display: flex;
    flex-direction: column;
    min-height: 19rem;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.empty-state-panel h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .4rem;
}

.empty-state-panel p {
    color: var(--ei-muted);
    margin-bottom: 1.25rem;
    max-width: 32rem;
}

@media (max-width: 767.98px) {
    .onboarding-head {
        align-items: flex-start;
    }

    .onboarding-step {
        align-items: start;
        grid-template-columns: 2rem minmax(0, 1fr);
    }

    .onboarding-step-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

@media (max-width: 991.98px) {
    .invoice-form-page #invoice-lines-table {
        min-width: 920px;
    }
}

.grid-view .summary {
    font-size: .8125rem;
}

.grid-view .pagination > li > a,
.grid-view .pagination > li > span {
    font-size: .8125rem;
    min-height: 2rem;
    min-width: 2rem;
    padding: .45rem .65rem;
}

.product-list-col-xs {
    max-width: 76px;
    min-width: 64px;
    width: 72px;
}

.product-list-col-sm {
    max-width: 96px;
    min-width: 82px;
    width: 90px;
}

.product-list-col-md {
    max-width: 118px;
    min-width: 96px;
    width: 108px;
}

.product-list-actions {
    min-width: 86px;
    width: 86px;
}

.product-index .grid-view th.product-list-col-xs,
.product-index .grid-view th.product-list-col-sm,
.product-index .grid-view th.product-list-col-md {
    line-height: 1.15;
    white-space: normal;
}

.product-index .grid-view td.product-list-col-xs,
.product-index .grid-view td.product-list-col-sm,
.product-index .grid-view td.product-list-col-md {
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-index .grid-view .product-list-col-xs input,
.product-index .grid-view .product-list-col-sm input,
.product-index .grid-view .product-list-col-md select {
    width: 100%;
}

.invoice-list-col-date {
    max-width: 112px;
    min-width: 96px;
    width: 104px;
}

.invoice-list-col-status {
    max-width: 96px;
    min-width: 78px;
    width: 88px;
}

.invoice-list-actions {
    min-width: 86px;
    width: 86px;
}

.invoice-index .grid-view th.invoice-list-col-date,
.invoice-index .grid-view th.invoice-list-col-status {
    line-height: 1.15;
    white-space: normal;
}

.invoice-index .grid-view td.invoice-list-col-date,
.invoice-index .grid-view td.invoice-list-col-status {
    overflow: hidden;
    text-overflow: ellipsis;
}

.invoice-index .grid-view .invoice-list-col-date input,
.invoice-index .grid-view .invoice-list-col-status input {
    width: 100%;
}

.import-mode-select {
    min-width: 230px;
    width: auto;
}

.import-confirm-panel {
    border-left: 4px solid var(--ei-accent);
}

.import-confirm-controls {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.import-confirm-select {
    flex: 0 1 360px;
    min-width: 230px;
}

.import-step-card {
    display: flex;
    flex-direction: column;
}

.import-step-disabled {
    background-color: color-mix(in srgb, var(--ei-panel) 82%, var(--ei-bg));
    box-shadow: none;
}

.import-step-disabled h2,
.import-step-disabled p {
    opacity: .78;
}

.import-stats-five {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 991.98px) {
    .import-stats-five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .import-stats-five {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .ei-page .table {
        font-size: .8125rem;
    }

    .ei-page .table > :not(caption) > * > * {
        padding: .38rem .5rem;
    }
}

.entity-table-link {
    color: var(--ei-text);
    text-decoration: none;
}

/* Sales summary chart */
.report-date-shortcuts {
    border-top: 1px solid var(--ei-line);
    padding-top: .85rem;
}

.report-date-shortcuts-label {
    color: var(--ei-muted);
    display: block;
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: .5rem;
    text-transform: uppercase;
}

.sales-summary-chart {
    height: 400px;
    min-height: 400px;
    width: 100%;
}

.sales-summary-chart canvas {
    display: block;
    height: 100%;
    width: 100%;
}

/* Controlled invoice layout editor */
.invoice-builder-grid {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(280px, 360px) minmax(620px, 1fr);
}

.invoice-builder-controls {
    display: grid;
    gap: 1rem;
}

.invoice-builder-heading {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.invoice-block-list {
    display: grid;
    gap: .5rem;
}

.invoice-block-item {
    align-items: center;
    background: var(--ei-panel);
    border: 1px solid var(--ei-line);
    display: grid;
    gap: .6rem;
    grid-template-columns: 1.25rem minmax(0, 1fr) auto;
    min-height: 44px;
    padding: .55rem .65rem;
}

.invoice-block-handle {
    color: var(--ei-muted);
    cursor: grab;
    font-size: 1rem;
    line-height: 1;
    user-select: none;
}

.invoice-block-handle:active { cursor: grabbing; }
.invoice-block-name { font-size: .8rem; font-weight: 600; }
.invoice-block-ghost { background: var(--ei-accent-soft); opacity: .55; }

.invoice-column-grid {
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-builder-preview-wrap {
    min-width: 0;
    position: sticky;
    top: 78px;
}

.invoice-builder-preview-toolbar {
    align-items: center;
    background: #17222d;
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 48px;
    padding: .7rem 1rem;
}

.invoice-builder-preview-toolbar div {
    align-items: baseline;
    display: flex;
    gap: .65rem;
}

.invoice-builder-preview-toolbar span { color: #cbd5e1; font-size: .75rem; }

.invoice-builder-canvas {
    background: #dfe4ea;
    min-height: 720px;
    overflow: auto;
    padding: 24px;
}

.invoice-template-preview {
    background: #fff;
    border: 0;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .18);
    display: block;
    height: 1040px;
    margin: 0 auto;
    max-width: 100%;
    width: 794px;
}

@media (max-width: 1199.98px) {
    .invoice-builder-grid { grid-template-columns: 320px minmax(560px, 1fr); }
}

@media (max-width: 991.98px) {
    .invoice-builder-grid { grid-template-columns: 1fr; }
    .invoice-builder-preview-wrap { position: static; }
}

/* Pro feature previews */
.pro-feature-intro {
    align-items: end;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    padding: .5rem 0;
}

.pro-feature-intro > div:first-child { max-width: 760px; }

.pro-preview-shell {
    background: var(--ei-panel);
    border: 1px solid var(--ei-line);
    box-shadow: var(--ei-shadow);
    overflow: hidden;
    position: relative;
}

.pro-preview-toolbar {
    align-items: center;
    background: #6b7280;
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 50px;
    padding: .75rem 1rem;
}

.pro-preview-toolbar > div { align-items: baseline; display: flex; gap: .65rem; }
.pro-preview-toolbar span { color: #cbd5e1; font-size: .72rem; }

.pro-preview-lock {
    border: 1px solid #d1d5db;
    color: #fff !important;
    font-weight: 700;
    padding: .3rem .55rem;
    text-transform: uppercase;
}

.pro-preview-body { padding: 1.25rem; }

.pro-export-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.pro-preview-table { min-width: 640px; }
.pro-preview-table th { color: var(--ei-muted); font-size: .68rem; text-transform: uppercase; }
.pro-preview-table td { font-size: .78rem; }
.pro-preview-note { color: var(--ei-muted); font-size: .72rem; padding-top: 1rem; }

.pro-preview-cta {
    align-items: center;
    background: var(--ei-accent-soft);
    border-top: 1px solid var(--ei-line);
    display: flex;
    font-size: .78rem;
    font-weight: 700;
    gap: 1rem;
    justify-content: center;
    padding: .75rem 1rem;
}

.pro-layout-preview {
    background: #dfe4ea;
    display: grid;
    grid-template-columns: minmax(230px, 30%) minmax(0, 1fr);
    min-height: 610px;
}

.pro-layout-controls {
    background: var(--ei-panel);
    border-right: 1px solid var(--ei-line);
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.pro-control-group { align-content: start; display: grid; gap: .5rem; }
.pro-control-group > span { color: var(--ei-muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; }

.pro-segmented {
    border: 1px solid var(--ei-line);
    display: grid;
    font-size: .7rem;
    grid-template-columns: repeat(3, 1fr);
}

.pro-segmented span,
.pro-segmented b { padding: .55rem .3rem; text-align: center; }
.pro-segmented b { background: #17222d; color: #fff; }

.pro-colour-row { align-items: center; display: flex; gap: .65rem; }
.pro-colour-row i { background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ei-line); height: 28px; width: 28px; }
.pro-colour-row code { color: var(--ei-text); font-size: .75rem; }

.pro-layout-block {
    align-items: center;
    border: 1px solid var(--ei-line);
    display: grid;
    font-size: .72rem;
    gap: .5rem;
    grid-template-columns: 1rem 1fr auto;
    min-height: 38px;
    padding: .45rem .55rem;
}

.pro-layout-block i { background: #17222d; height: 14px; position: relative; width: 25px; }
.pro-layout-block i::after { background: #fff; border-radius: 50%; content: ''; height: 10px; position: absolute; right: 2px; top: 2px; width: 10px; }
.pro-drag { color: var(--ei-muted); }

.pro-invoice-stage { display: grid; padding: 28px; place-items: start center; }

.pro-invoice-paper {
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .18);
    color: #17222d;
    min-height: 500px;
    padding: 32px;
    width: min(100%, 510px);
}

.pro-paper-head { align-items: start; display: flex; justify-content: space-between; }
.pro-paper-head div { display: grid; font-size: .65rem; gap: .35rem; }
.pro-paper-head div b { color: #2563eb; font-size: .85rem; }
.pro-paper-head strong { color: #2563eb; font-size: 1.45rem; }
.pro-paper-meta { border-left: 3px solid #2563eb; display: grid; font-size: .65rem; gap: 1rem; grid-template-columns: 1fr 1fr; margin: 28px 0; padding: .4rem .7rem; }
.pro-paper-table,
.pro-paper-line { display: grid; font-size: .62rem; gap: .5rem; grid-template-columns: 1fr 2fr .5fr .8fr; }
.pro-paper-table { border-bottom: 2px solid #2563eb; padding: .45rem .25rem; text-transform: uppercase; }
.pro-paper-line { border-bottom: 1px solid #e2e8f0; padding: .6rem .25rem; }
.pro-paper-table :last-child,
.pro-paper-line :last-child { text-align: right; }
.pro-paper-total { border-top: 2px solid #2563eb; display: flex; font-size: .72rem; gap: 2rem; justify-content: space-between; margin: 30px 0 0 auto; padding-top: .5rem; width: 48%; }

.pro-report-filters { align-items: end; display: grid; gap: .75rem; grid-template-columns: 1fr 1fr auto; }
.pro-report-filters div { border: 1px solid var(--ei-line); display: grid; gap: .2rem; padding: .55rem .7rem; }
.pro-report-filters span,
.pro-kpi-grid span { color: var(--ei-muted); font-size: .68rem; }
.pro-report-filters b { font-size: .78rem; }

.pro-kpi-grid { display: grid; gap: .75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1rem 0; }
.pro-kpi-grid div { border: 1px solid var(--ei-line); display: grid; gap: .25rem; padding: .8rem; }
.pro-kpi-grid strong { font-size: 1rem; }

.pro-report-chart {
    align-items: end;
    border-bottom: 1px solid var(--ei-line);
    display: flex;
    gap: 8%;
    height: 140px;
    justify-content: center;
    margin: 1rem 0 1.25rem;
    padding: 0 5%;
}

.pro-report-chart i { background: #2563eb; display: block; min-width: 34px; opacity: .82; width: 7%; }

@media (max-width: 767.98px) {
    .pro-feature-intro { align-items: start; flex-direction: column; gap: 1rem; }
    .pro-layout-preview { grid-template-columns: 1fr; }
    .pro-layout-controls { border-bottom: 1px solid var(--ei-line); border-right: 0; }
    .pro-invoice-stage { padding: 16px; }
    .pro-invoice-paper { padding: 22px; }
    .pro-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pro-report-filters { grid-template-columns: 1fr 1fr; }
    .pro-report-filters .btn { grid-column: 1 / -1; }
    .pro-preview-cta { align-items: stretch; flex-direction: column; text-align: center; }
}

/* Automatic updates */
.online-update-release {
    align-items: stretch;
    border-bottom: 1px solid var(--ei-line);
    border-top: 1px solid var(--ei-line);
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(250px, .8fr) minmax(420px, 1.2fr);
    margin: 1rem 0;
    padding: 1rem 0;
}

.online-update-version {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr auto 1fr;
}

.online-update-version div:not(.online-update-arrow),
.online-update-details div { display: grid; gap: .2rem; }
.online-update-version span,
.online-update-details span { color: var(--ei-muted); font-size: .68rem; text-transform: uppercase; }
.online-update-version strong { font-size: 1.35rem; }
.online-update-arrow { color: var(--ei-muted); font-size: 1.3rem; }

.online-update-details {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.online-update-details div {
    border-left: 1px solid var(--ei-line);
    padding-left: .8rem;
}

.online-update-details strong { font-size: .78rem; }
.online-update-notes { margin-top: 1rem; }
.online-update-notes h3 { font-size: .78rem; font-weight: 700; margin-bottom: .5rem; }
.online-update-notes ul { color: var(--ei-muted); font-size: .76rem; margin-bottom: 0; padding-left: 1.1rem; }
.online-update-notes li + li { margin-top: .3rem; }

.online-update-current {
    align-items: center;
    border-top: 1px solid var(--ei-line);
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

.online-update-current div { display: grid; gap: .15rem; }
.online-update-current span:not(.badge) { color: var(--ei-muted); font-size: .72rem; }

@media (max-width: 991.98px) {
    .online-update-release { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    .online-update-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .online-update-details div:nth-child(odd) { border-left: 0; padding-left: 0; }
}

.entity-table-link:focus,
.entity-table-link:hover {
    color: var(--ei-accent);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.entity-profile-card {
    overflow: hidden;
}

.entity-profile-accent {
    background: var(--ei-accent);
    height: 4px;
}

.entity-profile-body {
    padding: 1.5rem;
}

.entity-profile-kicker {
    color: var(--ei-muted);
    font-size: .75rem;
    font-weight: 700;
    margin: 0 0 .35rem;
    text-transform: uppercase;
}

.entity-profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.entity-profile-description {
    color: var(--ei-muted);
    margin: .65rem 0 0;
    max-width: 760px;
}

.entity-profile-link {
    color: var(--ei-text);
    text-decoration: none;
}

.entity-profile-link:hover {
    color: var(--ei-accent);
    text-decoration: underline;
}

.entity-detail-grid,
.entity-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.entity-detail-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.entity-detail-grid {
    border-top: 1px solid var(--ei-line);
    gap: 1rem 1.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

.entity-detail-grid > div,
.entity-stat-grid > div {
    min-width: 0;
}

.entity-detail-grid span,
.entity-stat-grid span,
.entity-notes > span {
    color: var(--ei-muted);
    display: block;
    font-size: .75rem;
    margin-bottom: .3rem;
}

.entity-detail-grid strong,
.entity-stat-grid strong {
    display: block;
    overflow-wrap: anywhere;
}

.entity-stat-grid {
    background: color-mix(in srgb, var(--ei-accent-soft) 70%, var(--ei-panel));
    border-bottom: 1px solid var(--ei-line);
    border-top: 1px solid var(--ei-line);
    margin: 1.5rem -1.5rem 0;
}

.entity-stat-grid > div {
    padding: 1rem 1.5rem;
}

.entity-stat-grid > div + div {
    border-left: 1px solid var(--ei-line);
}

.entity-stat-grid strong {
    font-size: 1.1rem;
}

.entity-notes {
    border-top: 1px solid var(--ei-line);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

.entity-notes p {
    margin: 0;
    white-space: normal;
}

.entity-meta {
    border-top: 1px solid var(--ei-line);
    color: var(--ei-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .75rem;
    gap: .5rem 1.25rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
}

.entity-address-panel {
    padding: 1.25rem;
}

.entity-address-heading {
    border-bottom: 1px solid var(--ei-line);
    margin-bottom: 1rem;
    padding-bottom: .8rem;
}

.entity-address-heading h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: .25rem 0 0;
}

.entity-address-panel address {
    font-style: normal;
    line-height: 1.65;
    margin: 0;
}

@media (max-width: 991.98px) {
    .entity-detail-grid,
    .entity-detail-grid-three,
    .entity-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entity-stat-grid > div:nth-child(3) {
        border-left: 0;
        border-top: 1px solid var(--ei-line);
    }

    .entity-stat-grid > div:nth-child(4) {
        border-top: 1px solid var(--ei-line);
    }
}

@media (max-width: 575.98px) {
    .entity-detail-grid,
    .entity-detail-grid-three,
    .entity-stat-grid {
        grid-template-columns: 1fr;
    }

    .entity-stat-grid > div + div {
        border-left: 0;
        border-top: 1px solid var(--ei-line);
    }
}
