:root {
  --ink: #10233f;
  --muted: #68778c;
  --navy: #0b1f3a;
  --navy-2: #12385f;
  --blue: #1967d2;
  --blue-dark: #1252aa;
  --cyan: #21b8d5;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --line: #dde5ef;
  --shadow: 0 12px 32px rgba(24, 50, 83, .09);
  --radius: 16px;
}

html { font-size: 15px; min-height: 100%; }
body { min-height: 100vh; color: var(--ink); font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--blue); }

.app-body { background: var(--canvas); display: flex; flex-direction: column; }
.app-header { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.96); border-bottom: 1px solid rgba(221,229,239,.9); box-shadow: 0 5px 20px rgba(16,35,63,.05); backdrop-filter: blur(14px); }
.app-header .navbar { min-height: 74px; padding: .65rem 0; }
.app-brand, .login-brand, .mobile-login-brand { display: inline-flex; align-items: center; gap: .72rem; color: var(--navy); text-decoration: none; flex-shrink: 0; }
.app-brand:hover { color: var(--navy); }
.brand-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, var(--blue), var(--cyan)); box-shadow: 0 8px 20px rgba(25,103,210,.25); color: white; font-weight: 800; letter-spacing: -.04em; }
.app-brand > span:last-child, .login-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.02; }
.app-brand strong, .login-brand strong { font-size: 1.05rem; letter-spacing: -.02em; }
.app-brand small, .login-brand small { color: var(--muted); font-size: .73rem; letter-spacing: .14em; text-transform: uppercase; }
.navbar-toggler { border: 1px solid var(--line); border-radius: 11px; padding: .5rem .65rem; box-shadow: none !important; }
.app-nav { gap: .28rem; padding: .65rem 0; align-items: center; }
.app-nav .nav-link { color: #4f6076; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: .86rem; padding: .58rem .78rem !important; white-space: nowrap; transition: color .15s ease,background .15s ease,border-color .15s ease,transform .15s ease; }
.app-nav .nav-link:hover { color: var(--blue); background: #edf5ff; }
.app-nav .nav-link.active { color: var(--blue); background: #e7f1ff; border-color: #cfe1f8; box-shadow: inset 0 -2px 0 rgba(25,103,210,.28); }
.app-nav-group .dropdown-toggle::after { margin-left: .48rem; vertical-align: .16em; }
.app-nav-menu { width: 292px; padding: .55rem; margin-top: .55rem !important; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.99); }
.app-nav-menu .dropdown-item { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: .7rem; align-items: center; padding: .62rem; border-radius: 10px; color: #314761; white-space: normal; }
.app-nav-menu .dropdown-item:hover,.app-nav-menu .dropdown-item.active { color: var(--blue); background: #edf5ff; }
.app-nav-menu .dropdown-item > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.app-nav-menu .dropdown-item strong { font-size: .82rem; line-height: 1.2; }
.app-nav-menu .dropdown-item small { margin-top: .15rem; color: #7a899b; font-size: .68rem; }
.menu-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #1262b5; background: linear-gradient(145deg,#e7f2ff,#f2fbff); font-size: .67rem; font-weight: 800; letter-spacing: .03em; }
.user-menu { display: flex; align-items: center; gap: .65rem; border-left: 1px solid var(--line); padding-left: 1rem; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-weight: 700; }
.user-copy { display: flex; flex-direction: column; line-height: 1.15; max-width: 150px; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: .84rem; }.user-copy small { color: var(--muted); font-size: .68rem; margin-top: .18rem; }
.btn-signout { color: #53647a; border: 1px solid var(--line); background: #fff; border-radius: 9px; font-size: .78rem; padding: .42rem .6rem; }
.btn-signout:hover { color: #b42318; background: #fff1f0; border-color: #f4b9b3; }
.btn-account { color: #165d8f; border: 1px solid #b8d3e5; background: #f5fbff; border-radius: 9px; font-size: .78rem; padding: .42rem .6rem; white-space: nowrap; }
.btn-account:hover { color: #0b3f66; background: #eaf6fd; border-color: #83b6d5; }
.licence-nav-notice { display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .55rem; border: 1px solid; border-radius: 9px; background: #fff; font-size: .68rem; white-space: nowrap; }.licence-nav-notice span { width: 7px; height: 7px; border-radius: 50%; }.licence-nav-notice.warning { color: #8a5700; border-color: #e6bd6e; background: #fff9eb; }.licence-nav-notice.warning span { background: #e6a11b; }.licence-nav-notice.critical { color: #a52b22; border-color: #efa59f; background: #fff4f3; }.licence-nav-notice.critical span { background: #d83b32; }
.password-page { max-width: 780px; margin-inline: auto; }
.sandbox-prepare-form { display: grid; gap: .4rem; min-width: 0; }
.sandbox-resolver-form { width: 100%; min-width: 0; max-width: none; }
.sandbox-reference-resolver { width: 100%; min-width: 0; max-width: none; padding: .65rem; border: 1px solid #d7e2ef; border-radius: .6rem; background: #f8fbff; }
.sandbox-reference-resolver > summary { cursor: pointer; color: #145ea8; font-size: .78rem; font-weight: 700; }
.sandbox-reference-resolver[open] > summary { margin-bottom: .45rem; }
.sandbox-scenario-action > .sandbox-resolver-form { padding: .65rem; border: 1px solid #cbdced; border-radius: .65rem; background: #f8fbff; }
.sandbox-scenario-action > form:not(.sandbox-resolver-form) { min-width: 0; align-self: start; }
.sandbox-scenario-action > form:not(.sandbox-auto-clear):not(.sandbox-portal-evidence):not(.sandbox-resolver-form) { display: block; }
.sandbox-auto-clear .btn { width: 100%; min-height: 44px; font-weight: 750; }

.app-page { width: 100%; max-width: 1680px; flex: 1; padding-top: 1.65rem; padding-bottom: 2.5rem; }
.app-main > .d-flex:first-child, .app-main > h1:first-child { margin-top: .15rem; }
.app-footer { color: #7b899c; border-top: 1px solid var(--line); background: #fff; font-size: .78rem; }
.app-footer > div { min-height: 54px; max-width: 1680px; display: flex; align-items: center; justify-content: space-between; }
.app-alert { border: 0; border-radius: 12px; box-shadow: 0 6px 18px rgba(16,35,63,.06); }
.page-tools { display: flex; justify-content: flex-end; align-items: center; gap: .45rem; min-height: 32px; margin: -.5rem 0 .8rem; }
.page-tools-status { color: var(--muted); font-size: .72rem; }
.invoice-delivery-panel { margin: .35rem 0 .45rem; padding: .42rem .5rem .5rem; border: 1px solid #d8e6f5; border-radius: 10px; background: linear-gradient(135deg,#f8fbff,#f3f9ff); }
.invoice-delivery-title { display: flex; align-items: center; gap: .45rem; margin-bottom: .3rem; }
.invoice-delivery-title > span { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 26px; border-radius: 7px; color: #fff; background: linear-gradient(145deg,var(--navy-2),var(--blue)); font-size: .62rem; font-weight: 800; }
.invoice-delivery-title > div { display: flex; flex: 1; flex-direction: column; line-height: 1.2; }
.invoice-delivery-title strong { font-size: .78rem; }.invoice-delivery-title small { margin: 0 0 0 .35rem; color: var(--muted); font-size: .64rem; }.invoice-delivery-title b { color: var(--blue); font-size: .72rem; }
.invoice-delivery-title > div { flex-direction: row; align-items: baseline; }
.invoice-delivery-grid { display: grid; grid-template-columns: 125px repeat(3,minmax(130px,1fr)) minmax(190px,1.35fr); gap: .4rem; }
.invoice-delivery-notes { grid-column: auto; }
.invoice-delivery-grid .form-control { min-height: 32px; height: 32px; padding: .28rem .5rem; font-size: .75rem; }.invoice-delivery-grid .form-label { margin-bottom: .12rem; font-size: .66rem; }
.invoice-tax-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1rem; align-items: end; margin: 0 0 .5rem; padding: .55rem .65rem; border: 1px solid #dce6f1; border-radius: 10px; background: #fbfdff; }
.invoice-tax-controls { display: grid; grid-template-columns: minmax(280px,1fr) 140px 170px; gap: .55rem; align-items: end; min-width: 0; }
.invoice-tax-explanation { display: flex; flex-direction: column; justify-content: center; min-height: 33px; color: var(--ink); font-size: .72rem; line-height: 1.25; }
.invoice-tax-explanation span { color: var(--muted); font-size: .65rem; }
.invoice-tax-summary { display: grid; grid-template-columns: repeat(3,150px); gap: .55rem; align-items: end; }
.invoice-tax-panel .form-label { margin-bottom: .14rem; font-size: .68rem; white-space: nowrap; }
.invoice-tax-panel .form-control,.invoice-tax-panel .form-select { min-height: 33px; height: 33px; padding: .26rem .48rem; font-size: .74rem; }
.invoice-tax-panel .form-text { display: block; margin-top: .15rem; font-size: .62rem; line-height: 1.15; white-space: nowrap; }

h1, h2, h3, h4, h5 { color: var(--ink); letter-spacing: -.025em; }
.h3 { font-weight: 750; }
.text-muted { color: var(--muted) !important; }
.eyebrow { display: inline-block; color: #76ddf0; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .15em; }

.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(16,35,63,.06); }
.card-body { padding: 1.35rem; }
.table-responsive { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { margin-bottom: 0; color: #263a55; }
.table > :not(caption) > * > * { padding: .88rem 1rem; border-bottom-color: #e8eef5; vertical-align: middle; }
.table thead th { background: #f7f9fc; color: #64748a; font-size: .73rem; text-transform: uppercase; letter-spacing: .045em; white-space: nowrap; border-bottom-width: 1px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8fbff; }

.form-control, .form-select { border: 1px solid #cfd9e7; border-radius: 10px; min-height: 43px; color: var(--ink); background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: #65a3ed; box-shadow: 0 0 0 .22rem rgba(25,103,210,.12); }
.form-label { color: #334861; font-weight: 650; font-size: .83rem; margin-bottom: .4rem; }
.form-text { color: #7a8899; font-size: .75rem; }
.input-group .form-control { border-radius: 10px 0 0 10px; }
.input-group .btn { border-radius: 0 10px 10px 0; }
.btn { border-radius: 9px; font-weight: 650; }
.btn-icon-text { display: inline-flex; align-items: center; justify-content: center; gap: .32rem; white-space: nowrap; }
.btn-icon-text > [aria-hidden="true"] { display: inline-grid; min-width: 1em; place-items: center; font-size: 1.05em; font-weight: 800; line-height: 1; }
.btn-primary { background: linear-gradient(135deg, var(--blue), #2584e7); border-color: var(--blue); box-shadow: 0 6px 14px rgba(25,103,210,.18); }
.btn-primary:hover { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); border-color: var(--blue-dark); transform: translateY(-1px); }
.btn-outline-primary { color: var(--blue); border-color: #9bc2f1; }
.btn-outline-secondary { color: #53647a; border-color: #cbd6e3; }
.badge { border-radius: 999px; font-weight: 650; padding: .42em .7em; }
.permission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.permission-option { display: flex; align-items: flex-start; gap: .7rem; min-height: 78px; padding: .9rem; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfd; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.permission-option:hover { border-color: #9bc2f1; background: #f2f7fe; }
.permission-option .form-check-input { flex: 0 0 auto; margin-top: .18rem; }
.permission-option span { display: flex; flex-direction: column; }
.permission-option strong { color: #263c57; font-size: .84rem; }
.permission-option small { color: var(--muted); font-size: .72rem; line-height: 1.35; margin-top: .18rem; }
.permission-editor { display: grid; gap: .8rem; }
.permission-guide { padding: .75rem .85rem; border: 1px solid #bcd5f1; border-radius: 11px; color: #24415f; background: #f1f7fe; }
.permission-guide strong { display: block; margin-bottom: .25rem; font-size: .88rem; }
.permission-guide ol { display: flex; flex-wrap: wrap; gap: .35rem 1.4rem; margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: .76rem; }
.permission-toolbar { display: grid; grid-template-columns: minmax(260px,1fr) auto; align-items: end; gap: .7rem; }
.permission-search-wrap .form-label { margin-bottom: .22rem; }
.permission-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .4rem; }
.permission-total { padding: .42rem .65rem; border-radius: 8px; color: #184b7c; background: #e9f3ff; font-size: .76rem; white-space: nowrap; }
.permission-categories { display: grid; gap: .65rem; }
.permission-category { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.permission-category[hidden],.permission-option[hidden] { display: none !important; }
.permission-category-header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .65rem; padding: .65rem .7rem; background: #f7faff; }
.permission-category-toggle { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .7rem; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.permission-category-toggle > span:first-child { display: flex; min-width: 0; flex-direction: column; }
.permission-category-toggle strong { font-size: .88rem; }
.permission-category-toggle small { margin-top: .12rem; color: var(--muted); font-size: .7rem; line-height: 1.3; }
.permission-category-toggle::after { content: "▾"; flex: 0 0 auto; color: #52708f; font-size: .82rem; transition: transform .15s ease; }
.permission-category-toggle[aria-expanded="false"]::after { transform: rotate(-90deg); }
.permission-category-count { flex: 0 0 auto; padding: .3rem .48rem; border-radius: 999px; color: #315d86; background: #e5f1ff; font-size: .68rem; white-space: nowrap; }
.permission-category-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.permission-category-body { border-top: 1px solid var(--line); }
.permission-category-body .permission-grid { padding: .7rem; }
.permission-empty { margin: 0; }
.validation-summary, .validation-summary-errors { color: #b42318; background: #fff1f0; border: 1px solid #ffd0cc; border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .82rem; }
.validation-summary ul { margin: 0; padding-left: 1.1rem; }

.entry-page { max-width: 1080px; margin: 0 auto; }
.entry-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.15rem; padding: 1.45rem 1.6rem; border-radius: 20px 20px 0 0; color: #fff; background: linear-gradient(125deg, #0c294b, #155b8f); box-shadow: 0 14px 34px rgba(15,51,85,.16); }
.entry-hero::after { content: ""; position: absolute; width: 210px; height: 210px; border: 42px solid rgba(255,255,255,.06); border-radius: 50%; right: -48px; top: -88px; }
.entry-hero > * { position: relative; z-index: 1; }
.product-hero { background: linear-gradient(125deg, #123557, #17698d); }
.customer-hero { background: linear-gradient(125deg, #173b50, #16806f); }
.entry-icon { width: 56px; height: 56px; flex: 0 0 56px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); font-weight: 850; letter-spacing: .04em; }
.entry-eyebrow { color: #aeeaf5; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.entry-hero h1 { color: #fff; font-size: 1.65rem; font-weight: 780; margin: .12rem 0 .2rem; }
.entry-hero p { color: #c7dfeb; margin: 0; font-size: .86rem; }
.entry-form { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 20px 20px; background: #fff; box-shadow: var(--shadow); padding: 1.5rem; }
.entry-section { padding: 1.25rem; border: 1px solid #e1e8f1; border-radius: 15px; background: linear-gradient(180deg,#fff,#fbfcfe); }
.entry-section + .entry-section { margin-top: 1rem; }
.entry-section-heading { display: flex; align-items: flex-start; gap: .8rem; margin-bottom: 1rem; padding-bottom: .85rem; border-bottom: 1px solid #edf1f6; }
.entry-section-heading > span { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; color: var(--blue); background: #e9f3ff; border-radius: 9px; font-size: .7rem; font-weight: 850; }
.entry-section-heading h2 { font-size: 1rem; font-weight: 780; margin: 0; }
.entry-section-heading p { color: var(--muted); font-size: .75rem; margin: .16rem 0 0; }
.entry-form .form-control, .entry-form .form-select { min-height: 48px; padding-inline: .85rem; background-color: #fcfdff; }
.entry-form textarea.form-control { min-height: 90px; padding-top: .75rem; }
.entry-form .form-control::placeholder { color: #a2adbb; }
.entry-actions { display: flex; justify-content: flex-end; gap: .7rem; padding-top: 1.2rem; }
.entry-actions .btn { min-width: 120px; min-height: 45px; display: inline-grid; place-items: center; }
.third-schedule-note { display: flex; gap: .45rem 1rem; align-items: center; margin-top: 1rem; padding: .8rem 1rem; color: #7b4a09; background: #fff7e8; border: 1px solid #f4d49b; border-radius: 11px; font-size: .78rem; }
.third-schedule-note strong { white-space: nowrap; }
.retail-required label::after { content: " *"; color: #c24136; }
.field-required::after { content: " *"; color: #c24136; }
.rate-policy-card { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 1rem; }
.rate-policy-card .form-switch { padding: .8rem 1rem .8rem 3.3rem; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.fiscal-hero { background: linear-gradient(135deg, #123d63, #167d83); }
.fbr-hero { background: linear-gradient(135deg, #173c35, #13815f); }
.company-hero { background: linear-gradient(135deg, #173c67, #315fc4); }
.user-hero { background: linear-gradient(135deg, #3d2b70, #7450c7); }
.invoice-number-preview { padding: .8rem 1rem; border-radius: .75rem; background: #eef7ff; color: #244766; }
.connection-status { display: inline-flex; align-items: center; margin-bottom: 1rem; padding: .35rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.connection-status.configured { background: #dff7eb; color: #12613f; }
.connection-status.missing { background: #fff1da; color: #8a5410; }
.fbr-connection-grid > div { display: flex; }
.rate-entry-table { box-shadow: none; border-radius: 12px; }
.scenario-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
.scenario-option { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.scenario-option > span { display: flex; flex-direction: column; min-width: 0; font-size: .8rem; }
.scenario-option small { color: var(--muted); margin-top: .15rem; }
.sandbox-page { max-width: 1180px; margin: 0 auto; }
.sandbox-verification-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.5rem 1.7rem; border-radius: 20px; color: #fff; background: linear-gradient(125deg,#102b50,#17658b); box-shadow: 0 14px 34px rgba(15,51,85,.16); }
.sandbox-verification-hero h1 { color: #fff; margin: .25rem 0; font-weight: 780; }.sandbox-verification-hero p { color: #d7e9f7; margin: 0; }
.sandbox-progress-ring { width: 94px; height: 94px; flex: 0 0 94px; display: grid; place-content: center; text-align: center; border: 7px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(255,255,255,.1); }
.sandbox-progress-ring strong { font-size: 1.25rem; }.sandbox-progress-ring span { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; }
.sandbox-summary { display: grid; grid-template-columns: minmax(220px,1fr) minmax(260px,1fr); align-items: center; gap: 1.2rem; padding: 1rem 1.2rem; }
.sandbox-summary > div:first-child { display: flex; flex-direction: column; }.sandbox-summary span { color: var(--muted); font-size: .76rem; }
.sandbox-checklist { display: grid; gap: .75rem; }
.sandbox-scenario-card { display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: start; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 22px rgba(16,35,63,.05); }
.sandbox-scenario-card.passed { border-color: #9bd9b2; background: #f8fff9; }.sandbox-scenario-card.failed { border-color: #f0b4ae; background: #fffafa; }
.sandbox-scenario-code { width: 62px; height: 46px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: #eaf3ff; font-weight: 850; }
.sandbox-scenario-copy { min-width: 0; }.sandbox-scenario-copy h2 { margin: 0; font-size: .98rem; overflow-wrap: anywhere; }.sandbox-scenario-copy p { margin: .3rem 0 0; color: var(--muted); font-size: .76rem; }
.sandbox-error { margin-top: .4rem; color: #b42318; font-size: .75rem; }.sandbox-scenario-action { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,290px),1fr)); align-items: start; gap: .75rem; width: 100%; }
.sandbox-scenario-action .btn { align-self: start; }.sandbox-scenario-action > form > .btn { width: 100%; }.sandbox-portal-evidence { display: grid; gap: .4rem; width: 100%; max-width: none; margin: 0; padding: .65rem; border: 1px dashed #9ac4a8; border-radius: 9px; background: #f7fff9; }
.sandbox-portal-evidence summary { cursor: pointer; color: #157347; font-size: .76rem; font-weight: 750; }
.sandbox-portal-evidence small { color: var(--muted); font-size: .68rem; line-height: 1.3; }
.production-ready { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 1.2rem; padding: 1.2rem; border-color: #8fd1aa; background: linear-gradient(135deg,#f4fff7,#fff); }
.production-ready > div { display: flex; align-items: flex-start; gap: .9rem; }.production-ready-mark { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #198754; font-size: 1.2rem; font-weight: 800; }
.production-ready h2 { margin: 0 0 .25rem; font-size: 1.05rem; }.production-ready p { margin: 0; color: var(--muted); font-size: .8rem; }

.invoice-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.invoice-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.invoice-editor { overflow: visible; }
.invoice-editor fieldset { padding: .8rem .8rem 0; }
.invoice-header-grid { display: grid; grid-template-columns: 130px minmax(230px,1.5fr) 145px 105px minmax(180px,1fr); gap: .55rem; padding-bottom: .75rem; }
.invoice-header-grid.no-scenario { grid-template-columns: minmax(260px,1.25fr) 130px minmax(260px,1.5fr) 145px minmax(180px,1fr); }
.invoice-header-grid .form-label { margin-bottom: .2rem; color: #5f6f82; font-size: .7rem; font-weight: 700; }
.invoice-header-grid .form-control, .invoice-header-grid .form-select { min-height: 36px; height: 36px; padding: .3rem .55rem; font-size: .78rem; }
.invoice-lines-wrap { border: 1px solid var(--line); border-radius: 10px; box-shadow: none; }
.invoice-lines-table { width: 100%; min-width: 1515px; margin: 0; table-layout: fixed; font-size: .76rem; }
.invoice-lines-table [hidden] { display: none !important; }
.invoice-lines-table > :not(caption) > * > * { padding: .3rem .28rem; }
.invoice-lines-table thead th { padding-block: .4rem; font-size: .66rem; }
.invoice-lines-table th[data-column="Product"] { width: 400px; }
.invoice-lines-table th[data-column="Units"] { width: 105px; }
.invoice-lines-table th[data-column="HSCode"] { width: 105px; }
.invoice-lines-table th[data-column="Uom"] { width: 105px; }
.invoice-lines-table th[data-column="LotNo"] { width: 140px; }
.list-filter-bar{display:grid;grid-template-columns:minmax(260px,1fr) minmax(150px,210px) minmax(140px,190px) auto auto;gap:.5rem;align-items:center}.list-filter-wide{grid-template-columns:minmax(250px,1fr) repeat(3,minmax(140px,190px)) auto auto}.list-filter-bar .form-control,.list-filter-bar .form-select,.list-filter-bar .btn{min-height:38px}
@media(max-width:767.98px){.list-filter-bar,.list-filter-wide{grid-template-columns:1fr 1fr}.list-filter-bar .list-search{grid-column:1/-1}.list-filter-bar .btn{width:100%}}
.invoice-lines-table th[data-column="Bales"] { width: 90px; }
.invoice-lines-table th[data-column="Quantity"],.invoice-lines-table th[data-column="WeightKg"],.invoice-lines-table th[data-column="QtyKg"] { width: 110px; }
.invoice-lines-table th[data-column="Maunds"] { width: 100px; }
.invoice-lines-table th[data-column="Rate"] { width: 115px; }
.invoice-lines-table th[data-column="Amount"],.invoice-lines-table th[data-column="TaxAmount"] { width: 125px; }
.invoice-lines-table th[data-column="Discount"],.invoice-lines-table th[data-column="FurtherTax"] { width: 105px; }
.invoice-lines-table th[data-column="NetAmount"] { width: 130px; }
.invoice-lines-table th[data-column="TaxRate"] { width: 70px; }
.invoice-lines-table th[data-column="FurtherTaxRate"],.invoice-lines-table th[data-column="AdvanceTaxRate"] { width: 80px; }
.invoice-lines-table th:last-child { width: 40px; }
.invoice-lines-table .form-control, .invoice-lines-table .form-select { min-height: 32px; height: 32px; padding: .25rem .4rem; border-radius: 6px; font-size: .75rem; }
.invoice-lines-table .remove { width: 29px; height: 29px; padding: 0; }
.invoice-lines-table .line-excl, .invoice-lines-table .line-st, .invoice-lines-table .line-total { font-variant-numeric: tabular-nums; }
.invoice-lines-table .tax-rate,.invoice-lines-table .further-tax-rate,.invoice-lines-table .further-tax { font-variant-numeric: tabular-nums; }
.invoice-lines-table .weight-kg[readonly] { background: #eef5fc; color: #174f86; font-weight: 700; font-variant-numeric: tabular-nums; }
.search-select { position: relative; min-width: 0; }
.search-select-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.search-select-input { padding-right: 1.8rem !important; background-image: linear-gradient(45deg,transparent 50%,#708096 50%),linear-gradient(135deg,#708096 50%,transparent 50%); background-position: calc(100% - 13px) 50%,calc(100% - 9px) 50%; background-size: 4px 4px,4px 4px; background-repeat: no-repeat; }
.search-select-menu { position: fixed; z-index: 2000; display: none; max-height: 230px; overflow-y: auto; padding: .3rem; border: 1px solid #cfd9e6; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(16,35,63,.22); }
.search-select-menu.show { display: block; }
.search-select-option { display: block; width: 100%; padding: .48rem .55rem; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; font-size: .76rem; }
.search-select-option:hover, .search-select-option:focus { background: #eaf3ff; color: var(--blue); outline: 0; }
.search-select-empty { display: block; padding: .55rem; color: var(--muted); font-size: .75rem; text-align: center; }
.search-select-option.active { background: #eaf3ff; color: var(--blue); }

.purchase-editor { overflow: visible; border-radius: 12px; }
.purchase-header-grid { display: grid; grid-template-columns: minmax(160px,1.2fr) 140px minmax(200px,1.6fr) minmax(150px,1fr); gap: .55rem .7rem; }
.purchase-header-grid .form-label { margin-bottom: .2rem; font-size: .73rem; font-weight: 700; }
.purchase-editor .form-control-sm,.purchase-editor .form-select-sm { min-height: 34px; font-size: .81rem; }
.purchase-grid { min-width: 920px; margin-bottom: .4rem; }
.purchase-grn-grid { min-width: 1260px; }
.purchase-grid th { white-space: nowrap; color: #536782; font-size: .69rem; text-transform: uppercase; letter-spacing: .025em; }
.purchase-grid td { vertical-align: top; }
.purchase-grid td:not(.purchase-product-cell) input { min-width: 70px; }
.purchase-product-cell { min-width: 250px; }
.po-product-code,.po-product-uom { color: #435875; font-size: .78rem; white-space: nowrap; vertical-align: middle!important; }
.po-compact #po-lines { min-width: 850px; }
.purchase-line-details summary { color: #335a83; cursor: pointer; font-size: .69rem; margin-top: .24rem; }
.purchase-trace-grid { display: grid; grid-template-columns: repeat(3,minmax(100px,1fr)); gap: .25rem; margin-top: .35rem; min-width: 360px; }
.purchase-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e3eaf5; padding: .55rem 0 .15rem; z-index: 2; }
.purchase-add-row::before,#operation-add-input::before,#operation-add-output::before,#accounting-add-line::before { content: "＋"; margin-right: .24rem; font-weight: 800; }
.purchase-actions .btn::before,#accounting-save::before { content: "✓"; margin-right: .28rem; font-weight: 800; }
.pi-product-code,.pi-product-uom,.grn-product-code,.grn-product-uom{color:#435875;font-size:.78rem;white-space:nowrap;vertical-align:middle!important}
.pi-compact #pi-lines th:nth-child(6),.pi-compact #pi-lines td:nth-child(6),
.pi-compact #pi-lines th:nth-child(10),.pi-compact #pi-lines td:nth-child(10),
.pi-compact #pi-lines th:nth-child(11),.pi-compact #pi-lines td:nth-child(11){display:none}
.pi-compact #pi-lines .pi-discount-advanced,.pi-compact #pi-lines .pi-discount-amount{display:none}
.purchase-editor:not(.pi-advance-enabled) #pi-lines .pi-advance-column{display:none}
.pi-compact #pi-lines .pi-fixed-discount .pi-discount-amount{display:block}
.pi-compact #pi-lines .pi-fixed-discount .pi-discount-percent{display:none}
.pi-compact #pi-lines .pi-fixed-discount .pi-discount-cell::before{content:'Amount';display:block;color:#52647b;font-size:.68rem;font-weight:700}
.grn-compact #grn-lines{min-width:760px}
.grn-compact #grn-lines th:nth-child(3),.grn-compact #grn-lines td:nth-child(3),
.grn-compact #grn-lines th:nth-child(4),.grn-compact #grn-lines td:nth-child(4),
.grn-compact #grn-lines th:nth-child(9),.grn-compact #grn-lines td:nth-child(9),
.grn-compact #grn-lines th:nth-child(10),.grn-compact #grn-lines td:nth-child(10),
.grn-compact #grn-lines th:nth-child(11),.grn-compact #grn-lines td:nth-child(11),
.grn-compact #grn-lines th:nth-child(12),.grn-compact #grn-lines td:nth-child(12){display:none}
@media(max-width:575px){
  #pi-lines,#operation-lines{min-width:0!important;display:block}
  #pi-lines thead,#operation-lines thead{display:none}
  #pi-lines tbody,#operation-lines tbody{display:block}
  #pi-lines tbody tr,#operation-lines tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem;padding:.7rem;margin-bottom:.7rem;border:1px solid #dbe5f2;border-radius:10px;background:#fff}
  #pi-lines tbody td,#operation-lines tbody td{display:block!important;min-width:0;padding:.12rem!important;border:0}
  #pi-lines tbody td:nth-child(2),#operation-lines tbody td:nth-child(2),#operation-lines tbody td:nth-last-child(2){grid-column:1/-1}
  #pi-lines tbody td:nth-child(1)::before{content:'Code'}#pi-lines tbody td:nth-child(3)::before{content:'Qty'}
  #pi-lines tbody td:nth-child(4)::before{content:'FOC'}#pi-lines tbody td:nth-child(5)::before{content:'UOM'}
  #pi-lines tbody td:nth-child(6)::before{content:'Factor'}#pi-lines tbody td:nth-child(7)::before{content:'Rate'}
  #pi-lines tbody td:nth-child(8)::before{content:'Disc%'}#pi-lines tbody td:nth-child(9)::before{content:'Tax%'}
  #pi-lines tbody td:nth-child(10)::before{content:'Further%'}#pi-lines tbody td:nth-child(11)::before{content:'Other%'}
  #pi-lines tbody td:nth-child(12)::before{content:'Adv Tax%'}#pi-lines tbody td:nth-child(13)::before{content:'Net'}
  #operation-lines tbody td:nth-child(1)::before{content:'Role'}#operation-lines tbody td:nth-child(3)::before{content:'Quantity'}
  #operation-lines tbody td:nth-child(4)::before{content:'Factor'}
  #pi-lines tbody td::before,#operation-lines tbody td::before{display:block;font-size:.72rem;font-weight:700;color:#52647b}
  #pi-lines tbody td:last-child,#operation-lines tbody td:last-child{grid-column:1/-1;text-align:right}
  #pi-lines tbody td:last-child .btn,#operation-lines tbody td:last-child .btn{min-width:44px}
  .pi-compact #pi-lines tbody td:nth-child(6),.pi-compact #pi-lines tbody td:nth-child(10),.pi-compact #pi-lines tbody td:nth-child(11){display:none!important}
  #grn-lines{min-width:0!important;display:block}
  #grn-lines thead{display:none}
  #grn-lines tbody{display:block}
  #grn-lines tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem;padding:.7rem;margin-bottom:.7rem;border:1px solid #dbe5f2;border-radius:10px;background:#fff}
  #grn-lines tbody td{display:block!important;min-width:0;padding:.12rem!important;border:0}
  #grn-lines tbody td:nth-child(2),#grn-lines tbody td:last-child{grid-column:1/-1}
  #grn-lines tbody td::before{display:block;font-size:.72rem;font-weight:700;color:#52647b}
  #grn-lines tbody td:nth-child(1)::before{content:'Code'}#grn-lines tbody td:nth-child(3)::before{content:'PO qty'}
  #grn-lines tbody td:nth-child(4)::before{content:'Previous'}#grn-lines tbody td:nth-child(5)::before{content:'Received'}
  #grn-lines tbody td:nth-child(6)::before{content:'FOC'}#grn-lines tbody td:nth-child(7)::before{content:'Accepted'}
  #grn-lines tbody td:nth-child(8)::before{content:'UOM'}#grn-lines tbody td:nth-child(9)::before{content:'Rejected'}
  #grn-lines tbody td:nth-child(10)::before{content:'Quarantine'}#grn-lines tbody td:nth-child(11)::before{content:'Factor'}
  #grn-lines tbody td:nth-child(12)::before{content:'Est. rate'}
  .grn-compact #grn-lines tbody td:nth-child(3),.grn-compact #grn-lines tbody td:nth-child(4),
  .grn-compact #grn-lines tbody td:nth-child(9),.grn-compact #grn-lines tbody td:nth-child(10),
  .grn-compact #grn-lines tbody td:nth-child(11),.grn-compact #grn-lines tbody td:nth-child(12){display:none!important}
}
.purchase-print { max-width: 1050px; margin: 0 auto; background: #fff; padding: 1rem; color: #13243b; }
.purchase-print-head { display: flex; justify-content: space-between; align-items: start; border-bottom: 2px solid #1c61ac; margin-bottom: .65rem; padding-bottom: .5rem; }
.purchase-print-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .3rem .7rem; font-size: .82rem; margin-bottom: .7rem; }
.purchase-print-table { font-size: .75rem; }
.purchase-print-table thead { display: table-header-group; }
.purchase-print-table tr { break-inside: avoid; }
.purchase-signatures { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; font-size: .75rem; }
@media (max-width: 900px) { .purchase-header-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .purchase-print-meta { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 575px) { .purchase-header-grid { grid-template-columns: 1fr; } .purchase-editor .form-control-sm,.purchase-editor .form-select-sm,.purchase-editor .btn { min-height: 44px; font-size: 16px; } .purchase-grid { min-width: 850px; } .purchase-grn-grid { min-width: 1200px; } .purchase-signatures { flex-direction: column; } }
@media (max-width: 575px) {
    .po-compact #po-lines { min-width: 0; display: block; }
    .po-compact #po-lines thead { display: none; }
    .po-compact #po-lines tbody { display: block; }
    .po-compact #po-lines tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; padding: .7rem; margin-bottom: .7rem; border: 1px solid #dbe5f2; border-radius: 10px; }
    .po-compact #po-lines tbody td { display: block; min-width: 0; padding: .12rem; border: 0; }
    .po-compact #po-lines tbody td:nth-child(2),.po-compact #po-lines tbody td:last-child { grid-column: 1/-1; }
    .po-compact #po-lines tbody td:nth-child(3)::before { content: 'Qty'; }
    .po-compact #po-lines tbody td:nth-child(5)::before { content: 'Rate'; }
    .po-compact #po-lines tbody td:nth-child(6)::before { content: 'Disc%'; }
    .po-compact #po-lines tbody td:nth-child(7)::before { content: 'Tax%'; }
    .po-compact #po-lines tbody td:nth-child(8)::before { content: 'Net'; }
    .po-compact #po-lines tbody td:nth-child(n+3):nth-child(-n+8)::before { display: block; color: #52647b; font-size: .72rem; font-weight: 700; }
    .po-compact #po-lines tbody td:last-child { text-align: right; }
    .po-compact #po-lines tfoot { display: table; width: 100%; }
}
@media (max-width: 575px) {
    #pi-lines { min-width: 0; }
    #pi-lines thead { display: none; }
    #pi-lines tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; border-bottom: 1px solid #cbd9eb; padding: .8rem .15rem; }
    #pi-lines tbody td { display: block; min-width: 0; border: 0; padding: 0; }
    #pi-lines tbody td:nth-child(2) { grid-column: 1/-1; }
    #pi-lines tbody td:nth-child(1)::before { content: 'Code'; }
    #pi-lines tbody td:nth-child(3)::before { content: 'Qty'; }
    #pi-lines tbody td:nth-child(4)::before { content: 'FOC'; }
    #pi-lines tbody td:nth-child(5)::before { content: 'UOM'; }
    #pi-lines tbody td:nth-child(6)::before { content: 'Conversion factor'; }
    #pi-lines tbody td:nth-child(7)::before { content: 'Unit rate'; }
    #pi-lines tbody td:nth-child(8)::before { content: 'Disc%'; }
    #pi-lines tbody td:nth-child(9)::before { content: 'Sales tax %'; }
    #pi-lines tbody td:nth-child(10)::before { content: 'Further tax %'; }
    #pi-lines tbody td:nth-child(11)::before { content: 'Other tax %'; }
    #pi-lines tbody td:nth-child(12)::before { content: 'Adv Tax%'; }
    #pi-lines tbody td:nth-child(13)::before { content: 'Net'; }
    #pi-lines tbody td:not(:last-child)::before { display: block; font-size: .75rem; font-weight: 700; color: #536782; }
    #pi-lines tbody td:last-child { grid-column: 1/-1; text-align: right; }
    #pi-lines input,#pi-lines select { width: 100%; }
    #pi-charges { min-width: 480px; }
    #pi-preview { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -4px 16px #dce6f5; }
}
@media print { .purchase-print { max-width: none; padding: 0; } .purchase-print-head { break-after: avoid; } .purchase-print-table { width: 100%; } }
.customer-selection-hint { display: block; margin-top: .2rem; color: #718096; font-size: .68rem; line-height: 1.2; }
.invoice-add-line { margin-top: .55rem; }
.invoice-actions { display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; border-top: 1px solid var(--line); background: #fbfcfe; }
.invoice-actions .btn { min-width: 110px; }
.uncertain-posting-resolution { width: 100%; display: grid; gap: .55rem; }
.uncertain-posting-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; padding: .65rem; border: 1px solid #f0c36a; border-radius: 9px; background: #fffaf0; }
.uncertain-posting-options > div { min-width: 0; }
.uncertain-posting-action { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .35rem; }
.uncertain-posting-action .form-control { flex: 1 1 220px; max-width: 320px; }

.report-page { max-width: 1500px; margin: 0 auto; }
.report-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: 1.35rem 1.55rem; border-radius: 18px; color: #fff; background: linear-gradient(120deg,#0c284b,#126d85); box-shadow: 0 14px 34px rgba(15,51,85,.16); }
.report-hero h1 { margin: .18rem 0; color: #fff; font-size: 1.65rem; font-weight: 780; }.report-hero p { margin: 0; color: #c7e0eb; }.report-hero .entry-kicker { color: #7cd6e5; }
.report-filters { display: grid; grid-template-columns: 125px 125px repeat(6,minmax(125px,1fr)) auto; align-items: end; gap: .65rem; margin: 1rem 0; padding: .9rem; border: 1px solid var(--line); border-radius: 14px; }
.report-filters .alert { grid-column: 1 / -1; }.report-filters label { display: block; margin-bottom: .2rem; color: #617286; font-size: .68rem; font-weight: 750; }.report-filters .form-control,.report-filters .form-select { min-height: 36px; height: 36px; padding: .3rem .5rem; font-size: .75rem; }.report-wide { min-width: 175px; }.report-filter-actions { display: flex; gap: .35rem; }.report-filter-actions .btn { white-space: nowrap; }
.report-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .8rem; margin-bottom: 1rem; }.report-kpis > div { display: flex; flex-direction: column; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 7px 20px rgba(16,35,63,.05); }.report-kpis span { color: var(--muted); font-size: .7rem; font-weight: 700; }.report-kpis strong { margin: .15rem 0; color: #122e50; font-size: 1.35rem; font-variant-numeric: tabular-nums; }.report-kpis small { color: #8491a1; font-size: .68rem; }.report-kpis .report-kpi-total { border-color: #9fd5df; background: linear-gradient(135deg,#effbfc,#fff); }
.report-section { margin-bottom: 1rem; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }.report-section-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }.report-section-head h2 { margin: 0; font-size: 1rem; font-weight: 760; }.report-section-head p { margin: .12rem 0 0; color: var(--muted); font-size: .68rem; }.report-section-head > span { padding: .25rem .55rem; border-radius: 20px; color: #316184; background: #eaf3fa; font-size: .68rem; font-weight: 700; }
.report-table { margin: 0; min-width: 860px; font-size: .73rem; }.report-table > :not(caption) > * > * { padding: .48rem .6rem; }.report-table thead th { color: #617286; background: #f6f9fc; font-size: .64rem; text-transform: uppercase; letter-spacing: .035em; }.report-table td { font-variant-numeric: tabular-nums; }.report-table td:first-child small { display: block; margin-top: .1rem; color: var(--muted); font-size: .62rem; }.report-empty { padding: 2rem !important; color: var(--muted); text-align: center; }

.dashboard-hero { position: relative; overflow: hidden; min-height: 215px; padding: 2rem 2.2rem; border-radius: 22px; background: linear-gradient(120deg, #0b1f3a, #123f6c 68%, #146b87); box-shadow: 0 18px 40px rgba(11,31,58,.2); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.dashboard-hero::after { content: ""; position: absolute; right: -80px; top: -140px; width: 360px; height: 360px; border: 70px solid rgba(58,190,218,.11); border-radius: 50%; }
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero h1 { color: #fff; font-size: clamp(1.65rem, 3vw, 2.5rem); font-weight: 760; margin: .55rem 0 .35rem; }
.dashboard-hero p { color: #bed0e4; margin: 0; }
.hero-status { min-width: 270px; display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); border-radius: 14px; backdrop-filter: blur(8px); }
.hero-status div { display: flex; flex-direction: column; }.hero-status small { color: #b8d1e5; margin-top: .15rem; }
.status-pulse { width: 12px; height: 12px; border-radius: 50%; background: #57e39a; box-shadow: 0 0 0 7px rgba(87,227,154,.13); }
.section-heading { margin: 2rem 0 1rem; display: flex; align-items: end; justify-content: space-between; }
.section-heading h2 { font-size: 1.25rem; font-weight: 750; margin: 0; }.section-heading p { color: var(--muted); margin: .2rem 0 0; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.quick-card { min-height: 112px; display: flex; align-items: center; gap: 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 8px 26px rgba(16,35,63,.06); transition: transform .18s ease, box-shadow .18s ease; }
.quick-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 15px 34px rgba(16,35,63,.11); }
.quick-card > div { flex: 1; display: flex; flex-direction: column; }.quick-card strong { font-size: 1rem; }.quick-card small { color: var(--muted); margin-top: .22rem; }
.quick-icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 13px; font-weight: 800; font-size: .75rem; }
.accent-blue .quick-icon { color: #155ec0; background: #e7f1ff; }.accent-violet .quick-icon { color: #7047b7; background: #f0eaff; }.accent-green .quick-icon { color: #16835b; background: #e6f8f0; }.accent-orange .quick-icon { color: #b25a0b; background: #fff0df; }
.quick-arrow { color: #9aa8b9; font-size: 1.3rem; }

.login-body { margin: 0; overflow-x: hidden; background: #071a33; }
.login-shell { position: relative; z-index: 2; min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .92fr) minmax(520px, 1.08fr); }
.login-story { position: relative; padding: clamp(2rem, 5vw, 4.8rem); display: flex; flex-direction: column; color: #fff; background: radial-gradient(circle at 15% 20%, rgba(33,184,213,.18), transparent 32%), linear-gradient(145deg, rgba(7,26,51,.96), rgba(11,45,78,.94)); }
.login-brand { color: #fff; }.login-brand small { color: #86b5d7; }
.story-copy { margin: auto 0; max-width: 650px; }
.story-copy h1 { color: #fff; font-size: clamp(2.4rem, 4.4vw, 4.4rem); font-weight: 780; line-height: 1.03; margin: 1rem 0 1.2rem; }
.story-copy > p { color: #b6cce0; max-width: 580px; font-size: 1.08rem; line-height: 1.7; }
.trust-list { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; color: #d9e8f4; font-size: .82rem; margin-top: 1.7rem; }
.trust-list span::first-letter { color: #57e39a; }
.story-foot { color: #7899b7; font-size: .8rem; }
.login-panel { background: #f6f9fd; display: grid; place-items: center; padding: 2rem; }
.login-form-wrap { width: min(100%, 465px); padding: clamp(1.1rem, 2vw, 2rem); }
.mobile-login-brand { display: none; margin-bottom: 2rem; }
.login-form-wrap h2 { font-size: clamp(1.7rem, 3vw, 2.25rem); font-weight: 770; margin: .5rem 0 .65rem; }
.login-intro { color: var(--muted); line-height: 1.6; margin-bottom: 1.7rem; }
.login-form .form-control-lg { min-height: 56px; font-size: .96rem; border-radius: 12px; padding: .85rem 1rem; }
.login-form .form-control::placeholder { color: #a3afbe; }
.platform-hint { display: flex; align-items: center; gap: .55rem; color: #66778d; background: #edf4fd; border-radius: 10px; padding: .72rem .8rem; margin: 1rem 0 1.25rem; font-size: .76rem; }
.hint-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(25,103,210,.1); }
.login-submit { min-height: 55px; display: flex; justify-content: space-between; align-items: center; padding-inline: 1.2rem; border-radius: 12px; }
.login-help { color: #8895a6; text-align: center; font-size: .74rem; margin: 1.35rem 0 0; }
.login-orb { position: fixed; z-index: 1; border-radius: 50%; filter: blur(2px); pointer-events: none; }.login-orb-one { width: 300px; height: 300px; left: -120px; bottom: -100px; background: rgba(33,184,213,.13); }.login-orb-two { width: 250px; height: 250px; right: -100px; top: -80px; background: rgba(25,103,210,.1); }

/* Compact authenticated workspace */
.app-body .app-page { padding-top: 1rem; padding-bottom: 1.5rem; }
.app-body .app-main h1 { margin-bottom: .25rem; }.app-body .app-main .h3 { font-size: 1.35rem; }
.app-body .card-body { padding: .9rem; }.app-body .card-header { padding: .65rem .85rem; }
.app-body .form-control,.app-body .form-select { min-height: 36px; padding: .4rem .62rem; border-radius: 8px; font-size: .82rem; }
.app-body textarea.form-control { min-height: 64px; }
.app-body .form-label { margin-bottom: .22rem; font-size: .76rem; }.app-body .form-text { margin-top: .18rem; font-size: .69rem; }
.app-body .btn { padding: .4rem .68rem; font-size: .8rem; border-radius: 8px; }.app-body .btn-sm { padding: .3rem .52rem; font-size: .73rem; }
.app-body .table > :not(caption) > * > * { padding: .58rem .72rem; }.app-body .table thead th { font-size: .68rem; }
.app-body .entry-form { padding: .9rem; }.app-body .entry-form .form-control,.app-body .entry-form .form-select { min-height: 38px; }.app-body .entry-form textarea.form-control { min-height: 68px; padding-top: .5rem; }
.app-body .entry-section { padding: .85rem; }.app-body .entry-section-heading { margin-bottom: .75rem; }.app-body .entry-actions { margin-top: .85rem; padding-top: .75rem; }
.app-body .row.g-3 { --bs-gutter-y: .7rem; --bs-gutter-x: .7rem; }.app-body .mb-3 { margin-bottom: .75rem !important; }.app-body .mt-4 { margin-top: 1rem !important; }
.app-body .page-tools { margin-bottom: .5rem; }.app-body .alert { padding: .65rem .8rem; font-size: .8rem; }
.licence-alert { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }.licence-alert .btn-link { margin-left: auto; padding-block: 0; }.licence-modal .modal-content { overflow: hidden; border: 0; border-radius: 17px; box-shadow: 0 24px 70px rgba(10,31,55,.22); }.licence-modal .modal-body { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: .85rem; padding: 1.25rem; }.licence-modal-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; font-size: 1.25rem; font-weight: 850; }.licence-modal-icon.warning { color: #8a5700; background: #fff0c9; }.licence-modal-icon.critical { color: #fff; background: #d83b32; }.licence-modal h2 { margin: .12rem 0 .4rem; font-size: 1.25rem; }.licence-modal p { margin-bottom: .75rem; color: #52657b; font-size: .82rem; }.licence-modal dl { display: grid; grid-template-columns: repeat(3,1fr); gap: .4rem; margin: 0 0 .65rem; }.licence-modal dl div { padding: .5rem; border-radius: 8px; background: #f4f7fb; }.licence-modal dt { color: #758396; font-size: .62rem; }.licence-modal dd { margin: .1rem 0 0; font-size: .75rem; font-weight: 750; }.licence-modal small { color: #7b8999; }.licence-modal .modal-footer { padding: .75rem 1rem; background: #f8fafc; }
.support-filter { display: grid; grid-template-columns: minmax(240px,1fr) 150px auto; gap: .55rem; align-items: end; }.support-cleanup { display: grid; grid-template-columns: minmax(280px,1fr) 150px auto auto; gap: .75rem; align-items: end; }.support-cleanup .form-check { align-self: center; margin: 0; }
.company-transfer-form { display: inline-grid; grid-template-columns: minmax(190px,1fr) auto; gap: .3rem; min-width: 330px; }.company-transfer-form .form-select { min-height: 31px; height: 31px; font-size: .7rem; }

@media (max-width: 1199.98px) {
  .app-header .navbar-collapse { padding-top: .85rem; }
  .app-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: .35rem; }
  .user-menu { border-left: 0; padding: .85rem 0 .2rem; }
  .app-nav { align-items: stretch; }.app-nav-menu { width: 100%; margin: .15rem 0 .35rem !important; border: 0; box-shadow: none !important; background: #f7faff; }.app-nav .nav-link { display: flex; justify-content: space-between; }
  .report-filters { grid-template-columns: repeat(4,minmax(0,1fr)); }.report-wide { min-width: 0; }.report-filter-actions { grid-column: span 2; }
}
@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; background: #f6f9fd; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 1.25rem; }
  .mobile-login-brand { display: flex; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .invoice-header-grid, .invoice-header-grid.no-scenario { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .invoice-profile, .invoice-customer { grid-column: span 2; }
  .invoice-reference { grid-column: span 2; }
  .invoice-delivery-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }.invoice-delivery-notes { grid-column: span 2; }
  .invoice-tax-panel { grid-template-columns: 1fr; gap: .55rem; }
  .invoice-tax-summary { justify-self: end; }
}
@media (max-width: 767.98px) {
  html { font-size: 14px; }
  .app-header .navbar { min-height: 64px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .app-page { padding-top: 1rem; }
  .app-main > .d-flex.justify-content-between { align-items: flex-start !important; gap: .8rem; }
  .app-main > .d-flex.justify-content-between .btn { white-space: nowrap; }
  .dashboard-hero { min-height: 235px; padding: 1.55rem; flex-direction: column; align-items: flex-start; justify-content: center; }
  .hero-status { min-width: 0; width: 100%; }
  .quick-grid { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 96px; }
  .table-responsive { border-radius: 9px; }
  .app-body .table { font-size: .7rem; line-height: 1.22; }
  .app-body .table > :not(caption) > * > * { padding: .38rem .42rem; }
  .app-body .table thead th { padding-block: .4rem; font-size: .58rem; letter-spacing: .025em; }
  .app-body .table td strong { font-size: .71rem; }
  .app-body .table td small { font-size: .6rem; line-height: 1.15; }
  .app-body .table td .btn-sm { padding: .22rem .34rem; border-radius: 6px; font-size: .62rem; }
  .app-body .table td form.d-inline { white-space: nowrap; }
  .app-body .list-group-item { padding: .48rem .58rem; font-size: .72rem; line-height: 1.25; }
  .app-body .list-group-item small { font-size: .61rem; }
  .app-body .card-header { padding: .48rem .58rem; font-size: .72rem; }
  .app-body .card-body { padding: .65rem; font-size: .75rem; }
  .app-body .text-muted { font-size: .68rem; }
  .app-body .badge { font-size: .58rem; }
  .app-body .app-main h1,.app-body .app-main .h3 { font-size: 1.12rem; }
  .app-body .app-main h2,.app-body .app-main .h4 { font-size: .92rem; }
  .app-body .page-tools { gap: .25rem; }.app-body .page-tools .btn { padding: .27rem .4rem; font-size: .65rem; }
  .licence-nav-notice { width: 100%; justify-content: center; }.licence-alert .btn-link { margin-left: 0; }.licence-modal .modal-body { grid-template-columns: 38px minmax(0,1fr); padding: .9rem; }.licence-modal-icon { width: 38px; height: 38px; border-radius: 10px; }.licence-modal dl { grid-template-columns: 1fr; }
  .company-transfer-form { min-width: 260px; grid-template-columns: minmax(150px,1fr) auto; }
  .support-filter,.support-cleanup { grid-template-columns: 1fr 1fr; gap: .45rem; }.support-filter .btn,.support-cleanup > div:first-child { grid-column: 1 / -1; }.support-cleanup .btn { width: 100%; }
  .card-body { padding: 1rem; }
  .entry-page { margin-inline: -.2rem; }
  .entry-hero { border-radius: 16px 16px 0 0; padding: 1.15rem; }
  .entry-hero p { display: none; }
  .entry-icon { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; }
  .entry-hero h1 { font-size: 1.35rem; }
  .entry-form { padding: .85rem; border-radius: 0 0 16px 16px; }
  .entry-section { padding: 1rem; }
  .entry-actions { position: sticky; bottom: 0; z-index: 5; margin: 1rem -.85rem -.85rem; padding: .8rem; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
  .entry-actions .btn { flex: 1; }
  .third-schedule-note { align-items: flex-start; flex-direction: column; }
  .rate-policy-card { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .sandbox-verification-hero { padding: 1.1rem; }.sandbox-verification-hero p { display: none; }.sandbox-progress-ring { width: 74px; height: 74px; flex-basis: 74px; }
  .sandbox-summary { grid-template-columns: 1fr; }.sandbox-scenario-card { grid-template-columns: 56px minmax(0,1fr); align-items: start; padding: .8rem; gap: .7rem; }.sandbox-scenario-code { width: 52px; }
  .sandbox-scenario-action { grid-template-columns: 1fr; }.sandbox-scenario-action .btn { width: 100%; }.sandbox-portal-evidence .d-flex { flex-direction: column; }.production-ready { align-items: stretch; flex-direction: column; }
  .invoice-toolbar { align-items: flex-start; }
  .invoice-toolbar-actions { max-width: 55%; }
  .invoice-editor fieldset { padding: .6rem .6rem 0; }
  .invoice-header-grid, .invoice-header-grid.no-scenario { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; }
  .invoice-profile, .invoice-customer, .invoice-reference { grid-column: span 2; }
  .invoice-lines-wrap { overflow: visible; border: 0; background: transparent; }
  .invoice-lines-table { min-width: 0; display: block; }
  .invoice-lines-table thead { display: none; }
  .invoice-lines-table tbody { display: grid; gap: .5rem; }
  .invoice-lines-table tbody tr.invoice-line { display: grid; grid-template-columns: 58px 82px 72px minmax(72px,1fr) 30px; gap: .32rem; padding: .48rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .invoice-lines-table tbody td { display: block; padding: 0; border: 0; min-width: 0; }
  .invoice-lines-table tbody td::before { content: attr(data-label); display: block; margin: 0 0 .12rem .05rem; color: var(--muted); font-size: .58rem; font-weight: 750; text-transform: uppercase; }
  .invoice-lines-table .line-product { grid-column: 1 / -1; }
  .invoice-lines-table .line-excl, .invoice-lines-table .line-st { display: none; }
  .invoice-lines-table .line-remove { align-self: end; padding-bottom: 1px; }
  .invoice-lines-table .form-control, .invoice-lines-table .form-select { width: 100%; }
  .invoice-lines-table tfoot { display: block; margin-top: .5rem; }
  .invoice-lines-table tfoot tr { display: flex; justify-content: flex-end; align-items: center; padding: .55rem .65rem; border-radius: 8px; background: #edf5ff; }
  .invoice-lines-table tfoot .sum-label, .invoice-lines-table tfoot .sum-excl, .invoice-lines-table tfoot .sum-st, .invoice-lines-table tfoot th:last-child { display: none; }
  .invoice-lines-table tfoot .sum-total { display: block; border: 0; padding: 0; font-size: .9rem; }
  .invoice-lines-table tfoot .sum-total::before { content: "Invoice total  "; color: var(--muted); font-weight: 600; }
  .invoice-actions { position: sticky; bottom: 0; z-index: 6; flex-wrap: wrap; }
  .invoice-actions .btn { flex: 1; }
  .uncertain-posting-options { grid-template-columns: 1fr; }
  .uncertain-posting-options .btn { flex: 0 1 auto; }
  .invoice-delivery-panel { padding: .6rem; }.invoice-delivery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .42rem; }.invoice-delivery-notes { grid-column: 1 / -1; }.invoice-delivery-title small { display: none; }
  .invoice-tax-panel { grid-template-columns: 1fr; }
  .report-hero { align-items: flex-start; padding: 1.1rem; }.report-hero p { display: none; }.report-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }.report-wide,.report-filter-actions { grid-column: 1 / -1; }.report-filter-actions .btn { flex: 1; }.report-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }.report-kpis > div { padding: .8rem; }.report-kpis strong { font-size: 1.05rem; }
  .input-group { max-width: none !important; }
  .login-panel { align-items: start; padding-top: 2rem; }
  .login-form-wrap { padding: .5rem 0; }
  .app-footer > div { flex-direction: column; justify-content: center; align-items: flex-start; gap: .15rem; }
}
@media (max-width: 480px) {
  html { font-size: 13px; }
  .app-brand small { display: none; }
  .app-main > .d-flex.justify-content-between { flex-direction: column; }
  .app-main > .d-flex.justify-content-between .btn { width: 100%; }
  .invoice-delivery-grid { grid-template-columns: 1fr; }.invoice-delivery-notes { grid-column: auto; }
  .invoice-tax-controls { grid-template-columns: 1fr; }
  .invoice-tax-summary { grid-template-columns: 1fr; justify-self: stretch; }
  .support-filter,.support-cleanup { grid-template-columns: 1fr; }.support-filter .btn,.support-cleanup > div:first-child { grid-column: auto; }
  .login-form-wrap h2 { font-size: 1.65rem; }
}

/* Mobile usability: readable data grids and touch-sized controls */
@media (max-width: 767.98px) {
  html { font-size: 15px; }
  .app-body { overflow-x: hidden; }
  .app-body .app-page { padding: .75rem .65rem 1.25rem; }
  .app-header .navbar { min-height: 66px; }
  .navbar-toggler { min-width: 44px; min-height: 44px; }
  .app-nav .nav-link { min-height: 46px; align-items: center; padding: .7rem .75rem !important; font-size: .9rem; }
  .app-nav-menu .dropdown-item { min-height: 48px; padding: .55rem .65rem; }
  .app-nav-menu .dropdown-item strong { font-size: .86rem; }
  .app-nav-menu .dropdown-item small { font-size: .74rem; }
  .user-menu { gap: .55rem; }
  .btn-account,.btn-signout,.licence-nav-notice { min-height: 42px; padding: .55rem .7rem; font-size: .8rem; }

  .app-body .btn,
  .app-body .btn-sm { min-height: 44px; padding: .52rem .72rem; border-radius: 8px; font-size: .86rem; line-height: 1.2; }
  .app-body .btn-primary,.app-body .btn-success { font-weight: 750; }
  .app-body .form-control,
  .app-body .form-select,
  .app-body .entry-form .form-control,
  .app-body .entry-form .form-select { min-height: 44px; height: auto; padding: .55rem .65rem; font-size: 16px; }
  .app-body textarea.form-control,.app-body .entry-form textarea.form-control { min-height: 82px; }
  .app-body .form-label { margin-bottom: .28rem; font-size: .82rem; }
  .app-body .form-text,.app-body .text-muted { font-size: .76rem; line-height: 1.35; }
  .app-body .form-check-input { width: 1.25rem; height: 1.25rem; }
  .app-body .badge { padding: .38em .58em; font-size: .7rem; }
  .app-body .alert { font-size: .82rem; line-height: 1.4; }
  .app-body .app-main h1,.app-body .app-main .h3 { font-size: 1.3rem; line-height: 1.2; }
  .app-body .app-main h2,.app-body .app-main .h4 { font-size: 1.05rem; }
  .app-main > .d-flex.justify-content-between { width: 100%; }
  .app-main > .d-flex.justify-content-between > div:last-child { flex-wrap: wrap; }

  .table-responsive { position: relative; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; border-radius: 10px; scrollbar-width: auto; }
  .table-responsive::-webkit-scrollbar { height: 10px; }
  .table-responsive::-webkit-scrollbar-track { background: #edf2f7; }
  .table-responsive::-webkit-scrollbar-thumb { border: 2px solid #edf2f7; border-radius: 999px; background: #91a7bf; }
  .app-body .table:not(.invoice-lines-table) { min-width: 680px; font-size: .86rem; line-height: 1.35; }
  .app-body .table:not(.invoice-lines-table) > :not(caption) > * > * { padding: .62rem .68rem; }
  .app-body .table:not(.invoice-lines-table) thead th { padding-block: .58rem; font-size: .74rem; letter-spacing: .025em; }
  .app-body .table:not(.invoice-lines-table) td strong { font-size: .88rem; }
  .app-body .table:not(.invoice-lines-table) td small { font-size: .75rem; line-height: 1.3; }
  .app-body .table:not(.invoice-lines-table) td .btn-sm { min-height: 44px; padding: .48rem .62rem; font-size: .82rem; }
  .app-body .table:not(.invoice-lines-table) td:last-child { white-space: nowrap; }
  .app-body .table:has(tbody td:last-child .btn) thead th:last-child,
  .app-body .table:has(tbody td:last-child .btn) tbody td:last-child { position: sticky; right: 0; z-index: 2; border-left: 1px solid #e1e8f0; background: #fff; box-shadow: -7px 0 12px rgba(16,35,63,.05); }
  .app-body .table:has(tbody td:last-child .btn) thead th:last-child { z-index: 3; background: #f7f9fc; }
  .app-body .table-hover:has(tbody td:last-child .btn) tbody tr:hover td:last-child { background: #f8fbff; }
  .app-body .list-group-item { padding: .72rem .78rem; font-size: .84rem; line-height: 1.4; }
  .app-body .list-group-item small { font-size: .74rem; }
  .app-body .card-header { padding: .68rem .75rem; font-size: .84rem; }
  .app-body .card-body { padding: .78rem; font-size: .84rem; }

  .entry-page { margin-inline: 0; }
  .entry-hero { padding: 1rem; }
  .entry-form { padding: .75rem; }
  .entry-section { padding: .78rem; }
  .entry-section-heading h2 { font-size: 1.02rem; }
  .entry-section-heading p { font-size: .76rem; }
  .entry-actions { gap: .5rem; }
  .entry-actions .btn { min-height: 44px; }

  .invoice-toolbar { gap: .65rem; }
  .invoice-toolbar-actions { max-width: 62%; gap: .4rem; }
  .invoice-toolbar-actions .btn { min-height: 44px; }
  .invoice-editor fieldset { padding: .65rem .55rem 0; }
  .invoice-header-grid .form-label,
  .invoice-delivery-grid .form-label,
  .invoice-tax-panel .form-label { margin-bottom: .25rem; font-size: .78rem; }
  .invoice-header-grid .form-control,
  .invoice-header-grid .form-select,
  .invoice-delivery-grid .form-control,
  .invoice-tax-panel .form-control,
  .invoice-tax-panel .form-select,
  .search-select-input { min-height: 44px; height: auto; padding: .52rem 1.8rem .52rem .62rem; font-size: 16px; }
  .search-select-option { min-height: 42px; padding: .62rem .65rem; font-size: .84rem; }
  .search-select-menu { max-height: 45vh; }
  .invoice-delivery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .invoice-delivery-notes { grid-column: 1 / -1; }
  .invoice-tax-panel { grid-template-columns: 1fr; gap: .65rem; }
  .invoice-tax-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .invoice-tax-type { grid-column: 1 / -1; }
  .invoice-tax-summary { grid-template-columns: 1fr; width: 100%; justify-self: stretch; }
  .invoice-tax-panel .form-text { white-space: normal; }
  .invoice-lines-table tbody { gap: .7rem; }
  .invoice-lines-table tbody tr.invoice-line { position: relative; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; padding: .65rem; border-radius: 11px; box-shadow: 0 4px 13px rgba(16,35,63,.05); }
  .invoice-lines-table tbody td::before { margin-bottom: .2rem; font-size: .7rem; }
  .invoice-lines-table .line-product { grid-column: 1 / -1; }
  .invoice-lines-table .line-total { display: block; align-self: end; padding: .65rem .7rem; border-radius: 8px; background: #eef6ff; font-size: .92rem; font-weight: 750; }
  .invoice-lines-table .line-remove { grid-column: 2; justify-self: end; align-self: end; padding: 0; }
  .invoice-lines-table .form-control,
  .invoice-lines-table .form-select,
  .invoice-lines-table .search-select-input { min-height: 44px; height: auto; padding: .5rem 1.8rem .5rem .58rem; font-size: 16px; }
  .invoice-lines-table .remove { width: 44px; height: 44px; font-size: 1.1rem; }
  .invoice-lines-table tfoot .sum-total { font-size: 1rem; }
  .invoice-add-line { width: 100%; min-height: 44px !important; margin-top: .65rem; }
  .invoice-actions { gap: .5rem; padding: .7rem; }
  .invoice-actions .btn { min-height: 44px; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .app-body .app-page { padding-inline: .5rem; }
  .app-brand small { display: block; }
  .app-main > .d-flex.justify-content-between .btn { min-height: 44px; }
  .invoice-toolbar { flex-direction: column; }
  .invoice-toolbar-actions { width: 100%; max-width: none; justify-content: stretch; }
  .invoice-toolbar-actions .btn { flex: 1; }
  .invoice-delivery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .invoice-delivery-notes { grid-column: 1 / -1; }
  .invoice-tax-panel { grid-template-columns: 1fr; }
  .report-kpis { gap: .55rem; }
}

@media print {
  .app-header, .app-footer, .page-tools, .btn, form[method="get"] { display: none !important; }
  .app-body, .app-page, .card, .table-responsive { background: #fff !important; box-shadow: none !important; }
  .app-page { max-width: none; padding: 0 !important; }
  .table-responsive { overflow: visible !important; border-color: #bbb; }
  .entry-page { max-width: none; }
  .entry-hero { color: #111; background: #fff !important; box-shadow: none; border: 1px solid #bbb; }
  a { color: inherit; text-decoration: none; }
}

/* Shared list standard: compact desktop rows and true card records on phones. */
.app-list-table > tbody > tr { transition: background-color .15s ease,box-shadow .15s ease; }
.app-list-table > tbody > tr:hover { background:#f8fbff; }
.app-list-table .list-actions,.app-list-table .mobile-card-actions { white-space:nowrap; }
.app-list-table .dropdown-menu form { margin:0; }
.app-list-table .dropdown-menu form .dropdown-item { width:100%;text-align:left;border:0;background:transparent; }
.dropdown-menu.di-dropdown-portal{z-index:1090!important;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;box-shadow:0 12px 32px rgba(16,35,63,.22);}
.mobile-card-code { display:none; }
.list-filter-bar { align-items:end;gap:.55rem; }

@media(max-width:767.98px){
  .app-body .app-main,.app-body .card,.app-body .card-body,.entry-page,.entry-form,.entry-section,.permission-option,.permission-option span{min-width:0;}
  .app-body .row>*{min-width:0;}
  .app-body .form-control,.app-body .form-select,.app-body .input-group{min-width:0;max-width:100%;}
  .app-body .permission-option{width:100%;min-height:82px;overflow-wrap:anywhere;word-break:break-word;}
  .app-body .permission-option strong,.app-body .permission-option small{white-space:normal;overflow-wrap:anywhere;}
  .permission-guide ol{display:grid;gap:.25rem;}
  .permission-toolbar{grid-template-columns:1fr;}
  .permission-toolbar-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch;}
  .permission-toolbar-actions .permission-total{grid-column:1 / -1;text-align:center;}
  .permission-toolbar-actions .btn{min-height:42px;white-space:normal;}
  .permission-category-header{grid-template-columns:1fr;}
  .permission-category-toggle{align-items:flex-start;}
  .permission-category-toggle>span:first-child{max-width:calc(100% - 30px);}
  .permission-category-count{margin-left:auto;}
  .permission-category-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));justify-content:stretch;}
  .permission-category-actions .btn{min-height:42px;padding:.4rem;font-size:.74rem;white-space:normal;}
  .app-main>form.card{width:100%;max-width:100%!important;margin-inline:auto;}
  .app-main>form.card>.mt-3:last-child{display:flex;flex-wrap:wrap;gap:.5rem;}
  .app-main>form.card>.mt-3:last-child .btn{margin:0;min-height:44px;}
  .table-responsive:has(> .app-list-table){overflow:visible;border:0;background:transparent;}
  .app-body .app-list-table{display:block;min-width:0!important;background:transparent;border:0;font-size:.84rem;}
  .app-list-table thead{display:none;}
  .app-list-table tbody{display:grid;gap:.7rem;}
  .app-list-table tbody tr{position:relative;display:grid;grid-template-columns:minmax(0,1fr);gap:.28rem;padding:.8rem;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 4px 15px rgba(16,35,63,.055);min-width:0;}
  .app-list-table tbody tr:hover{background:#fff;}
  .app-body .app-list-table tbody td{position:static;display:grid;grid-template-columns:minmax(88px,34%) minmax(0,1fr);align-items:start;gap:.5rem;padding:.24rem 0!important;border:0!important;white-space:normal!important;background:transparent!important;box-shadow:none!important;min-width:0;overflow-wrap:anywhere;word-break:break-word;}
  .app-list-table tbody td>*{min-width:0;max-width:100%;}
  .app-list-table tbody td a,.app-list-table tbody td button{white-space:normal;overflow-wrap:anywhere;word-break:break-word;}
  .app-list-table tbody td::before{content:attr(data-label);color:var(--muted);font-size:.69rem;font-weight:750;letter-spacing:.025em;text-transform:uppercase;}
  .app-list-table tbody td.mobile-card-title{grid-column:1 / -1;display:block;padding-right:0!important;padding-bottom:.45rem!important;font-size:.94rem;line-height:1.35;}
  .app-list-table tbody tr:has(>td.mobile-card-status)>td.mobile-card-title{padding-right:6.25rem!important;}
  .app-list-table tbody td.mobile-card-title::before{display:none;}
  .mobile-card-code{display:block;}
  .app-body .app-list-table tbody td.company-code-column,
  .app-body .app-list-table tbody td.customer-code-column,
  .app-body .app-list-table tbody td.product-code-column,
  .app-body .app-list-table tbody td.profile-code-column{display:none;}
  .app-list-table tbody td .badge+.badge{margin-top:.25rem;}
  .app-list-table tbody td.mobile-card-status{position:absolute;top:.72rem;right:.72rem;display:block;width:auto;padding:0!important;}
  .app-list-table tbody td.mobile-card-status::before{display:none;}
  .app-list-table tbody td.mobile-card-actions{grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.35rem;padding-top:.55rem!important;border-top:1px solid var(--line)!important;}
  .app-list-table tbody td.mobile-card-actions::before{display:none;}
  .app-list-table tbody td.mobile-card-actions form{display:inline-flex;margin:0;}
  .app-list-table tbody td.mobile-card-actions .btn{min-height:42px;padding:.48rem .68rem;font-size:.8rem;}
  .app-list-table tbody tr:has(> td[colspan]){display:block;text-align:center;}
  .app-list-table tbody td[colspan]{display:block!important;}
  .app-list-table tbody td[colspan]::before{display:none;}
  .modal-dialog{margin:.5rem;}
  .modal-content{max-height:calc(100dvh - 1rem);}
  .modal-header,.modal-body,.modal-footer{padding:.8rem;}
  .modal-header>div{min-width:0;overflow-wrap:anywhere;}
  .modal-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.5rem;}
  .modal-footer>*{margin:0!important;min-height:42px;}
  .industry-column-table tbody tr{grid-template-columns:minmax(0,1fr) 82px;gap:.45rem .65rem;}
  .app-body .industry-column-table tbody td.industry-column-name{grid-column:1 / -1;display:block;padding:0 0 .3rem!important;}
  .industry-column-table tbody td.industry-column-name::before{display:none;}
  .app-body .industry-column-table tbody td.industry-column-show{grid-column:1 / -1;display:flex;align-items:center;justify-content:space-between;}
  .industry-column-table tbody td.industry-column-show::before{content:"Show";}
  .app-body .industry-column-table tbody td.industry-column-label{grid-column:1;display:block;}
  .industry-column-table tbody td.industry-column-label::before,.industry-column-table tbody td.industry-column-order::before{display:block;margin-bottom:.3rem;}
  .app-body .industry-column-table tbody td.industry-column-order{grid-column:2;display:block;}
  .industry-column-table .form-control{width:100%;min-height:42px;}
  .entry-actions{gap:.55rem;}
  .entry-actions .btn{min-height:44px;}
}
@media(max-width:575.98px){
  .app-main>.d-flex.justify-content-between>.d-flex{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;}
  .app-main>.d-flex.justify-content-between>.d-flex .btn{width:100%;white-space:normal;}
  .app-main>form.card>.mt-3:last-child .btn{flex:1 1 calc(50% - .25rem);}
  .entry-section-heading{gap:.6rem;}
  .entry-section-heading>span{width:28px;height:28px;flex-basis:28px;}
  .entry-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  .entry-actions .btn{width:100%;min-width:0;white-space:normal;}
  #voucher-lines{display:block;min-width:0!important;background:transparent;}
  #voucher-lines thead{display:none;}
  #voucher-lines tbody{display:grid;gap:.7rem;}
  #voucher-lines tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem;padding:.7rem;border:1px solid var(--line);border-radius:11px;background:#fff;box-shadow:0 4px 13px rgba(16,35,63,.05);}
  #voucher-lines tbody td{display:block!important;min-width:0!important;padding:0!important;border:0!important;}
  #voucher-lines tbody td:nth-child(1),#voucher-lines tbody td:nth-child(2),#voucher-lines tbody td:nth-child(n+5){grid-column:1 / -1;}
  #voucher-lines tbody td::before{display:block;margin-bottom:.25rem;color:var(--muted);font-size:.7rem;font-weight:750;text-transform:uppercase;}
  #voucher-lines tbody td:nth-child(1)::before{content:"Account";}
  #voucher-lines tbody td:nth-child(2)::before{content:"Party";}
  #voucher-lines tbody td:nth-child(3)::before{content:"Debit";}
  #voucher-lines tbody td:nth-child(4)::before{content:"Credit";}
  #voucher-lines tbody td:nth-child(5)::before{content:"Cost centre";}
  #voucher-lines tbody td:nth-child(6)::before{content:"Reference";}
  #voucher-lines tbody td:nth-child(7)::before{content:"Narration";}
  #voucher-lines tbody td:last-child{text-align:right;}
  #voucher-lines tbody td:last-child::before{display:none;}
  #voucher-lines .form-control,#voucher-lines .form-select{width:100%;min-height:44px;font-size:16px;}
}
.accounting-grid{min-width:1100px}
.accounting-grid th{font-size:.72rem;white-space:nowrap;text-transform:uppercase;letter-spacing:.035em}
.accounting-grid td{min-width:90px}
.accounting-grid td:first-child{min-width:230px}
.accounting-grid td:nth-child(2){min-width:200px}
.accounting-grid td:nth-child(3),.accounting-grid td:nth-child(4){min-width:105px}
.accounting-combo{position:relative}
.accounting-combo-list{position:absolute;top:100%;left:0;right:0;z-index:1050;max-height:240px;overflow:auto;background:#fff;border:1px solid #c8d6eb;border-radius:.5rem;box-shadow:0 10px 26px #122a4a2a}
.accounting-combo-option{display:block;width:100%;border:0;background:transparent;text-align:left;padding:.4rem .6rem;font-size:.84rem}
.accounting-combo-option:hover,.accounting-combo-option.active{background:#e9f2ff;color:#0d47a1}
@media(max-width:767px){.accounting-grid{min-width:950px}.accounting-grid td:first-child{min-width:190px}}

/* Progressive live list search. The regular submit control remains available
   for filtered forms and no-JS use; simple search-only forms no longer spend
   screen space on a button that is not required. */
.live-search-form [data-live-search-input="true"]{transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}
.live-search-form.live-search-pending [data-live-search-input="true"]{border-color:#7fb2f5;box-shadow:0 0 0 .16rem rgba(13,110,253,.12)}
.live-search-form.live-search-loading [data-live-search-input="true"]{background-color:#f3f7fc;cursor:progress}
.live-search-form.live-search-loading{cursor:progress}
.live-search-form.live-search-simple button:not([type]),.live-search-form.live-search-simple button[type="submit"]{display:none}
.live-search-form.live-search-simple.input-group>[data-live-search-input="true"]{border-radius:.5rem!important}
@media(max-width:767.98px){.live-search-form [data-live-search-input="true"]{min-height:44px;font-size:16px}}

/* Dense desktop document entry.
   Keep invoice, purchase/inventory and accounting grids spreadsheet-like on
   larger screens while the touch-friendly card layouts below 992px remain
   unchanged. */
@media(min-width:992px){
  .invoice-toolbar{gap:.55rem;margin-bottom:.2rem}
  .invoice-toolbar h1{margin:0;font-size:1.18rem;line-height:1.2}
  .invoice-toolbar-actions{gap:.3rem}
  .invoice-toolbar-actions .btn{min-height:30px;padding:.24rem .58rem;font-size:.72rem}
  .invoice-editor{margin-top:.35rem!important;border-radius:9px}
  .invoice-editor fieldset{padding:.42rem .5rem 0}
  .invoice-header-grid,.invoice-header-grid.no-scenario{gap:.3rem .42rem;padding-bottom:.38rem}
  .invoice-header-grid .form-label{margin-bottom:.06rem;font-size:.62rem;line-height:1.1}
  .invoice-header-grid .form-control,.invoice-header-grid .form-select,
  .invoice-header-grid .search-select-input{min-height:30px;height:30px;padding:.15rem .42rem;font-size:.71rem;border-radius:6px}
  .invoice-header-grid .form-text{display:none}
  .invoice-delivery-panel{margin:.18rem 0 .32rem;padding:.28rem .38rem .34rem;border-radius:7px}
  .invoice-delivery-title{gap:.32rem;margin-bottom:.16rem}
  .invoice-delivery-title>span{width:21px;height:21px;flex-basis:21px;border-radius:5px;font-size:.52rem}
  .invoice-delivery-title strong{font-size:.7rem}
  .invoice-delivery-title small{font-size:.57rem}
  .invoice-delivery-title b{font-size:.64rem}
  .invoice-delivery-grid{grid-template-columns:115px repeat(3,minmax(120px,1fr)) minmax(175px,1.35fr);gap:.28rem}
  .invoice-delivery-grid .form-label{margin-bottom:.05rem;font-size:.59rem;line-height:1.1}
  .invoice-delivery-grid .form-control{min-height:28px;height:28px;padding:.12rem .38rem;font-size:.68rem;border-radius:6px}
  .invoice-tax-panel{gap:.45rem;margin-bottom:.32rem;padding:.3rem .4rem;border-radius:7px}
  .invoice-tax-controls{grid-template-columns:minmax(240px,1fr) 115px 140px;gap:.32rem}
  .invoice-tax-summary{grid-template-columns:repeat(3,125px);gap:.32rem}
  .invoice-tax-panel .form-label{margin-bottom:.05rem;font-size:.6rem;line-height:1.1}
  .invoice-tax-panel .form-control,.invoice-tax-panel .form-select{min-height:29px;height:29px;padding:.13rem .4rem;font-size:.69rem;border-radius:6px}
  .invoice-tax-panel .form-text{margin-top:.08rem;font-size:.55rem}
  .invoice-lines-wrap{border-radius:7px}
  .invoice-lines-table{min-width:1250px;font-size:.68rem}
  .invoice-lines-table>:not(caption)>*>*{padding:.1rem .16rem}
  .invoice-lines-table tbody td{padding-block:.05rem;vertical-align:middle}
  .invoice-lines-table thead th{padding-block:.24rem;font-size:.57rem;line-height:1.05}
  .invoice-lines-table th[data-column="Product"]{width:300px}
  .invoice-lines-table th[data-column="Units"]{width:76px}
  .invoice-lines-table th[data-column="HSCode"],.invoice-lines-table th[data-column="Uom"]{width:82px}
  .invoice-lines-table th[data-column="LotNo"]{width:95px}
  .invoice-lines-table th[data-column="Bales"]{width:66px}
  .invoice-lines-table th[data-column="Quantity"],.invoice-lines-table th[data-column="WeightKg"],.invoice-lines-table th[data-column="QtyKg"]{width:84px}
  .invoice-lines-table th[data-column="Maunds"]{width:76px}
  .invoice-lines-table th[data-column="Rate"]{width:90px}
  .invoice-lines-table th[data-column="Amount"],.invoice-lines-table th[data-column="TaxAmount"],.invoice-lines-table th[data-column="AdvanceTaxAmount"]{width:98px}
  .invoice-lines-table th[data-column="Discount"],.invoice-lines-table th[data-column="FurtherTax"]{width:78px}
  .invoice-lines-table th[data-column="NetAmount"]{width:105px}
  .invoice-lines-table th[data-column="TaxRate"]{width:54px}
  .invoice-lines-table th[data-column="FurtherTaxRate"],.invoice-lines-table th[data-column="AdvanceTaxRate"]{width:66px}
  .invoice-lines-table th:last-child{width:31px}
  .invoice-lines-table .form-control,.invoice-lines-table .form-select,
  .invoice-lines-table .search-select-input{min-height:25px;height:25px;padding:.04rem .25rem;font-size:.66rem;border-radius:4px}
  .invoice-lines-table .search-select-input{padding-right:1.35rem!important;background-position:calc(100% - 10px) 50%,calc(100% - 6px) 50%}
  .invoice-lines-table .remove{width:23px;height:23px;padding:0;border-radius:5px;font-size:.7rem}
  .invoice-lines-table tfoot th{padding-block:.23rem}
  .invoice-add-line{margin-top:.28rem;padding:.18rem .5rem;font-size:.68rem}
  .invoice-actions{padding:.34rem .5rem}
  .invoice-actions .btn{min-height:30px;padding:.25rem .65rem;font-size:.72rem}

  .purchase-editor{padding:.6rem!important;border-radius:9px}
  .purchase-header-grid{gap:.3rem .45rem}
  .purchase-header-grid .form-label{margin-bottom:.06rem;font-size:.64rem;line-height:1.1}
  .purchase-editor .form-control-sm,.purchase-editor .form-select-sm,
  .purchase-editor .search-select-input{min-height:29px;height:29px;padding:.13rem .38rem;font-size:.7rem;border-radius:5px}
  .purchase-editor .table-responsive{margin-top:.45rem!important;border-radius:7px}
  .purchase-grid{margin-bottom:.2rem;font-size:.69rem}
  .purchase-grid>:not(caption)>*>*{padding:.18rem .22rem}
  .purchase-grid th{padding-block:.27rem;font-size:.58rem;line-height:1.05}
  .purchase-product-cell{min-width:220px}
  .purchase-line-details summary{margin-top:.12rem;font-size:.6rem}
  .purchase-actions{padding:.32rem 0 .08rem}
  .purchase-actions .btn{min-height:29px;padding:.22rem .58rem;font-size:.7rem}

  .accounting-grid{min-width:960px;font-size:.7rem}
  .accounting-grid>:not(caption)>*>*{padding:.18rem .22rem}
  .accounting-grid th{padding-block:.27rem;font-size:.59rem;line-height:1.05}
  .accounting-grid td{min-width:78px}
  .accounting-grid td:first-child{min-width:205px}
  .accounting-grid td:nth-child(2){min-width:175px}
  .accounting-grid td:nth-child(3),.accounting-grid td:nth-child(4){min-width:88px}
  .accounting-grid .form-control,.accounting-grid .form-select,
  .accounting-grid .search-select-input{min-height:29px;height:29px;padding:.13rem .35rem;font-size:.69rem;border-radius:5px}
  .accounting-grid .btn{min-height:27px;padding:.12rem .38rem;font-size:.68rem}
}
