:root {
    --ink: #111111;
    --ink-soft: #242624;
    --green: #15803d;
    --green-dark: #0f6732;
    --green-light: #e7f5eb;
    --canvas: #f4f6f1;
    --surface: #ffffff;
    --surface-soft: #f8faf7;
    --border: #dfe4dc;
    --border-strong: #cbd3c9;
    --text: #202420;
    --muted: #687167;
    --danger: #b42318;
    --danger-light: #fef0ee;
    --warning: #9a6700;
    --warning-light: #fff8df;
    --blue: #175cd3;
    --blue-light: #eff5ff;
    --shadow-sm: 0 1px 2px rgb(17 24 17 / 7%);
    --shadow-md: 0 14px 36px rgb(17 24 17 / 10%);
    --sidebar-width: 252px;
    --radius: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-height: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--canvas);
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.is-locked {
    overflow: hidden;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
.brand-copy strong,
.metric strong {
    font-family: "Manrope", sans-serif;
}

svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    stroke-width: 1.8;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 6px;
    color: #ffffff;
    background: var(--green);
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.brand-copy {
    display: grid;
    min-width: 0;
}

.brand-copy strong {
    overflow: hidden;
    font-size: 17px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.brand--light {
    color: #ffffff;
}

.brand--light .brand-copy small {
    color: #9da49d;
}

.brand--dark .brand-mark {
    border-color: var(--ink);
    color: #ffffff;
    background: var(--ink);
    box-shadow: inset 0 -4px 0 var(--green);
}

.eyebrow,
.panel-kicker,
.topbar-context,
.nav-label {
    color: var(--green);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
}

.eyebrow--light {
    color: #7ed99b;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.button--primary {
    color: #ffffff;
    background: var(--ink);
}

.button--primary:hover:not(:disabled) {
    background: #2b2e2b;
}

.button--secondary {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--surface);
}

.button--secondary:hover:not(:disabled) {
    border-color: #9eaa9c;
    background: var(--surface-soft);
}

.button--green {
    color: #ffffff;
    background: var(--green);
}

.button--green:hover:not(:disabled) {
    background: var(--green-dark);
}

.button--danger {
    border-color: #f2bbb5;
    color: var(--danger);
    background: #ffffff;
}

.button--wide {
    width: 100%;
}

.button--small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
}

.icon-button {
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.icon-button:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

.icon-button--dark {
    border-color: #3a3d3a;
    color: #aeb5ae;
}

.icon-button--dark:hover {
    color: #ffffff;
    background: #2c2f2c;
}

.icon-button--danger {
    color: var(--danger);
}

.icon-button--danger:hover {
    border-color: #f2bbb5;
    color: var(--danger);
    background: var(--danger-light);
}

.alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 14px;
}

.alert .icon-button {
    width: 28px;
    height: 28px;
    border: 0;
}

.alert--success {
    border-color: #b9ddc4;
    color: #176334;
    background: var(--green-light);
}

.alert--error {
    border-color: #f2bbb5;
    color: var(--danger);
    background: var(--danger-light);
}

.alert--warning {
    border-color: #ebd68e;
    color: var(--warning);
    background: var(--warning-light);
}

/* Authentication */
.auth-page {
    background-color: #eef1eb;
    background-image:
        linear-gradient(rgb(17 17 17 / 3%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(17 17 17 / 3%) 1px, transparent 1px);
    background-size: 32px 32px;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.auth-form-panel {
    display: grid;
    width: 100%;
    min-height: 100vh;
    place-items: center;
    padding: 48px;
}

.auth-form-wrap {
    width: min(100%, 430px);
}

.auth-heading {
    margin-top: 86px;
    margin-bottom: 30px;
}

.auth-heading h2 {
    margin: 7px 0 8px;
    color: var(--ink);
    font-size: 32px;
    line-height: 1.2;
}

.auth-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 16px;
}

.auth-form {
    display: grid;
    gap: 20px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: #333833;
    font-size: 13px;
    font-weight: 600;
}

.input-with-icon {
    position: relative;
}

.input-with-icon > svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 18px;
    height: 18px;
    color: #7b847a;
    transform: translateY(-50%);
    pointer-events: none;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    outline: 0;
    background: #ffffff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-with-icon input {
    padding-left: 42px;
}

.input-with-action input {
    padding-right: 44px;
}

.field textarea {
    min-height: 96px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgb(21 128 61 / 12%);
}

.input-action {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.input-action:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.auth-footer {
    margin: 72px 0 0;
    color: #7a8279;
    font-size: 12px;
}

/* Application shell */
.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    color: #d8ddd8;
    background: var(--ink);
}

.sidebar-head {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 18px 20px;
    border-bottom: 1px solid #292c29;
}

.sidebar-close,
.mobile-menu {
    display: none;
}

.sidebar-nav {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    padding: 17px 12px;
    scrollbar-width: thin;
}

.nav-label {
    margin: 16px 10px 5px;
    color: #777f77;
    font-size: 10px;
}

.nav-label:first-child {
    margin-top: 2px;
}

.nav-link {
    position: relative;
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 6px;
    color: #afb6af;
    font-size: 14px;
    font-weight: 500;
    transition: color 150ms ease, background-color 150ms ease;
}

