:root {
    --ink: #152d39;
    --muted: #71818a;
    --line: #e8eeef;
    --bg: #f7f9f9;
    --blue: #1367e8;
    --navy: #092b3b;
    --mint: #e8f8f2;
    --danger: #d84b57;
    font-family: 'DM Sans', sans-serif;
    color: var(--ink)
}

/* Consistent title case for visible interface labels and names. */
button,
nav button,
.nav-item,
.settings-submenu button,
.page-heading h2,
.page-heading span,
.panel h3,
.setting-form-section h3,
.invoice-modal h2,
.form-grid > label,
.setting-form-section label,
.party-menu-item,
.invoice-print-button,
.header-row span,
.table-panel label,
.profile-actions button,
.modal-actions button {
    text-transform: capitalize;
}

button { transition: transform .08s ease, filter .08s ease, box-shadow .08s ease; }
button:active:not(:disabled) { transform: translateY(1px) scale(.98); filter: brightness(.96); }
.account-trigger.owner-hidden { display: none; }
.account-trigger.owner-no-avatar .avatar { display: none; }
.account-trigger.owner-no-name .account-trigger-copy strong { display: none; }
.account-trigger.owner-no-role .account-trigger-copy small { display: none; }
.account-trigger.owner-no-name.owner-no-role .account-trigger-copy { display: none; }

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg)
}

button,
input,
select {
    font: inherit
}

button {
    cursor: pointer;
    border: 0;
    background: none;
    color: inherit
}

.app-shell {
    display: flex;
    min-height: 100vh
}

.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 26px 15px 18px;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 10
}

.brand {
    font: 800 25px 'Manrope';
    letter-spacing: -1.5px;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 0 11px 33px
}

.brand-bottom {
    margin-top: auto;
    padding: 20px 11px 0;
    border-top: 1px solid var(--line)
}

.brand>span:last-child span {
    color: #146ee5
}

.brand-mark {
    width: 28px;
    height: 32px;
    border-radius: 9px 9px 9px 2px;
    color: #fff;
    background: linear-gradient(145deg, #1382ef, #0d4ec9);
    display: grid;
    place-items: center;
    font: 800 22px Georgia;
    box-shadow: 0 5px 12px #9dccfb
}

.workspace-label,
.nav-group {
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 700;
    color: #a6b1b6;
    margin: 0 11px 12px
}

.nav-group {
    margin-top: 24px
}

.nav {
    flex: 1
}

.nav-item {
    width: 100%;
    height: 43px;
    text-align: left;
    border-radius: 9px;
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 0 12px;
    margin: 3px 0;
    color: #687a84;
    font-size: 14px;
    font-weight: 600
}

.nav-item>span {
    font-size: 20px;
    width: 18px;
    text-align: center;
    font-weight: 400
}

.nav-item b {
    margin-left: auto;
    background: #edf2f3;
    color: #62747d;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 10px
}

.nav-item.active {
    background: #eaf3ff;
    color: #1264dc
}

.settings-nav-button i {
    margin-left: auto;
    font-size: 14px;
    font-style: normal;
    transition: transform .2s ease
}

.settings-nav-button[aria-expanded="true"] i {
    transform: rotate(180deg)
}

.settings-submenu {
    display: grid;
    gap: 2px;
    margin: 3px 0 7px 31px;
    padding-left: 12px;
    border-left: 1px solid #dce7eb
}

.settings-submenu[hidden] {
    display: none !important
}

.settings-submenu button {
    width: 100%;
    min-height: 29px;
    padding: 5px 8px;
    border-radius: 6px;
    color: #71818a;
    font-size: 11px;
    font-weight: 600;
    text-align: left
}

.settings-submenu button:hover,
.settings-submenu button:focus-visible {
    background: #eef5ff;
    color: #1264dc
}

.settings-submenu button.active {
    background: #eaf3ff;
    color: #1264dc
}

.settings-submenu .settings-logout {
    border-top: 1px solid #dce7eb;
    border-radius: 0;
    margin-top: 5px;
    padding-top: 9px;
    color: #c25342
}

.sidebar-account {
    position: relative;
    border-bottom: 1px solid var(--line);
    padding: 6px 8px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px
}

.business-workspace-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
    color: var(--ink);
    text-align: left
}

.business-workspace-trigger:hover .business-workspace-copy strong,
.business-workspace-trigger:focus-visible .business-workspace-copy strong {
    color: var(--blue)
}

.business-workspace-copy {
    min-width: 0
}

.store-icon,
.avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    overflow: hidden
}

.store-icon {
    width: 38px;
    height: 38px;
    background: #fff0db;
    color: #b16e1b
}

.store-icon img,
.avatar img,
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.store-icon span,
.avatar span,
.profile-avatar span {
    display: none
}

.store-icon img[hidden],
.avatar img[hidden],
.profile-avatar img[hidden] {
    display: none
}

.store-icon img[hidden]+span,
.avatar img[hidden]+span,
.profile-avatar img[hidden]+span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%
}

.sidebar-account strong {
    display: block;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px
}

.sidebar-account small {
    display: block;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    color: #8b9aa1
}

.more {
    margin-left: auto;
    color: #80909a
}

.main-content {
    margin-left: 250px;
    min-width: 0;
    width: calc(100% - 250px)
}

.topbar {
    height: 90px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0 38px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.breadcrumb span,
.page-heading p,
.modal-kicker {
    font-size: 10px;
    letter-spacing: 1.2px;
    color: #8f9ea5;
    font-weight: 700;
    margin: 0 0 5px
}

.breadcrumb h1 {
    font: 700 21px 'Manrope';
    letter-spacing: -.7px;
    margin: 0
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 13px
}

.icon-button {
    border: 1px solid var(--line);
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 20px;
    color: #60717a;
    position: relative
}

.notification i {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ed5965;
    border: 1px solid white;
    border-radius: 50%;
    top: 8px;
    right: 8px
}

.avatar {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #c9dff5;
    background: #d8ebff;
    color: #2269aa
}

.account-trigger {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-height: 42px;
    padding: 3px 5px 3px 3px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--ink);
    text-align: center
}

.account-trigger:hover,
.account-trigger:focus-visible {
    border-color: #d6e5f4;
    background: #f6faff;
    outline: 0
}

.account-trigger-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
    text-align: center
}

.account-trigger-copy strong {
    max-width: 122px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px
}

.account-trigger-copy small {
    max-width: 122px;
    overflow: hidden;
    color: #84949b;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap
}

.account-trigger-chevron {
    color: #82949c;
    font-size: 14px
}

.business-hover-card {
    display: none;
    position: absolute;
    z-index: 30;
    top: 47px;
    left: 4px;
    width: 235px;
    padding: 13px;
    border: 1px solid #d7e4ea;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 14px 32px #19344224
}

/* Business details are managed from Settings; do not show a floating card. */
.business-hover-card,
.business-hover-card.open,
.sidebar-account:hover .business-hover-card {
    display: none !important;
}

.business-hover-card.open,
.sidebar-account:hover .business-hover-card {
    display: grid;
    gap: 6px
}

.business-hover-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--line)
}

.business-hover-heading strong { font-size: 12px }
.business-hover-heading button { color: #7d8e95; font-size: 18px; line-height: 1 }
.business-hover-card>small { color: #6d8189; font-size: 10px }
.business-hover-card>small:empty { display: none }
.business-hover-card>button:last-child { margin-top: 4px; color: var(--blue); font-size: 10px; font-weight: 700; text-align: left }

.menu-toggle {
    display: none
}

.page {
    display: none;
    padding: 31px 38px 45px;
    max-width: 1500px;
    margin: auto
}

.page.active {
    display: block
}

.dashboard-heading,
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px
}

.dashboard-heading p,
.page-heading span {
    color: #839198;
    font-size: 13px;
    margin: 0 0 5px
}

.dashboard-heading h2,
.page-heading h2 {
    font: 700 22px 'Manrope';
    letter-spacing: -.8px;
    margin: 0
}

.page-heading {
    align-items: end
}

.page-heading h2 {
    font-size: 26px
}

.primary-button,
.outline-button {
    height: 39px;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 600;
    font-size: 13px
}

.primary-button {
    background: var(--blue);
    color: white;
    box-shadow: 0 4px 10px #cbdfff
}

.outline-button {
    border: 1px solid #d6e0e2;
    background: #fff;
    color: #4c606a
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 17px;
    margin-bottom: 18px
}

.metric-card,
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px
}

.metric-card {
    padding: 17px 18px
}

.metric-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 13px
}

.metric-top button {
    color: #9ba9ae
}

.metric-icon {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 700
}

.sales-icon {
    background: #e8f2ff;
    color: #1670e9
}

.receipt-icon {
    background: #e8faf1;
    color: #1d9a62
}

.due-icon {
    background: #fff5e1;
    color: #d28d0c
}

.stock-icon {
    background: #fff0f1;
    color: #de5963
}

.metric-card p {
    margin: 0 0 5px;
    font-size: 12px;
    color: #73828a
}

.metric-card h3 {
    font: 700 23px 'Manrope';
    letter-spacing: -1px;
    margin: 0 0 5px
}

.metric-card small {
    font-size: 10px;
    font-weight: 600
}

.metric-card small em {
    font-style: normal;
    color: #98a3a7;
    font-weight: 400
}

.positive {
    color: #199461
}

.warning {
    color: #c68209
}

.danger {
    color: var(--danger)
}

.content-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 18px
}

.panel {
    padding: 20px
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start
}

.panel-title h3,
.setting-card h3 {
    font: 700 15px 'Manrope';
    margin: 0 0 4px;
    letter-spacing: -.3px
}

.panel-title p,
.setting-card>p {
    font-size: 11px;
    color: #829099;
    margin: 0
}

.panel-title select {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
    color: #62737c;
    background: white;
    font-size: 10px
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 21px 0 0;
    font-size: 10px;
    color: #708088
}

.chart-legend i {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 4px
}

.blue-dot {
    background: var(--blue)
}

.chart-legend strong {
    font-size: 13px;
    color: var(--ink);
    margin-left: auto
}

.bar-chart {
    height: 172px;
    display: flex;
    align-items: end;
    gap: 19px;
    border-bottom: 1px solid #eef1f2;
    margin-top: 4px;
    padding: 0 10px
}

.bar-chart>div {
    background: #d6e8ff;
    border-radius: 5px 5px 0 0;
    flex: 1;
    max-width: 32px;
    position: relative;
    transition: .2s
}

.bar-chart>div.current {
    background: #1a70ec
}

.bar-chart span {
    position: absolute;
    top: calc(100% + 8px);
    font-size: 10px;
    color: #8b989d;
    left: 50%;
    transform: translateX(-50%)
}

.bar-chart b {
    background: #193847;
    color: #fff;
    font-size: 9px;
    font-weight: 500;
    padding: 4px 5px;
    border-radius: 4px;
    position: absolute;
    top: -27px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 17px
}

.quick-actions button {
    text-align: left;
    border: 1px solid var(--line);
    padding: 12px 10px;
    border-radius: 8px
}

.quick-actions i {
    display: grid;
    place-items: center;
    background: #edf5ff;
    color: #1770e8;
    border-radius: 6px;
    width: 25px;
    height: 25px;
    font-style: normal;
    font-size: 17px;
    margin-bottom: 8px
}

.quick-actions span {
    font-size: 11px;
    font-weight: 700;
    display: block
}

.quick-actions small {
    font-size: 10px;
    color: #8b999f
}

.lower-grid {
    margin-top: 18px;
    grid-template-columns: 1.45fr 1fr
}

.text-button {
    color: #1269df;
    font-size: 11px;
    font-weight: 600
}

.invoice-list {
    margin: 16px -20px -20px
}

.invoice-row {
    display: grid;
    grid-template-columns: 1.1fr 1.5fr .9fr .7fr;
    align-items: center;
    padding: 13px 20px;
    border-top: 1px solid #eef1f2;
    font-size: 11px;
    gap: 8px
}

.invoice-row strong {
    font-size: 11px
}

.invoice-row strong small {
    display: block;
    font-weight: 400;
    color: #9aa6ab;
    font-size: 9px;
    margin-top: 3px
}

.header-row {
    font-size: 9px !important;
    letter-spacing: .6px;
    color: #92a0a6;
    font-weight: 700;
    padding-top: 10px;
    padding-bottom: 10px
}

.header-row strong {
    font-size: 9px
}

.invoice-row label,
.product-row label {
    width: max-content;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 700
}

.paid,
.in-stock {
    color: #168552;
    background: #e7f7ef
}

.partial,
.low {
    color: #be7e0c;
    background: #fff4dd
}

.pending,
.out-stock {
    color: #c7444f;
    background: #fff0f1
}

.overdue {
    color: #b4232d;
    background: #fee2e5
}

.stock-list {
    margin-top: 13px
}

.stock-list>div {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 0;
    border-top: 1px solid #eef1f2
}

.product-color {
    width: 25px;
    height: 25px;
    border-radius: 6px
}

.yellow {
    background: #ffdc61
}

.red {
    background: #fa9a9e
}

.green {
    background: #a9dfaa
}

.stock-list span {
    font-size: 10px;
    font-weight: 600
}

.stock-list span small {
    display: block;
    font-weight: 400;
    color: #97a3a8;
    font-size: 9px;
    margin-top: 3px
}

.stock-list b {
    margin-left: auto;
    font-size: 11px
}