.nav-link:hover {
    color: #ffffff;
    background: #252825;
}

.nav-link.is-active {
    color: #ffffff;
    background: #2b2e2b;
}

.nav-link.is-active::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: -12px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: #35b765;
    content: "";
}

.nav-link svg {
    width: 18px;
    height: 18px;
}

.sidebar-foot {
    padding: 14px;
    border-top: 1px solid #292c29;
}

.user-chip {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
}

.avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 6px;
    color: #ffffff;
    background: var(--green);
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.user-chip-copy {
    display: grid;
    min-width: 0;
}

.user-chip-copy strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip-copy small {
    color: #858d85;
    font-size: 11px;
}

.sidebar-scrim {
    display: none;
}

.main-content {
    min-width: 0;
    grid-column: 2;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 30px;
    border-bottom: 1px solid var(--border);
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(10px);
}

.topbar-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.topbar-title h1 {
    overflow: hidden;
    margin: 1px 0 0;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-context {
    color: #818a80;
    font-size: 9px;
}

.business-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.business-date svg {
    width: 17px;
    height: 17px;
    color: var(--green);
}

.page-content {
    width: min(100%, 1540px);
    margin: 0 auto;
    padding: 28px 30px 42px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-heading h2 {
    margin: 3px 0 0;
    color: var(--ink);
    font-size: 25px;
    line-height: 1.25;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.metric {
    position: relative;
    display: flex;
    min-height: 174px;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.metric::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 54px;
    height: 4px;
    background: var(--green);
    content: "";
}

.metric-icon {
    display: grid;
    width: 36px;
    height: 36px;
    margin-bottom: 19px;
    place-items: center;
    border-radius: 6px;
    color: var(--green);
    background: var(--green-light);
}

.metric-icon svg {
    width: 19px;
    height: 19px;
}

.metric-label {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.metric strong {
    color: var(--ink);
    font-size: 21px;
    line-height: 1.25;
}

.metric strong span {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 13px;
    font-weight: 500;
}

.metric small {
    margin-top: 6px;
    color: #7e877d;
    font-size: 11px;
}

.metric--strong {
    border-color: var(--ink);
    color: #ffffff;
    background: var(--ink);
}

.metric--strong::after {
    width: 72px;
}

.metric--strong .metric-icon {
    color: #8ee1a8;
    background: #25352a;
}

.metric--strong .metric-label,
.metric--strong small {
    color: #a6ada6;
}

.metric--strong strong {
    color: #ffffff;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(310px, 0.8fr);
    gap: 14px;
}

.panel {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel-head {
    display: flex;
    min-height: 73px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.panel-head h3 {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 16px;
}

.panel-kicker {
    color: #8a9289;
    font-size: 9px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 600;
}

.text-link:hover {
    color: var(--green);
}

.text-link svg {
    width: 15px;
    height: 15px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 16px;
    border-bottom: 1px solid #edf0ec;
    text-align: left;
    white-space: nowrap;
}

th {
    color: #747d73;
    background: #fbfcfa;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

td {
    color: #3a403a;
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fbfcfa;
}

td small {
    display: block;
    margin-top: 2px;
    color: #8a9289;
    font-size: 10px;
}

.align-right {
    text-align: right;
}

.amount-cell {
    color: var(--ink);
    font-weight: 600;
}

.table-link {
    color: var(--green-dark);
    font-weight: 600;
}

.table-link:hover {
    text-decoration: underline;
}

.empty-row {
    height: 180px;
    color: #858e84;
    text-align: center;
}

.empty-row svg {
    display: block;
    width: 28px;
    height: 28px;
    margin: 0 auto 8px;
    color: #aab2a9;
}

.status {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}

.status--paid,
.status--active,
.status--posted {
    color: #176334;
    background: var(--green-light);
}

.status--partial {
    color: var(--warning);
    background: var(--warning-light);
}

.status--unpaid,
.status--void,
.status--inactive {
    color: var(--danger);
    background: var(--danger-light);
}

.stock-list {
    min-height: 232px;
}

.stock-row {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid #edf0ec;
}

.stock-row > div:first-child {
    display: grid;
}

.stock-row strong {
    color: var(--ink);
    font-size: 13px;
}

.stock-row small {
    color: #899188;
    font-size: 10px;
}

.stock-count {
    display: flex;
    gap: 13px;
}

.stock-count span {
    color: #778076;
    font-size: 10px;
}

.stock-count b {
    display: block;
    color: var(--text);
    font-size: 15px;
    text-align: center;
}

.empty-state {
    display: grid;
    min-height: 232px;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #858e84;
    font-size: 12px;
}

.empty-state svg {
    width: 28px;
    height: 28px;
    color: #aab2a9;
}

.panel-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--border);
    background: #fafbf9;
}

.panel-summary > div {
    display: grid;
    gap: 3px;
    padding: 14px 17px;
}

.panel-summary > div + div {
    border-left: 1px solid var(--border);
}

.panel-summary span {
    color: var(--muted);
    font-size: 10px;
}

.panel-summary strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 13px;
}

.summary-strip {
    display: grid;
    margin-bottom: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.summary-strip > div {
    display: grid;
    gap: 2px;
    padding: 14px 18px;
}

.summary-strip > div + div {
    border-left: 1px solid var(--border);
}

.summary-strip span {
    color: var(--muted);
    font-size: 11px;
}

.summary-strip strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 17px;
}

.list-toolbar {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.search-form {
    position: relative;
    display: flex;
    width: min(100%, 420px);
    align-items: center;
}

.search-form > svg {
    position: absolute;
    left: 12px;
    z-index: 1;
    width: 17px;
    height: 17px;
    color: #7d867c;
}

.search-form input {
    width: 100%;
    height: 40px;
    padding: 8px 42px 8px 38px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    outline: 0;
    background: #ffffff;
}

.search-form input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgb(21 128 61 / 10%);
}

.search-form .icon-button {
    position: absolute;
    right: 3px;
    width: 34px;
    height: 34px;
    border: 0;
}

.result-count {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.records-table td {
    height: 62px;
}

.record-code {
    color: #596158;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
}

.record-name {
    color: var(--ink);
    font-size: 13px;
}

.action-column {
    width: 60px;
    text-align: right;
}

.action-column .icon-button {
    margin-left: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.back-link:hover {
    color: var(--green-dark);
}

.back-link svg {
    width: 15px;
    height: 15px;
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.72fr);
    gap: 14px;
    align-items: start;
}

.form-side {
    display: grid;
    gap: 14px;
}

.form-panel > .panel-head > svg {
    color: var(--green);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 22px;
}

.form-stack {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.field--full {
    grid-column: 1 / -1;
}

.field input[readonly] {
    color: #687167;
    background: #f3f5f1;
}

.field--error input,
.field--error select,
.field--error textarea {
    border-color: #d92d20;
}

.field-error {
    color: var(--danger);
    font-size: 11px;
}

.field-help {
    color: var(--muted);
    font-size: 10px;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.inline-command {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    color: var(--green-dark);
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

.inline-command:hover {
    color: var(--green);
}

.inline-command svg {
    width: 14px;
    height: 14px;
}

.optional-label {
    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
}

.customer-search-field {
    position: relative;
    z-index: 4;
}

.customer-search-control {
    position: relative;
}

.customer-search-control > svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 17px;
    height: 17px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.customer-search-control input {
    padding-right: 42px;
    padding-left: 40px;
}

.customer-search-spinner {
    position: absolute;
    top: calc(50% - 8px);
    right: 13px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: customer-search-spin 700ms linear infinite;
}

@keyframes customer-search-spin {
    to { transform: rotate(360deg); }
}

.customer-search-results {
    position: absolute;
    z-index: 10;
    top: 69px;
    right: 0;
    left: 0;
    max-height: 252px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    overflow-y: auto;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.customer-search-result {
    display: grid;
    width: 100%;
    gap: 2px;
    padding: 11px 13px;
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
}

.customer-search-result:last-child {
    border-bottom: 0;
}

.customer-search-result:hover,
.customer-search-result.is-highlighted {
    background: var(--green-light);
}

.customer-search-result strong {
    color: var(--ink);
    font-size: 12px;
}

.customer-search-result small {
    color: var(--muted);
    font-size: 10px;
}

.customer-search-empty {
    padding: 16px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.selected-customer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid #b9ddc4;
    border-radius: 6px;
    background: var(--green-light);
}

.selected-customer-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 5px;
    color: var(--green-dark);
    background: #ffffff;
}

.selected-customer-icon svg {
    width: 16px;
    height: 16px;
}

.selected-customer > span:nth-child(2) {
    display: grid;
    min-width: 0;
}

.selected-customer strong,
.selected-customer small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-customer strong {
    color: var(--ink);
    font-size: 12px;
}

.selected-customer small {
    color: #477454;
    font-size: 9px;
}

.selected-customer .icon-button {
    width: 30px;
    height: 30px;
    border-color: transparent;
}

.customer-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.customer-info-grid input[readonly] {
    color: #4f5d52;
    background: #f0f4ef;
}

.customer-info-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 2px;
}

.customer-info-actions p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.customer-info-actions p strong {
    color: var(--text);
    font-weight: 600;
}

.customer-info-actions .button {
    flex: 0 0 auto;
}

.customer-info-actions .button:disabled {
    color: var(--green-dark);
    background: var(--green-light);
    opacity: 1;
}

.customer-form-grid > .alert {
    margin-bottom: 0;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}

body.is-modal-open { overflow: hidden; }

.modal-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgb(17 17 17 / 52%);
    backdrop-filter: blur(3px);
}

.modal-dialog {
    width: min(100%, 480px);
    max-height: calc(100vh - 48px);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    overflow-y: auto;
    background: var(--surface);
    box-shadow: 0 24px 70px rgb(0 0 0 / 24%);
}

.modal-dialog--wide {
    width: min(100%, 720px);
}

.modal-head {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 18px;
}

.modal-body {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.modal-body > .alert {
    margin-bottom: 0;
}

.required {
    color: var(--danger);
}

.input-prefix {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.input-prefix span {
    display: grid;
    min-width: 48px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    color: #697268;
    background: #f4f6f2;
    font-size: 10px;
    font-weight: 600;
}

.input-prefix input {
    border-radius: 0 6px 6px 0;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    cursor: pointer;
}

.toggle-row > span {
    display: grid;
}

.toggle-row strong {
    color: var(--text);
    font-size: 13px;
}

.toggle-row small {
    color: var(--muted);
    font-size: 10px;
}

.toggle-row input {
    width: 38px;
    height: 21px;
    flex: 0 0 38px;
    appearance: none;
    border: 1px solid #aeb7ad;
    border-radius: 999px;
    background: #dfe4dc;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.toggle-row input::before {
    display: block;
    width: 15px;
    height: 15px;
    margin: 2px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
    content: "";
    transition: transform 160ms ease;
}

.toggle-row input:checked {
    border-color: var(--green);
    background: var(--green);
}

.toggle-row input:checked::before {
    transform: translateX(17px);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.section-gap {
    margin-top: 14px;
}

.toolbar-title {
    margin: 2px 0 0;
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 16px;
}

.empty-state--large {
    min-height: 240px;
}

.type-stock-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.type-stock-item {
    min-width: 0;
    padding: 18px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.type-stock-item:nth-child(4n) {
    border-right: 0;
}

.type-stock-head,
.type-stock-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.capacity-mark {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    color: var(--green-dark);
    font-family: "Manrope", sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.capacity-mark small {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 10px;
    font-weight: 600;
}

.type-stock-name {
    display: grid;
    gap: 2px;
    margin: 20px 0 13px;
}

.type-stock-name strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.type-stock-counts {
    display: grid;
    margin-bottom: 16px;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafbf9;
}

.type-stock-counts > div {
    display: grid;
    gap: 2px;
    padding: 9px 11px;
}

.type-stock-counts > div + div {
    border-left: 1px solid var(--border);
}

.type-stock-counts span {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}

.type-stock-counts strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 17px;
}

.type-stock-foot {
    color: var(--muted);
    font-size: 9px;
}

.type-stock-foot > span:first-child {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.type-stock-foot svg {
    width: 14px;
    height: 14px;
}

.input-suffix {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.input-suffix input {
    border-radius: 6px 0 0 6px;
}

.input-suffix span {
    display: grid;
    min-width: 48px;
    padding: 0 10px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-left: 0;
    border-radius: 0 6px 6px 0;
    color: #697268;
    background: #f4f6f2;
    font-size: 10px;
    font-weight: 600;
}

fieldset.field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

fieldset.field legend {
    margin-bottom: 7px;
    color: #333833;
    font-size: 13px;
    font-weight: 600;
}

.toggle-row--boxed {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafbf9;
}

.segmented-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.segmented-input label {
    cursor: pointer;
}

.segmented-input input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-input span {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--muted);
    background: #ffffff;
    font-weight: 600;
}

.segmented-input input:checked + span {
    border-color: var(--green);
    color: var(--green-dark);
    background: var(--green-light);
    box-shadow: 0 0 0 2px rgb(21 128 61 / 8%);
}

.status--full {
    color: #176334;
    background: var(--green-light);
}

.status--empty,
.status--maintenance {
    color: #4d5761;
    background: #eef1f4;
}

.status--with_customer,
.status--sold {
    color: var(--blue);
    background: var(--blue-light);
}

.status--open {
    color: var(--blue);
    background: var(--blue-light);
}

.status--returned {
    color: #176334;
    background: var(--green-light);
}

.status--damaged,
.status--lost {
    color: var(--danger);
    background: var(--danger-light);
}

.inventory-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
    gap: 14px;
}

.lpg-balance {
    position: relative;
    min-height: 220px;
    padding: 24px;
    overflow: hidden;
    border-radius: var(--radius);
    color: #ffffff;
    background-color: var(--ink);
    background-image:
        linear-gradient(rgb(255 255 255 / 6%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px);
    background-size: 32px 32px;
}

.lpg-balance::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 9px;
    height: 100%;
    background: var(--green);
    content: "";
}

.lpg-balance-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #b7beb7;
    font-size: 12px;
    font-weight: 600;
}

.lpg-balance-head svg {
    color: #82dca0;
}

.lpg-balance > strong {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 22px;
    font-family: "Manrope", sans-serif;
    font-size: 44px;
    line-height: 1;
}

.lpg-balance > strong small {
    color: #9ca49c;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 15px;
}

.lpg-balance-foot {
    position: absolute;
    right: 24px;
    bottom: 22px;
    left: 24px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-top: 15px;
    border-top: 1px solid rgb(255 255 255 / 18%);
}

.lpg-balance-foot span {
    display: grid;
    color: #939b93;
    font-size: 10px;
}

.lpg-balance-foot b {
    margin-top: 2px;
    color: #ffffff;
    font-size: 12px;
}

.inventory-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.inventory-totals > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.inventory-totals > div + div {
    border-left: 1px solid var(--border);
}

.inventory-total-icon {
    display: grid;
    width: 36px;
    height: 36px;
    margin-bottom: 22px;
    place-items: center;
    border-radius: 6px;
    color: var(--green);
    background: var(--green-light);
}

.inventory-total-icon--empty {
    color: #59635a;
    background: #eef1ed;
}

.inventory-totals > div > span:not(.inventory-total-icon) {
    color: var(--muted);
    font-size: 11px;
}

.inventory-totals strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 30px;
}

.tracking-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
}

.tracking-label svg {
    width: 14px;
    height: 14px;
}

.compact-list {
    min-height: 280px;
}

.compact-list-row {
    display: grid;
    min-height: 70px;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #edf0ec;
}

.compact-list-row:last-child {
    border-bottom: 0;
}

.list-symbol {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 6px;
    color: var(--green);
    background: var(--green-light);
}

.list-symbol svg {
    width: 17px;
    height: 17px;
}

.compact-list-row > div {
    display: grid;
    min-width: 0;
}

.compact-list-row strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-list-row small {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-void-form .icon-button {
    width: 30px;
    height: 30px;
    border-color: transparent;
    color: var(--danger);
}

.movement-quantity {
    font-weight: 700;
}

.movement-quantity.is-positive,
.is-positive {
    color: var(--green-dark);
}

.movement-quantity.is-negative,
.is-negative {
    color: var(--danger);
}

.notice-panel {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 1px solid #b9ddc4;
    border-radius: var(--radius);
    color: #225f37;
    background: var(--green-light);
}

.notice-panel > svg {
    margin-top: 1px;
}

.notice-panel strong {
    color: #174d2a;
    font-size: 13px;
}

.notice-panel p {
    margin: 3px 0 0;
    font-size: 11px;
}

.fill-preview {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.fill-preview > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.fill-preview > div:last-child {
    border-bottom: 0;
}

.fill-preview > div span {
    color: var(--muted);
    font-size: 12px;
}

.fill-preview > div strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 14px;
}

.fill-preview > div strong.is-positive {
    color: var(--green-dark);
}

.serial-picker-field[hidden],
[hidden] {
    display: none !important;
}

.serial-picker {
    display: grid;
    max-height: 270px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8faf7;
}

.serial-picker label {
    cursor: pointer;
}

.serial-picker input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.serial-picker label > span {
    display: grid;
    min-height: 55px;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
}

.serial-picker label > span > svg {
    grid-row: 1 / 3;
    width: 17px;
    height: 17px;
    color: var(--muted);
}

.serial-picker label strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.serial-picker label small {
    color: var(--muted);
    font-size: 9px;
}

.serial-picker input:checked + span {
    border-color: var(--green);
    background: var(--green-light);
    box-shadow: 0 0 0 2px rgb(21 128 61 / 8%);
}

.serial-picker input:checked + span > svg {
    color: var(--green);
}

.serial-picker-empty {
    grid-column: 1 / -1;
    padding: 22px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.due-cell {
    color: var(--danger);
    font-weight: 600;
}

.document-sheet {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.document-head {
    display: flex;
    min-height: 124px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 25px 28px;
    color: #ffffff;
    background-color: var(--ink);
    background-image:
        linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
    background-size: 28px 28px;
}

.document-head--sale {
    box-shadow: inset 0 -5px 0 var(--green);
}

.document-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.document-brand > div,
.document-number {
    display: grid;
}

.document-brand strong {
    font-family: "Manrope", sans-serif;
    font-size: 20px;
}

.document-brand small,
.document-number span,
.document-number small {
    color: #a8afa8;
    font-size: 10px;
}

.document-number {
    text-align: right;
}

.document-number strong {
    margin: 3px 0;
    font-family: "Manrope", sans-serif;
    font-size: 18px;
}

.document-parties {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.8fr;
    border-bottom: 1px solid var(--border);
}

.document-parties > div {
    min-width: 0;
    padding: 20px 24px;
}

.document-parties > div + div {
    border-left: 1px solid var(--border);
}

.document-parties > div > span,
.document-notes > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.document-parties > div > strong {
    color: var(--ink);
    font-size: 13px;
}

.document-parties p,
.document-notes p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.document-lines {
    min-height: 230px;
    padding: 20px 22px 0;
}

.document-lines table {
    border: 1px solid var(--border);
}

.document-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 0.45fr);
    gap: 30px;
    align-items: start;
    padding: 24px;
}

.document-notes {
    min-height: 90px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafbf9;
}

.document-totals {
    display: grid;
}

.document-totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 2px;
    border-bottom: 1px solid var(--border);
}

.document-totals span {
    color: var(--muted);
    font-size: 11px;
}

.document-totals strong {
    color: var(--ink);
    font-size: 12px;
}

.document-totals .document-total-due {
    margin-top: 5px;
    padding: 12px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: var(--ink);
}

.document-totals .document-total-due span {
    color: #b2b9b2;
}

.document-totals .document-total-due strong {
    color: #ffffff;
    font-family: "Manrope", sans-serif;
    font-size: 15px;
}

.detail-grid {
    display: grid;
    margin-top: 14px;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
    gap: 14px;
    align-items: start;
}

.payment-panel > .panel-head > svg {
    color: var(--green);
}

.inline-error {
    display: flex;
    gap: 7px;
    align-items: center;
    margin: 14px 16px 0;
    padding: 9px 10px;
    border-radius: 5px;
    color: var(--danger);
    background: var(--danger-light);
    font-size: 11px;
}

.inline-error svg {
    width: 16px;
    height: 16px;
}

.paid-state {
    display: grid;
    min-height: 240px;
    place-items: center;
    align-content: center;
    gap: 7px;
    color: var(--green-dark);
}

.paid-state svg {
    width: 34px;
    height: 34px;
}

.paid-state strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
}

.paid-state span {
    color: var(--muted);
    font-size: 11px;
}

.empty-row--compact {
    height: 130px;
}

.transaction-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
    align-items: start;
}

.transaction-main,
.transaction-side {
    display: grid;
    min-width: 0;
    gap: 14px;
}

.transaction-side {
    position: sticky;
    top: 98px;
}

.form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.line-items {
    display: grid;
}

.line-item {
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.line-item:last-child {
    border-bottom: 0;
}

.line-item > header {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    padding: 7px 16px;
    color: var(--muted);
    background: #f8faf7;
    font-size: 10px;
    text-transform: uppercase;
}

.line-item > header b {
    color: var(--ink);
}

.line-item > header .icon-button {
    width: 30px;
    height: 30px;
    color: var(--danger);
}

.line-item-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 13px;
    align-items: end;
    padding: 16px;
}

.line-item-grid > .field,
.line-total {
    grid-column: span 2;
}

.line-item-grid .line-serials {
    grid-column: 1 / -1;
}

.line-item-grid .field label {
    font-size: 10px;
}

.line-item-grid .field input,
.line-item-grid .field select {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 12px;
}

.line-item-grid .input-prefix span {
    min-width: 42px;
    font-size: 9px;
}

.line-total {
    display: grid;
    min-height: 40px;
    align-content: center;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f7f9f5;
}

.line-total span {
    color: var(--muted);
    font-size: 9px;
}

.line-total strong {
    overflow: hidden;
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-summary > .panel-head > svg {
    color: var(--green);
}

.transaction-totals {
    display: grid;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.transaction-totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}

.transaction-totals span {
    color: var(--muted);
    font-size: 11px;
}

.transaction-totals strong {
    color: var(--ink);
    font-size: 12px;
}

.transaction-grand-total {
    border-top: 1px solid var(--border);
}

.transaction-grand-total strong {
    font-family: "Manrope", sans-serif;
    font-size: 18px;
}

.payment-entry {
    border-bottom: 1px solid var(--border);
}

.payment-fields {
    display: grid;
    gap: 15px;
}

.amount-due-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 15px;
    padding: 12px;
    border-radius: 6px;
    color: #ffffff;
    background: var(--ink);
}

.amount-due-preview span {
    color: #adb4ad;
    font-size: 10px;
}

.amount-due-preview strong {
    font-family: "Manrope", sans-serif;
    font-size: 14px;
}

.form-actions--stacked {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
}

.deposit-breakdown {
    display: grid;
    padding: 0 15px 15px;
}

.deposit-breakdown > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 2px;
    border-bottom: 1px solid var(--border);
}

.deposit-breakdown span {
    color: var(--muted);
    font-size: 10px;
}

.deposit-breakdown strong {
    color: var(--ink);
    font-size: 12px;
}

.deposit-breakdown .deposit-collected {
    margin-top: 7px;
    padding: 12px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: var(--ink);
}

.deposit-breakdown .deposit-collected span {
    color: #adb4ad;
}

.deposit-breakdown .deposit-collected strong {
    color: #ffffff;
    font-family: "Manrope", sans-serif;
    font-size: 15px;
}

.custody-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.custody-summary-grid > div {
    display: grid;
    min-height: 135px;
    align-content: center;
    gap: 3px;
    padding: 20px 24px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.custody-summary-grid > div:nth-child(2n) {
    border-right: 0;
}

.custody-summary-grid span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.custody-summary-grid strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 18px;
}

.custody-summary-grid small {
    color: var(--muted);
    font-size: 10px;
}

.segmented-input--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-input--three span {
    min-width: 0;
    padding: 7px 5px;
    font-size: 11px;
}

.deposit-deduction-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px;
    border: 1px solid #ebd68e;
    border-radius: 6px;
    color: var(--warning);
    background: var(--warning-light);
}

.deposit-deduction-preview span {
    font-size: 10px;
}

.deposit-deduction-preview strong {
    font-family: "Manrope", sans-serif;
    font-size: 12px;
}

.report-filter {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.report-filter form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.report-filter .field {
    gap: 4px;
}

.report-filter .field input {
    min-height: 38px;
    padding: 7px 10px;
}

.filter-total {
    display: grid;
    text-align: right;
}

.filter-total span {
    color: var(--muted);
    font-size: 10px;
}

.filter-total strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 17px;
}

.report-print-brand {
    display: flex;
    align-items: center;
    gap: 9px;
}

.report-print-brand .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 11px;
}

.report-print-brand > div {
    display: grid;
}

.report-print-brand strong {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 13px;
}

.report-print-brand small {
    color: var(--muted);
    font-size: 9px;
}

.print-only {
    display: none;
}

.daily-metrics {
    display: grid;
    margin-bottom: 14px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.daily-metrics article {
    display: grid;
    min-width: 0;
    min-height: 118px;
    align-content: center;
    padding: 15px;
    border-right: 1px solid var(--border);
}

.daily-metrics article:last-child {
    border-right: 0;
}

.daily-metrics article:nth-child(1),
.daily-metrics article:nth-child(2) {
    color: #ffffff;
    background: var(--ink);
}

.daily-metrics span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.daily-metrics article:nth-child(1) span,
.daily-metrics article:nth-child(2) span,
.daily-metrics article:nth-child(1) small,
.daily-metrics article:nth-child(2) small {
    color: #a9b0a9;
}

.daily-metrics strong {
    overflow: hidden;
    margin: 5px 0 3px;
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.daily-metrics article:nth-child(1) strong,
.daily-metrics article:nth-child(2) strong {
    color: #ffffff;
}

.daily-metrics small {
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-section {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.report-section-head {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
}

.report-section-head > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-section-head > div > span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 5px;
    color: var(--green-dark);
    background: var(--green-light);
    font-size: 9px;
    font-weight: 700;
}

.report-section-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
}

.report-section-head > small {
    color: var(--muted);
    font-size: 10px;
}

.account-reconciliation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-close-card {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.account-close-card:nth-child(2n) {
    border-right: 0;
}

.account-close-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.account-close-card > header > div {
    display: grid;
}

.account-close-card > header strong {
    color: var(--ink);
    font-size: 13px;
}

.account-close-card > header small {
    color: var(--muted);
    font-size: 9px;
}

.account-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: #fafbf9;
}

.account-flow > div {
    display: grid;
    min-width: 0;
    gap: 3px;
    padding: 9px;
    border-right: 1px solid var(--border);
}

.account-flow > div:nth-child(4) {
    border-right: 0;
}

.account-flow > div span,
.closing-result span {
    color: var(--muted);
    font-size: 8px;
    text-transform: uppercase;
}

.account-flow > div strong,
.closing-result strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-flow .account-expected {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px;
    border-top: 1px solid var(--border);
    border-right: 0;
    color: #ffffff;
    background: var(--ink);
}

.account-flow .account-expected span {
    color: #adb4ad;
}

.account-flow .account-expected strong {
    color: #ffffff;
    font-family: "Manrope", sans-serif;
    font-size: 13px;
}

.close-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 9px;
    align-items: end;
    margin-top: 12px;
}

.close-form .field {
    gap: 4px;
}

.close-form .field input {
    min-height: 37px;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 11px;
}

.closing-result {
    display: grid;
    margin-top: 12px;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid #b9ddc4;
    border-radius: 6px;
    background: var(--green-light);
}

.closing-result > div {
    display: grid;
}

.closing-result > small {
    grid-column: 1 / -1;
    color: #477454;
    font-size: 8px;
}

.report-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.void-panel,
.voided-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #f2bbb5;
    border-radius: var(--radius);
    color: var(--danger);
    background: var(--danger-light);
}

.void-panel > div,
.voided-note {
    display: flex;
    align-items: center;
    gap: 10px;
}

.void-panel > div > span,
.voided-note > span {
    display: grid;
}

.void-panel strong,
.voided-note strong {
    color: #8d1a13;
    font-size: 12px;
}

.void-panel small,
.voided-note span {
    font-size: 10px;
}

.void-panel form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.void-panel input {
    width: min(260px, 32vw);
    height: 38px;
    padding: 8px 10px;
    border: 1px solid #e8a59d;
    border-radius: 6px;
    outline: 0;
    background: #ffffff;
    font-size: 12px;
}

.void-panel input:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgb(180 35 24 / 10%);
}

.error-page {
    display: grid;
    min-height: 65vh;
    place-items: center;
    align-content: center;
    text-align: center;
}

.error-code {
    color: var(--green);
    font-family: "Manrope", sans-serif;
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
}

.error-page h2 {
    margin: 16px 0 8px;
    font-size: 25px;
}

.error-page p {
    margin-bottom: 24px;
    color: var(--muted);
}

@media (max-width: 1180px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .type-stock-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .type-stock-item:nth-child(4n) {
        border-right: 1px solid var(--border);
    }

    .type-stock-item:nth-child(2n) {
        border-right: 0;
    }

    .inventory-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .transaction-layout,
    .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .transaction-side {
        position: static;
    }

    .line-item-grid > .field,
    .line-total {
        grid-column: span 4;
    }

    .line-item-grid .line-serials {
        grid-column: 1 / -1;
    }

    .custody-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .custody-summary-grid > div,
    .custody-summary-grid > div:nth-child(2n) {
        border-right: 0;
    }

    .daily-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .daily-metrics article:nth-child(3) {
        border-right: 0;
    }

    .daily-metrics article:nth-child(-n + 3) {
        border-bottom: 1px solid var(--border);
    }

    .account-reconciliation,
    .report-two-column {
        grid-template-columns: minmax(0, 1fr);
    }

    .account-close-card,
    .account-close-card:nth-child(2n) {
        border-right: 0;
    }

}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: min(86vw, 278px);
        box-shadow: var(--shadow-md);
        transform: translateX(-102%);
        transition: transform 220ms ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close,
    .mobile-menu {
        display: inline-grid;
    }

    .sidebar-close {
        border-color: #3a3d3a;
        color: #b3bab3;
    }

    .sidebar-scrim {
        position: fixed;
        z-index: 30;
        inset: 0;
        display: block;
        visibility: hidden;
        background: rgb(0 0 0 / 46%);
        opacity: 0;
        transition: opacity 220ms ease, visibility 220ms ease;
    }

    .sidebar-scrim.is-visible {
        visibility: visible;
        opacity: 1;
    }

    .main-content {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .auth-form-panel {
        align-items: start;
        padding: 28px 20px;
    }

    .auth-heading {
        margin-top: 64px;
    }

    .auth-heading h2 {
        font-size: 27px;
    }

    .auth-footer {
        margin-top: 48px;
    }

    .topbar {
        min-height: 70px;
        padding: 11px 16px;
    }

    .business-date {
        display: none;
    }

    .page-content {
        padding: 22px 16px 34px;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading h2 {
        font-size: 22px;
    }

    .page-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .metric-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .metric {
        min-height: 158px;
    }

    .panel-head {
        padding: 14px;
    }

    th,
    td {
        padding: 11px 13px;
    }

    .panel-summary {
        grid-template-columns: 1fr;
    }

    .panel-summary > div + div {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .summary-strip {
        grid-template-columns: minmax(0, 1fr);
    }

    .summary-strip > div + div {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 18px;
    }

    .field--full {
        grid-column: auto;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 1fr 1.5fr;
    }

    .customer-info-grid,
    .modal-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .customer-info-actions {
        display: grid;
        grid-column: auto;
        grid-template-columns: 1fr 1.4fr;
    }

    .customer-info-actions p {
        grid-column: 1 / -1;
    }

    .customer-info-actions .button {
        grid-column: 1 / -1;
    }

    .modal-backdrop {
        align-items: end;
        padding: 0;
    }

    .modal-dialog {
        width: 100%;
        max-height: calc(100vh - 18px);
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .modal-actions {
        display: grid;
        grid-template-columns: 1fr 1.4fr;
    }

    .type-stock-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .type-stock-item,
    .type-stock-item:nth-child(2n),
    .type-stock-item:nth-child(4n) {
        border-right: 0;
    }

    .lpg-balance {
        min-height: 230px;
        padding: 20px;
    }

    .lpg-balance > strong {
        font-size: 36px;
    }

    .lpg-balance-foot {
        right: 20px;
        left: 20px;
    }

    .inventory-totals {
        grid-template-columns: 1fr 1fr;
    }

    .inventory-totals > div {
        padding: 15px;
    }

    .inventory-total-icon {
        margin-bottom: 16px;
    }

    .serial-picker {
        grid-template-columns: minmax(0, 1fr);
    }

    .document-head {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .document-number {
        text-align: left;
    }

    .document-parties,
    .document-bottom {
        grid-template-columns: minmax(0, 1fr);
    }

    .document-parties > div + div {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .document-lines {
        padding: 14px 12px 0;
    }

    .document-bottom {
        gap: 16px;
        padding: 16px;
    }

    .form-grid--three {
        grid-template-columns: minmax(0, 1fr);
    }

    .line-item-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .line-item-grid > .field,
    .line-total,
    .line-item-grid .line-serials {
        grid-column: auto;
    }

    .line-item-grid .line-serials {
        grid-column: 1 / -1;
    }

    .report-filter,
    .report-filter form {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-total {
        text-align: left;
    }

    .daily-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .daily-metrics article,
    .daily-metrics article:nth-child(3) {
        min-height: 105px;
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .daily-metrics article:nth-child(2n) {
        border-right: 0;
    }

    .account-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-flow > div:nth-child(2) {
        border-right: 0;
    }

    .account-flow > div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }

    .close-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .void-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .void-panel form {
        align-items: stretch;
        flex-direction: column;
    }

    .void-panel input {
        width: 100%;
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body {
        min-height: auto;
        color: #111111;
        background: #ffffff;
    }

    .sidebar,
    .sidebar-scrim,
    .topbar,
    .no-print,
    .alert {
        display: none !important;
    }

    .app-shell,
    .main-content {
        display: block;
        width: 100%;
    }

    .page-content {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .document-sheet {
        border-color: #cfcfcf;
        box-shadow: none;
    }

    .document-head {
        color: #ffffff !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .document-totals .document-total-due {
        color: #ffffff !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .print-only {
        display: flex !important;
    }

    .report-print-head {
        align-items: flex-end;
        justify-content: space-between;
        margin-bottom: 8mm;
        padding-bottom: 4mm;
        border-bottom: 2px solid #111111;
    }

    .report-print-head > div {
        display: grid;
    }

    .report-print-head > div:last-child {
        text-align: right;
    }

    .report-print-head strong {
        font-family: "Manrope", sans-serif;
        font-size: 13pt;
    }

    .report-print-head span {
        color: #555555;
        font-size: 8pt;
    }

    .daily-metrics,
    .report-section {
        break-inside: avoid;
        border-color: #bdbdbd;
        box-shadow: none;
    }

    .daily-metrics article {
        min-height: 21mm;
    }

    .report-section-head {
        min-height: 12mm;
    }

    .report-section table th,
    .report-section table td {
        padding: 2.5mm 3mm;
        font-size: 7.5pt;
    }

    .account-flow .account-expected,
    .daily-metrics article:nth-child(1),
    .daily-metrics article:nth-child(2) {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}