.stock-list b small {
    font-weight: 400;
    color: #91a0a5;
    font-size: 9px
}

.stock-list b.out {
    color: #d94d57
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 17px;
    padding: 12px
}

.search-box {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 10px;
    height: 35px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9aa8ae;
    flex: 1;
    max-width: 330px
}

.search-box input {
    border: 0;
    outline: 0;
    width: 100%;
    font-size: 11px
}

.toolbar select {
    border: 1px solid var(--line);
    border-radius: 7px;
    color: #71818a;
    font-size: 11px;
    padding: 0 8px
}

.sales-table .invoice-row {
    grid-template-columns: 1fr 1.5fr 1fr .8fr .6fr .58fr;
    padding-block: 16px
}

.invoice-print-button {
    height: 29px;
    padding: 0 9px;
    border: 1px solid #cbd9df;
    border-radius: 7px;
    background: #fff;
    color: #1763b9;
    font: 700 10px 'Manrope';
    cursor: pointer
}

.invoice-print-button:hover:not(:disabled) {
    border-color: #1763b9;
    background: #f2f8ff
}

.invoice-print-button:disabled {
    cursor: wait;
    opacity: .65
}

.invoice-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px
}

.invoice-action-menu { margin-left: auto; }

.invoice-extra-details,
.invoice-line-details {
    margin: 14px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff
}

.invoice-extra-details summary,
.invoice-line-details summary {
    cursor: pointer;
    padding: 10px 12px;
    color: #40606b;
    font: 700 10px 'Manrope'
}

.invoice-extra-details .form-grid {
    padding: 0 12px 12px
}

.invoice-line-details {
    grid-column: 1 / -1;
    margin: 3px 0 0
}

.line-extra-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    padding: 0 10px 10px
}

.line-extra-grid label {
    display: grid;
    gap: 4px;
    color: #71828a;
    font-size: 9px;
    font-weight: 700
}

.line-extra-grid input {
    width: 100%;
    min-width: 0;
    height: 31px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 8px;
    font-size: 10px
}

.signature-editor {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 84px;
    padding: 12px;
    border: 1px dashed #b9ccd6;
    border-radius: 8px;
    background: #fbfdff
}

.signature-editor img {
    width: 130px;
    height: 55px;
    object-fit: contain;
    border-radius: 5px;
    background: #fff
}

.signature-editor span {
    color: #80919a;
    font-size: 11px
}

.signature-editor .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-left: auto
}

.empty-panel {
    text-align: center;
    background: #fff;
    border: 1px dashed #ccd8dc;
    border-radius: 12px;
    padding: 72px 20px
}

.empty-panel>div {
    color: var(--blue);
    font-size: 31px;
    margin-bottom: 12px
}

.empty-panel h3 {
    font: 700 17px 'Manrope';
    margin: 0 0 7px
}

.empty-panel p {
    max-width: 410px;
    margin: 0 auto 20px;
    color: #7e8c92;
    font-size: 12px;
    line-height: 1.6
}

.compact .metric-card {
    padding: 16px
}

.inventory-table {
    padding-bottom: 0
}

.small {
    max-width: 180px;
    height: 31px
}

.product-row {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 1fr .8fr;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    font-size: 11px
}

.product-row strong small {
    display: block;
    color: #9aa5aa;
    font-weight: 400;
    font-size: 9px;
    margin-top: 3px
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px
}

.report-cards button {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    text-align: left;
    font-size: 21px;
    color: #2172de
}

.report-cards strong {
    display: block;
    color: var(--ink);
    font-size: 13px;
    margin: 16px 0 4px
}

.report-cards span {
    display: block;
    color: #87949a;
    font-size: 10px
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px
}

.setting-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line)
}

.setting-card-heading h3 {
    margin: 0 0 6px
}

.setting-card-heading p {
    margin: 0;
    color: #75858c;
    font-size: 12px;
    line-height: 1.5
}

.setting-card-heading .outline-button {
    flex: 0 0 auto
}

.business-profile-title {
    display: flex;
    align-items: center;
    gap: 13px
}

.business-logo-display,
.business-logo-editor-preview {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    color: #1269d8;
    font: 800 15px 'Manrope';
    background: #f2f7ff;
    border: 1px solid #d5e5fb;
    border-radius: 12px
}

.owner-avatar-editor-preview {
    border-radius: 50%;
}

.business-logo-display {
    width: 52px;
    height: 52px
}

.business-logo-display img,
.business-logo-editor-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff
}

.business-logo-form-section {
    border-color: #d5e5fb;
    background: #f9fcff
}

.business-logo-editor {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 14px
}

.business-logo-editor-preview {
    width: 86px;
    height: 86px;
    border-radius: 16px;
    font-size: 24px
}

.business-logo-editor-actions {
    display: grid;
    gap: 7px
}

.business-logo-editor-actions .button-group {
    align-items: center
}

.business-logo-editor-actions strong {
    color: var(--ink);
    font-size: 12px
}

.business-logo-editor-actions small {
    color: #73848c;
    font-size: 11px;
    line-height: 1.45
}

.danger-text {
    color: #bd3c39
}

.settings-data-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px
}

.settings-data-group {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fbfdfe
}

.settings-data-group h4 {
    margin: 0 0 5px;
    color: var(--ink);
    font: 700 12px 'Manrope'
}

.settings-data-group dl {
    display: block;
    margin: 0
}

.settings-data-group dt {
    margin-top: 13px
}

.settings-data-group dd {
    margin-top: 3px;
    min-height: 16px;
    color: #304752
}

.setting-extra-details {
    margin-top: 18px;
    padding: 14px 16px;
    border-left: 3px solid var(--blue);
    border-radius: 7px;
    background: #f5f9ff;
    color: #526770;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-line
}

.setting-editor-modal {
    width: min(940px, 100%)
}

.setting-editor-modal .modal-help {
    max-width: 680px
}

.setting-form-section {
    margin: 18px 0 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fcfdfe
}

.setting-form-section h3 {
    margin: 0 0 4px;
    color: var(--ink);
    font: 700 13px 'Manrope'
}

.setting-form-section > p {
    margin: 0 0 14px;
    color: #74848b;
    font-size: 11px;
    line-height: 1.45
}

.setting-form-section .form-grid {
    margin-top: 14px
}

.invoice-design-workspace {
    display: grid;
    grid-template-columns: minmax(360px, 1.25fr) minmax(260px, .75fr);
    gap: 20px;
    margin-top: 18px
}

.invoice-preview-wrap {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #f4f8fa
}

.invoice-preview-wrap > span {
    display: block;
    margin-bottom: 10px;
    color: #829198;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .8px
}

.invoice-design-preview {
    --invoice-accent: #1269D8;
    position: relative;
    overflow: hidden;
    min-height: 320px;
    padding: 24px;
    border: 1px solid #d9e2e7;
    border-top: 5px solid var(--invoice-accent);
    background: #fff;
    box-shadow: 0 4px 16px #1433420a;
    color: #263e48;
    font-size: 10px
}

.design-preview-watermark {
    position: absolute;
    z-index: 0;
    top: 47%;
    left: 50%;
    color: #193f5010;
    font: 800 36px 'Manrope';
    letter-spacing: 5px;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-24deg)
}

.invoice-design-preview>*:not(.design-preview-watermark) {
    position: relative;
    z-index: 1
}

.design-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid color-mix(in srgb, var(--invoice-accent) 38%, white)
}

.design-preview-brand {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 9px
}

.design-preview-logo {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 4px
}

.design-preview-document {
    display: grid;
    justify-items: end;
    gap: 4px;
    text-align: right
}

.design-preview-copy {
    padding: 2px 4px;
    border: 1px solid #bfcbd1;
    color: #6c7d84;
    font-size: 7px
}

.design-preview-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 10px 0;
    color: #7b8c93;
    font-size: 8px
}

.design-preview-meta span,
.design-preview-meta b {
    display: block
}

.design-preview-meta b {
    margin-top: 3px;
    color: #405b65;
    font-size: 9px
}

.design-preview-header strong,
.design-preview-header small {
    display: block
}

.design-preview-header strong {
    color: var(--invoice-accent);
    font-size: 17px
}

.design-preview-header small {
    max-width: 260px;
    margin-top: 5px;
    color: #75868e;
    line-height: 1.45
}

.design-preview-header > b {
    color: var(--invoice-accent);
    font-size: 12px;
    letter-spacing: .8px
}

.design-preview-party,
.design-preview-bank,
.design-preview-signatory,
.design-preview-footer {
    color: #60747d;
    line-height: 1.45
}

.design-preview-party { margin: 17px 0 11px }

.invoice-design-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0
}

.invoice-design-preview th,
.invoice-design-preview td {
    padding: 8px 6px;
    border-bottom: 1px solid #e2e9ec;
    text-align: left
}

.invoice-design-preview th {
    background: color-mix(in srgb, var(--invoice-accent) 9%, white);
    color: var(--invoice-accent);
    font-size: 9px
}

.invoice-design-preview .right { text-align: right }

.design-preview-total {
    display: flex;
    justify-content: flex-end;
    gap: 40px;
    padding: 10px 6px;
    color: var(--invoice-accent);
    font-size: 12px
}

.design-preview-words {
    display: block;
    margin-top: 8px;
    color: #71838a;
    font-size: 8px
}

.design-preview-bank { margin: 20px 0 0 }
.design-preview-signatory { margin: 22px 0 0; text-align: right }
.design-preview-footer { margin: 20px 0 0; padding-top: 11px; border-top: 1px solid #e2e9ec; text-align: center }

.theme-modern { border-radius: 7px }
.theme-modern .design-preview-header { align-items: center }
.theme-modern .design-preview-header { margin: -24px -24px 0; padding: 20px 24px; background: var(--invoice-accent); border: 0 }
.theme-modern .design-preview-header strong,
.theme-modern .design-preview-header > b,
.theme-modern .design-preview-header small,
.theme-modern .design-preview-copy { color: #fff }
.theme-modern .design-preview-copy { border-color: #ffffff88 }
.theme-minimal { border-top-width: 2px; box-shadow: none }
.theme-minimal .design-preview-header { border-bottom: 0 }

.invoice-design-summary {
    min-width: 0;
    padding: 2px 0
}

.invoice-design-summary dl {
    margin: 0
}

.invoice-design-summary dd {
    margin-bottom: 14px
}

.invoice-colour-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 7px;
    border: 1px solid #d5dde1;
    border-radius: 50%;
    vertical-align: -2px
}

.print-field-list {
    margin-top: 18px;
    padding: 13px;
    border-radius: 9px;
    background: #f4f8fa;
    color: #60737b;
    font-size: 11px;
    line-height: 1.55
}

.print-field-list strong,
.print-field-list span { display: block }
.print-field-list strong { color: var(--ink); font-size: 10px; text-transform: uppercase; letter-spacing: .6px }

.design-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 13px
}

.design-toggle-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 39px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #536971;
    font-size: 11px
}

.design-toggle-grid input { accent-color: var(--blue) }

.colour-presets {
    display: flex;
    gap: 8px;
    margin-top: 14px
}

.colour-presets button {
    width: 27px;
    height: 27px;
    border: 2px solid #fff;
    border-radius: 50%;
    outline: 1px solid #d9e1e4;
    background: var(--swatch)
}

.invoice-design-modal-preview {
    margin-top: 18px;
    transform-origin: top center
}

.invoice-design-modal-preview .invoice-design-preview {
    min-height: 230px;
    transform: scale(.86);
    width: 116.28%;
    margin-bottom: -38px
}

.setting-card dl {
    margin: 18px 0;
    display: grid;
    grid-template-columns: minmax(110px, .8fr) 1.2fr;
    gap: 9px 16px;
    font-size: 11px
}

.setting-card dt {
    color: #829096;
    font-weight: 600
}

.setting-card dd {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
    overflow-wrap: anywhere
}

.setting-card .setting-multiline {
    white-space: pre-line;
    font-weight: 400;
    line-height: 1.5
}

.form-span-2 {
    grid-column: 1 / -1
}

.modal-help {
    color: #71838c;
    font-size: 12px;
    line-height: 1.5;
    margin: -7px 0 17px
}

.help-list {
    display: grid;
    gap: 12px;
    margin: 0 0 20px
}

.help-list div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fbfd
}

.help-list strong,
.help-list span {
    display: block
}

.help-list strong {
    font-size: 12px;
    color: var(--ink)
}

.help-list span {
    margin-top: 4px;
    color: #71818a;
    font-size: 11px;
    line-height: 1.5
}

.report-detail-grid {
    margin-top: 18px
}

.staff-list {
    margin: 0 0 16px
}

.staff-row {
    display: flex;
    gap: 9px;
    align-items: center;
    border-top: 1px solid var(--line);
    padding: 10px 0;
    font-size: 11px
}

.staff-row:first-child {
    border-top: 0
}

.staff-row strong {
    display: block;
    font-size: 11px
}

.staff-row small {
    color: #839198;
    display: block;
    margin-top: 2px
}

.staff-row span {
    margin-left: auto;
    border-radius: 12px;
    padding: 3px 7px;
    background: #eef5ff;
    color: #286dcc;
    font-size: 9px;
    text-transform: capitalize
}

.modal-staff-list {
    max-height: 170px;
    overflow-y: auto
}

.modal-rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 17px 0
}

.subheading {
    font: 700 14px 'Manrope';
    margin: 0 0 14px
}

.ledger-balance {
    color: var(--blue);
    font: 700 18px 'Manrope';
    margin: -12px 0 17px
}

.ledger-history {
    max-height: 320px;
    overflow-y: auto
}

.ledger-history .ledger-row {
    grid-template-columns: 1fr auto;
    gap: 4px;
    align-items: center
}

.ledger-history .ledger-row small {
    grid-column: 1 / 2
}

.ledger-history .ledger-row strong {
    grid-column: 2;
    grid-row: 1 / 3
}

.setting-card {
    padding: 24px
}

.setting-card>p {
    margin-bottom: 20px
}

.tax-choice {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px;
    margin-bottom: 9px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.tax-choice>div {
    display: flex;
    align-items: center;
    gap: 10px
}

.tax-choice i {
    width: 16px;
    height: 16px;
    border: 1px solid #cbd4d8;
    border-radius: 50%;
    font-size: 10px;
    font-style: normal;
    display: grid;
    place-items: center;
    color: white
}

.tax-choice strong {
    font-size: 11px
}

.tax-choice strong small {
    font-size: 9px;
    color: #8e9ba1;
    display: block;
    font-weight: 400;
    margin-top: 3px
}

.tax-choice.selected {
    border-color: #86b9fa;
    background: #f5f9ff
}

.tax-choice.selected i {
    background: var(--blue);
    border-color: var(--blue)
}

.tax-choice>span {
    font-size: 9px;
    background: #e7f7ef;
    color: #168552;
    padding: 3px 6px;
    border-radius: 10px
}

dl {
    margin: 0 0 20px
}

dt {
    font-size: 10px;
    color: #8b999f;
    margin-top: 11px
}

dd {
    font-size: 12px;
    font-weight: 600;
    margin: 3px 0
}

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: #092b3b88;
    z-index: 20;
    align-items: center;
    justify-content: center;
    padding: 15px;
    overflow-y: auto
}

.modal-backdrop.open {
    display: flex
}

.invoice-modal {
    width: min(570px, 100%);
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    position: relative
}

.transaction-modal {
    width: min(1040px, calc(100vw - 40px));
    max-height: calc(100vh - 24px);
    padding: clamp(28px, 3vw, 38px);
    --invoice-gap: 16px;
}
.transaction-modal > h2 { padding-right: 250px; }
.transaction-modal:not(:has(.invoice-top-actions)) > h2 { padding-right: 0; }
.invoice-top-actions { position: absolute; top: 25px; right: 44px; margin: 0; gap: 6px; }
.invoice-top-actions button { width: 92px; min-height: 36px; padding: 8px 6px; font-size: 11px; }

.invoice-editor-layout { display: grid; grid-template-columns: calc(66.6667% - 5.33px) calc(33.3333% - 4.67px); gap: 10px; align-items: start; }
.invoice-editor-main { min-width: 0; }
.invoice-editor-side { min-width: 0; display: grid; gap: var(--invoice-gap); align-content: start; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.invoice-header-grid { grid-template-columns: repeat(3, calc(33.3333% - 10.67px)); gap: var(--invoice-gap); margin-bottom: var(--invoice-gap); }
.invoice-header-grid > label { min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; }
.invoice-header-grid > label > input, .invoice-header-grid > label > select { width: 100%; min-height: 38px; }
.invoice-bottom-grid { width: 100%; margin-top: var(--invoice-gap); }
.invoice-editor-main .line-items { margin-top: 0; }
.invoice-editor-main, .invoice-editor-side, .invoice-editor-main .line-items, .invoice-shipping-panel { width: 100%; }
.invoice-editor-layout > *, .invoice-editor-side > * { min-width: 0; }
.invoice-shipping-panel { margin: 0; }
.copy-customer-details-button { display: block; margin: 8px auto 0; padding: 5px 9px; border: 1px solid #b9d4e4; border-radius: 6px; background: #fff; color: #146ee5; font-size: 10px; font-weight: 700; text-align: center; transition: transform .08s ease, background .15s ease, color .15s ease, border-color .15s ease; }
.copy-customer-details-button:hover { background: #eef7ff; border-color: #7db5e8; }
.copy-customer-details-button:active { transform: translateY(1px) scale(.98); }
.copy-customer-details-button.is-copied { background: #eaf8f0; border-color: #75c894; color: #18733b; }
.customer-field, .party-autocomplete { position: relative; }
.customer-suggestion-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); max-height: 180px; overflow-y: auto; border: 1px solid #d8e4e8; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px #12364b1c; }
.customer-suggestion-list button { display: block; width: 100%; padding: 9px 10px; border: 0; border-bottom: 1px solid #edf2f4; background: #fff; color: #24485b; text-align: left; font-size: 12px; }
.customer-suggestion-list button:last-child { border-bottom: 0; }
.customer-suggestion-list button:hover { background: #f1f7fb; }
.customer-suggestion-list small { display: block; margin-top: 2px; color: #8a9aa1; font-size: 10px; }
.party-detail-preview { margin-top: 14px; padding: 11px 13px; border: 1px solid #dce7eb; border-radius: 8px; background: #f8fbfd; color: #607985; font-size: 11px; line-height: 1.5; }
.party-detail-preview strong, .party-detail-preview span { display: block; }
.party-detail-preview strong { color: #183d4d; font-size: 12px; }
.party-detail-edit { margin-top: 8px; padding: 4px 7px; border: 1px solid #b9d4e4; border-radius: 5px; background: #fff; color: #146ee5; font-size: 10px; font-weight: 700; }
.invoice-live-summary { position: sticky; top: 0; border: 1px solid #dce7eb; border-radius: 12px; background: #f8fbfd; padding: 16px; }
.transaction-modal { position: relative; }
.transaction-modal.editing-document { border-top: 3px solid #146ee5; }
.transaction-modal .invoice-editor-side { padding-top: 0; }
.transaction-modal .invoice-live-summary { position: relative; top: auto; width: auto; }
.transaction-modal .invoice-header-grid { width: 100%; grid-template-columns: repeat(3, calc(33.3333% - 10.67px)); }
.invoice-summary-heading { display: grid; gap: 4px; border-bottom: 1px solid #dce7eb; padding-bottom: 12px; text-align: center; }
.invoice-summary-heading span { font-size: 10px; letter-spacing: 1.1px; color: #7e929d; font-weight: 800; }
.invoice-summary-heading strong { font-size: 15px; color: #12364b; }
.invoice-summary-customer { color: #607985; font-size: 12px; padding: 12px 0; border-bottom: 1px solid #dce7eb; overflow-wrap: anywhere; }
.invoice-summary-number { padding: 13px 0 10px; border-bottom: 1px solid #dce7eb; text-align: center; }
.invoice-summary-number small { display: block; color: #80939c; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
.invoice-summary-number strong { display: block; margin-top: 4px; color: #146ee5; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.invoice-number-preview { color: #9aa8ae; background: #f7f9fa; }
.invoice-shipping-panel .form-grid { grid-template-columns: 1fr; }
.invoice-summary-items { display: grid; gap: 8px; padding: 12px 0; max-height: 210px; overflow: auto; }
.invoice-summary-items > div { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #24485b; }
.invoice-summary-items small { display: block; color: #8397a0; font-size: 10px; margin-top: 2px; }
.invoice-summary-items p, .invoice-summary-note { color: #8397a0; font-size: 11px; margin: 0; }
.invoice-summary-values { display: grid; gap: 7px; border-top: 1px solid #dce7eb; padding-top: 12px; }
.invoice-summary-values span { display: flex; justify-content: space-between; color: #607985; font-size: 11px; }
.invoice-summary-values em { font-style: normal; }
.invoice-summary-values b { color: #24485b; }
.invoice-summary-total { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #bdd7e4; margin-top: 12px; padding-top: 12px; color: #12364b; font-weight: 800; }
.invoice-summary-total strong { color: #146ee5; font-size: 18px; }
.invoice-summary-note { margin-top: 12px; line-height: 1.4; text-align: center; }

.close-modal {
    position: absolute;
    right: 15px;
    top: 11px;
    width: 24px;
    height: 24px;
    border: 1px solid #f0b8bd;
    border-radius: 7px;
    background: #fff1f2;
    color: #c53d49;
    font-size: 16px;
    line-height: 1
}

.invoice-modal h2 {
    font: 700 22px 'Manrope';
    margin: 0 0 22px
}

.form-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 13px
}

.form-grid label {
    font-size: 10px;
    font-weight: 700;
    color: #71818a
}

.form-grid input {
    display: block;
    border: 1px solid var(--line);
    padding: 9px;
    border-radius: 6px;
    width: 100%;
    margin-top: 5px;
    font-size: 11px
}

.form-grid select,
.form-grid textarea {
    display: block;
    border: 1px solid var(--line);
    padding: 9px;
    border-radius: 6px;
    width: 100%;
    margin-top: 5px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 11px
}

.form-grid textarea {
    resize: vertical;
    min-height: 66px
}

.form-span-two {
    grid-column: 1 / -1
}

.line-items {
    margin: 21px 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden
}

.line-items>div {
    display: grid;
    grid-template-columns: 2fr .8fr .65fr .8fr .8fr .85fr .28fr;
    align-items: center;
    gap: 6px;
    padding: 9px;
    font-size: 10px
}

.line-items>div:first-child {
    background: #f7f9f9;
    color: #809096;
    font-size: 9px;
    font-weight: 700
}

.line-items>#invoiceItems {
    display: block;
    padding: 0
}
.line-items .add-item-inside { display: block; margin: 10px 12px 12px; }

.invoice-line {
    display: grid;
    grid-template-columns: 2fr .8fr .65fr .8fr .8fr .85fr .28fr;
    align-items: center;
    gap: 6px;
    padding: 9px;
    border-top: 1px solid #edf1f2
}

.line-items input {
    width: 100%;
    border: 1px solid var(--line);
    padding: 5px;
    border-radius: 4px;
    font-size: 10px
}

.line-items .line-code { background: #f7f9fa; color: #6d828c; }
.line-items .invoice-line > strong { display: block; min-width: 0; padding: 5px 6px; border: 1px solid var(--line); border-radius: 5px; background: #f8fbfc; color: #183d4d; font-size: 10px; text-align: right; }

.line-items select {
    width: 100%;
    border: 1px solid var(--line);
    padding: 5px;
    border-radius: 4px;
    background: #fff;
    font-size: 10px
}

.line-items .remove-line {
    color: #c9535c;
    font-size: 18px;
    line-height: 1
}

.invoice-notes {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #71818a;
    margin-top: 13px
}

.invoice-notes input {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    padding: 9px;
    border-radius: 6px;
    margin-top: 5px;
    font-size: 11px
}

.invoice-total {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    margin-top: 19px;
    padding-top: 14px;
    font-size: 12px
}

.invoice-total strong {
    font-size: 17px
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 24px
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: #183843;
    color: #fff;
    padding: 13px 17px;
    border-radius: 8px;
    font-size: 12px;
    transform: translateY(100px);
    transition: .25s;
    z-index: 30
}

.toast.show {
    transform: translateY(0)
}

@media(max-width:1050px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .content-grid {
        grid-template-columns: 1fr
    }

    .quick-actions {
        grid-template-columns: repeat(4, 1fr)
    }

    .lower-grid {
        grid-template-columns: 1fr
    }

    .report-cards {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:720px) {
    .sidebar {
        transform: translateX(-100%);
        transition: .25s
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px #0002
    }

    .main-content {
        margin: 0;
        width: 100%
    }

    .topbar {
        height: 72px;
        padding: 0 18px
    }

    .menu-toggle {
        display: block;
        font-size: 20px;
        margin-right: 10px
    }

    .breadcrumb {
        margin-right: auto
    }

    .breadcrumb h1 {
        font-size: 16px
    }

    .top-actions .icon-button:first-child {
        display: none
    }

    .account-trigger {
        gap: 0;
        padding: 2px
    }

    .account-trigger-copy,
    .account-trigger-chevron {
        display: grid
    }

    .account-trigger-copy {
        max-width: 56px
    }

    .account-trigger-copy small {
        display: none
    }

    .account-trigger-copy strong {
        max-width: 56px;
        font-size: 8px
    }

    .page {
        padding: 22px 16px
    }

    .dashboard-heading,
    .page-heading {
        align-items: flex-start;
        gap: 14px
    }

    .dashboard-heading h2 {
        font-size: 17px
    }

    .page-heading h2 {
        font-size: 22px
    }

    .primary-button {
        padding: 0 12px;
        white-space: nowrap
    }

    .metrics-grid {
        gap: 10px
    }

    .metric-card {
        padding: 13px
    }

    .metric-card h3 {
        font-size: 19px
    }

    .content-grid {
        gap: 10px
    }

    .panel {
        padding: 15px
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr
    }

    .invoice-row {
        grid-template-columns: 1fr 1.2fr .7fr !important;
        padding: 12px 10px
    }

    .invoice-row>*:nth-child(3) {
        display: none
    }

    .header-row>*:nth-child(3) {
        display: none
    }

    .invoice-row>*:nth-child(4) {
        text-align: right
    }

    .invoice-row>*:nth-child(5) {
        display: none
    }

    .invoice-row>*:nth-child(6) {
        display: inline-flex;
        grid-column: 1 / -1;
        justify-self: start;
        margin-top: 2px
    }

    .header-row>*:nth-child(6) {
        display: none
    }

    .invoice-row-actions {
        gap: 4px
    }

    .invoice-print-button {
        padding: 0 7px
    }

    .invoice-line {
        grid-template-columns: 1.7fr .75fr .55fr .65fr .7fr .75fr .22fr
    }

    .line-extra-grid {
        grid-template-columns: 1fr 1fr
    }

    .signature-editor {
        align-items: flex-start;
        flex-wrap: wrap
    }

    .signature-editor .button-group {
        width: 100%;
        margin-left: 0
    }

    .invoice-list {
        margin-inline: -15px
    }

    .product-row {
        grid-template-columns: 1.6fr 1fr .8fr;
        padding: 12px 0
    }

    .product-row>*:nth-child(3),
    .product-row>*:nth-child(4) {
        display: none
    }

    .settings-layout {
        grid-template-columns: 1fr
    }

    .report-cards {
        grid-template-columns: 1fr 1fr
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .bar-chart {
        gap: 9px
    }

    .page-heading .outline-button {
        font-size: 0
    }

    .page-heading .outline-button:after {
        content: '⇩';
        font-size: 16px
    }

    .invoice-modal {
        padding: 22px 17px
    }

    .transaction-modal {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        padding: 22px 17px;
    }

    .transaction-modal > h2 { padding-right: 0; }
    .invoice-top-actions { position: static; justify-content: flex-start; flex-wrap: wrap; margin: -8px 0 18px; padding-right: 28px; }

    .invoice-editor-layout { grid-template-columns: 1fr; gap: var(--invoice-gap); }
    .invoice-live-summary { position: static; }
    .transaction-modal .invoice-editor-side { padding-top: 0; }
    .transaction-modal .invoice-editor-side { position: static; max-height: none; overflow: visible; }
    .transaction-modal .invoice-live-summary { position: static; width: auto; }
    .transaction-modal .invoice-header-grid { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-header-grid { gap: 16px; }
}

.auth-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: #092b3b88;
    z-index: 20;
    align-items: center;
    justify-content: center;
    padding: 15px
}

.auth-backdrop.open {
    display: flex
}

.auth-modal {
    width: min(430px, 100%);
    background: #fff;
    border-radius: 14px;
    padding: 31px;
    position: relative
}

.auth-logo {
    font: 800 22px 'Manrope';
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 24px
}

.auth-logo .auth-brand-icon {
    width: 48px;
    height: 48px;
    margin-right: 10px;
    object-fit: contain;
    border-radius: 13px;
    box-shadow: 0 6px 14px #1269d838
}

.auth-logo .brand-mark {
    font-size: 19px
}

.auth-logo>span:last-child {
    color: #102a4c
}

.auth-logo>span:last-child span {
    color: #146ee5
}

.auth-modal h2 {
    font: 700 22px 'Manrope';
    letter-spacing: -.7px;
    margin: 0 0 5px
}

.auth-subtitle {
    font-size: 12px;
    color: #7a898f;
    line-height: 1.55;
    margin: 0 0 20px
}

.auth-modal form label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #65767e;
    margin: 12px 0
}

.auth-modal form input,
.auth-modal form select {
    display: block;
    width: 100%;
    border: 1px solid #dce5e7;
    border-radius: 7px;
    padding: 10px;
    margin-top: 5px;
    font-size: 12px;
    color: var(--ink);
    background: #fff
}

.auth-modal form input:focus,
.auth-modal form select:focus {
    outline: 2px solid #d7e9ff;
    border-color: #6eaafa
}

.auth-submit {
    width: 100%;
    margin-top: 8px
}

.auth-switch {
    text-align: center;
    color: #7b8a91;
    font-size: 11px;
    margin: 17px 0 0
}

.auth-switch button {
    color: #1269df;
    font-weight: 700
}

.form-error {
    min-height: 15px;
    color: #d34955;
    font-size: 10px;
    margin: 6px 0 0
}

.hidden {
    display: none !important
}

.brand-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 8px;
}

.profile-menu {
    display: none;
    position: fixed;
    z-index: 25;
    top: 76px;
    left: 18px;
    right: auto;
    width: min(320px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 18px 48px rgba(16, 44, 57, .18);
    padding: 17px
}

.owner-account-menu {
    display: none;
    position: fixed;
    z-index: 25;
    top: 76px;
    right: 34px;
    width: min(340px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 18px 48px rgba(16, 44, 57, .18);
    padding: 17px;
}
.owner-account-menu.open { display: block; animation: account-preview-in .14s ease-out; }
.owner-popup-identity { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.owner-popup-identity { gap: 12px; }
.owner-popup-identity .profile-avatar { width: 75px; height: 75px; flex: 0 0 75px; margin-bottom: 2px; font-size: 20px; }
.owner-popup-identity > div:last-child { display: grid; gap: 3px; margin-top: 10px; position: relative; z-index: 1; background: #fff; padding: 1px 6px 0; }
.owner-display-divider { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.owner-display-grid { margin-top: 0; }
.business-display-divider { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }

.profile-menu.open {
    display: block
}

.profile-menu.preview {
    display: block;
    animation: account-preview-in .14s ease-out
}


@keyframes account-preview-in {
    from { opacity: 0; transform: translateY(-4px) }
    to { opacity: 1; transform: translateY(0) }
}

.profile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--line)
}

.profile-menu-header p {
    margin: 0;
    color: #91a0a6;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px
}

.profile-menu-header button {
    color: #71818a;
    font-size: 22px;
    line-height: 1
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 0
}

.profile-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #d8ebff;
    color: #2269aa;
    font-size: 13px;
    font-weight: 700
}

.profile-identity strong,
.profile-identity small {
    display: block
}

.owner-profile-photo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px dashed #cbdce5;
    border-radius: 9px;
    background: #fbfdff
}

.owner-profile-photo .profile-avatar {
    flex: 0 0 64px;
    width: 64px;
    height: 64px
}

.owner-profile-photo>div:last-child {
    display: grid;
    gap: 6px
}

.owner-profile-photo small {
    color: #7a8c94;
    font-size: 10px
}

.profile-identity strong {
    font-size: 13px
}

.profile-identity small {
    max-width: 205px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 3px;
    color: #7c8b91;
    font-size: 11px
}

.profile-details {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 14px 0;
    border-block: 1px solid var(--line)
}

.profile-details div {
    display: flex;
    justify-content: space-between;
    gap: 16px
}

.profile-details dt {
    color: #87969c;
    font-size: 11px
}

.profile-details dd {
    margin: 0;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    text-align: right
}

.profile-actions {
    padding-top: 9px
}

.profile-actions button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 10px 6px;
    border-radius: 7px;
    color: #405660;
    font-size: 12px;
    font-weight: 600;
    text-align: left
}

.profile-actions button:hover {
    background: #f3f7f8
}

.profile-actions button span {
    width: 15px;
    text-align: center;
    font-size: 16px
}

.profile-actions .sign-out {
    color: #c8434e
}

.button-group {
    display: flex;
    gap: 9px;
    align-items: center
}

.party-metrics {
    grid-template-columns: repeat(3, 1fr)
}

.party-toolbar {
    align-items: center
}

.contact-row {
    display: grid;
    grid-template-columns: 1.45fr .7fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    font-size: 11px
}

.contact-row strong {
    font-size: 12px
}

.contact-row .text-button {
    font-size: 10px;
    white-space: nowrap
}

.contact-row strong small {
    display: block;
    color: #8b989e;
    margin-top: 3px;
    font-size: 9px;
    font-weight: 400
}

.party-balance {
    font-weight: 700;
    white-space: nowrap
}

.party-balance.receivable {
    color: #c17c05
}

.party-balance.payable {
    color: #c14a55
}

.party-balance.settled {
    color: #198c61
}

.party-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative
}

.party-menu {
    position: relative
}

.party-menu-toggle {
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #59707a;
    font-size: 19px;
    line-height: 1;
    background: transparent
}

.party-menu-toggle:hover,
.party-menu.open .party-menu-toggle {
    background: #eef5ff;
    border-color: #d5e5fa;
    color: var(--blue)
}

.party-menu-list {
    display: none;
    position: absolute;
    z-index: 12;
    top: calc(100% + 5px);
    right: 0;
    min-width: 145px;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: 0 12px 28px #19344224
}

.party-menu.open .party-menu-list {
    display: grid
}

.party-menu-item {
    width: 100%;
    padding: 8px 9px;
    border-radius: 6px;
    text-align: left;
    color: #405660;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap
}

.party-menu-item:hover {
    background: #f3f7f8
}

.party-menu-item.danger {
    color: #c4434e
}

.party-menu-item.danger:hover {
    background: #fff1f2
}

/* A Party editor must be on top of an invoice or purchase being edited. */
#contactModal.party-editor-layer { z-index: 80; }
.party-management-modal { width: min(1060px, calc(100vw - 40px)); max-height: calc(100vh - 24px); }
.party-form-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 17px; }
.party-form-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.party-form-section h3 { margin: 0; font-size: 13px; color: #173b4a; }
.party-form-section > p, .party-form-section-heading p { margin: 5px 0 13px; color: #748a95; font-size: 11px; line-height: 1.45; }
.party-form-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.party-profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.party-address-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.party-address-grid .form-span-two { grid-column: span 2; }
.small-action { min-height: 32px; padding: 6px 9px; white-space: nowrap; font-size: 10px; }
.party-duplicate-hint { padding: 9px 11px; border: 1px solid #f2d498; border-radius: 8px; background: #fff9eb; color: #946007; font-size: 11px; line-height: 1.45; }
.party-attachment-list { display: grid; gap: 7px; }
.party-attachment { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid #dce6e9; border-radius: 8px; background: #fbfdfe; font-size: 11px; }
.party-attachment strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-attachment small { color: #7a909a; white-space: nowrap; }
.party-attachment a, .party-attachment button { color: #146ee5; font-size: 10px; font-weight: 700; }
.party-attachment button { border: 0; background: transparent; color: #c4434e; }
.party-history-modal { width: min(760px, calc(100vw - 36px)); }
.party-history-toolbar { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 9px; margin: 0 0 10px; }
.party-history-toolbar select, .party-history-toolbar input { min-width: 0; }
.party-history-row { grid-template-columns: 1fr auto; }
.party-history-row .party-history-meta { grid-column: 1 / -1; color: #768b95; font-size: 10px; line-height: 1.45; }
.party-history-row .party-history-actions { grid-column: 1 / -1; display: flex; gap: 9px; margin-top: 3px; }
.party-history-row .text-button { padding: 0; font-size: 10px; }

.ledger-list {
    margin-top: 12px
}

.ledger-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 12px;
    align-items: center;
    padding: 13px 0;
    border-top: 1px solid var(--line);
    font-size: 11px
}

.ledger-row span {
    font-weight: 600
}

.ledger-row small {
    grid-column: 1;
    color: #87959b;
    font-size: 10px
}

.ledger-row strong {
    grid-column: 2;
    grid-row: 1 / 3;
    font-size: 12px
}

.no-data,
.empty-chart {
    color: #7d8b92;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    padding: 38px 16px
}

.empty-chart {
    height: 190px;
    display: grid;
    place-items: center
}

@media(max-width:720px) {
    .profile-menu {
        top: 62px;
        right: 16px
    }

    .party-metrics {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px
    }

    .party-metrics .metric-card {
        padding: 12px
    }

    .party-metrics .metric-card h3 {
        font-size: 16px
    }

    .party-metrics .metric-card small {
        display: none
    }

    .party-toolbar {
        flex-wrap: wrap
    }

    .party-toolbar .search-box {
        min-width: 100%;
        max-width: none
    }

    .party-toolbar select {
        height: 35px
    }

    .contact-row {
        grid-template-columns: 1fr auto;
        gap: 7px
    }

    .contact-row>*:nth-child(2),
    .contact-row>*:nth-child(3) {
        display: none
    }

    .contact-row>*:nth-child(4) {
        display: block;
        grid-column: 1
    }

    .contact-row.header-row>*:nth-child(4) {
        display: none
    }

    .contact-row .party-actions {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end
    }

    .party-menu-list {
        right: 0
    }

    .button-group {
        gap: 6px
    }

    .button-group .outline-button,
    .button-group .primary-button {
        padding-inline: 10px
    }

    .setting-card-heading {
        flex-direction: column;
        gap: 12px
    }

    .setting-card-heading .outline-button {
        width: 100%
    }

    .settings-data-grid,
    .invoice-design-workspace,
    .design-toggle-grid {
        grid-template-columns: 1fr
    }

    .settings-data-grid {
        gap: 12px
    }

    .setting-editor-modal {
        width: min(100%, 580px)
    }

    .business-logo-editor {
        align-items: flex-start
    }

    .business-logo-editor-actions .button-group {
        flex-wrap: wrap
    }

    .setting-form-section {
        padding: 14px
    }

    .invoice-design-preview {
        min-height: 270px;
        padding: 17px
    }

.design-preview-header strong {
        font-size: 14px
    }
}

@media (max-width: 760px) {
    .party-management-modal { width: calc(100vw - 18px); padding: 20px 15px; }
    .party-profile-grid, .party-address-grid, .party-history-toolbar { grid-template-columns: 1fr; }
    .party-address-grid .form-span-two { grid-column: auto; }
    .party-form-section-heading { align-items: stretch; flex-direction: column; }
    .party-form-section-heading .small-action { width: 100%; }
    .party-history-toolbar select, .party-history-toolbar input { width: 100%; }
}
