:root {
    --ink: #12304f;
    --muted: #668097;
    --line: #d8e6ee;
    --paper: #ffffff;
    --canvas: #f4f9fc;
    --nav: #043c91;
    --nav-soft: #154d9a;
    --primary: #154d9a;
    --primary-soft: #e8f4fb;
    --accent: #0ea5c7;
    --danger: #b42318;
    --danger-soft: #fee9e7;
    --success: #087a55;
    --success-soft: #e2f7ef;
    --shadow: 0 10px 28px rgba(4, 60, 145, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea { width: 100%; border: 1px solid #c9dbe6; border-radius: 8px; background: #fff; color: var(--ink); padding: 10px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,199,.12); }
input:not([type="email"]):not([type="password"]):not([type="file"]):not([type="date"]):not([type="number"]):not([data-preserve-case]), textarea:not([data-preserve-case]) { text-transform: uppercase; }
input[type="email"] { text-transform: lowercase; }
input[data-preserve-case] { text-transform: none; }
textarea { min-height: 80px; resize: vertical; }
label { display: grid; gap: 6px; color: #38475a; font-weight: 650; }
label small { color: var(--muted); font-weight: 450; line-height: 1.35; }
label small a { color: var(--primary); font-weight: 700; }
.check-label { display: flex; align-items: center; align-self: end; gap: 9px; min-height: 40px; }
.check-label input { width: 17px; height: 17px; margin: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; letter-spacing: -.02em; }
h2 { font-size: 18px; margin-bottom: 5px; }
h3 { font-size: 15px; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border: 0; border-radius: 8px; padding: 0 17px; cursor: pointer; font-weight: 750; }
.button.primary { background: linear-gradient(110deg, #154d9a, #0ea5c7); color: #fff; box-shadow: 0 7px 16px rgba(21,77,154,.16); }
.button.primary:hover { background: linear-gradient(110deg, #043c91, #078eae); }
.button.secondary { border: 1px solid #cfe0ea; background: #eef6fa; color: #154d9a; }
.button.danger { background: var(--danger); color: #fff; }
.button.small { min-height: 32px; padding: 0 12px; font-size: 12px; }
.inline-delete-form { display: inline; margin: 0; }
.inline-delete-form button { border: 0; background: transparent; padding: 0; color: var(--danger); font: inherit; font-weight: 750; cursor: pointer; }
.inline-delete-form button:hover { text-decoration: underline; }
.alert { margin-bottom: 16px; border: 1px solid; border-radius: 9px; padding: 12px 14px; }
.alert.error { color: var(--danger); background: var(--danger-soft); border-color: #fac7c2; }
.alert.success { color: var(--success); background: var(--success-soft); border-color: #b6ead7; }
.alert.info { color: #18528b; background: #e9f3fd; border-color: #bfdcf5; }
.alert ul { margin-bottom: 0; }

/* Setup and login */
.setup-body, .login-body { min-height: 100vh; background: radial-gradient(circle at 10% 0%, #d9f3f9 0, transparent 36%), var(--canvas); }
.setup-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 70px; }
.setup-brand { display: flex; align-items: center; gap: 17px; margin-bottom: 26px; }
.setup-brand p:last-child { color: var(--muted); margin: 5px 0 0; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg,#154d9a,#0ea5c7); color: #fff; font-size: 27px; font-weight: 850; box-shadow: 0 9px 22px rgba(21,77,154,.2); }
.brand-mark.small { width: 37px; height: 37px; border-radius: 9px; font-size: 19px; }
.setup-logo { width: min(330px, 45vw); height: auto; border-radius: 8px; }
.setup-form { padding: 28px; }
.section-heading { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 13px; margin: 5px 0 18px; }
.section-heading:not(:first-of-type) { margin-top: 31px; }
.section-heading > span { width: 31px; height: 31px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: linear-gradient(145deg,#154d9a,#0ea5c7); font-weight: 800; }
.section-heading p { color: var(--muted); margin-bottom: 0; }
.form-grid { display: grid; gap: 16px; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-full { grid-column: 1 / -1; }
.setup-actions { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; }
.setup-actions p { margin: 0; color: var(--muted); }
.setup-card { text-align: center; padding: 50px 25px; }
.setup-card p { color: var(--muted); }
.success-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; margin: 0 auto 18px; background: var(--success-soft); color: var(--success); font-size: 29px; font-weight: 800; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-story { padding: 60px 7vw; color: #fff; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, #043c91 0%, #154d9a 56%, #0ea5c7 120%); }
.login-logo-wrap { display: inline-flex; border-radius: 12px; background: #f8fbfb; padding: 10px 15px; box-shadow: 0 12px 35px rgba(0,0,0,.16); }
.login-logo { display: block; width: min(330px, 31vw); height: auto; }
.login-card-logo { display: none; width: min(290px, 100%); margin: 0 auto 24px; }
.login-story h1 { font-size: clamp(34px, 4.3vw, 62px); line-height: 1.04; max-width: 720px; margin: 30px 0 20px; }
.login-story > div > p { color: #d8f2f7; font-size: 16px; max-width: 640px; line-height: 1.65; }
.login-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.login-features div { border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 14px; background: rgba(255,255,255,.06); }
.login-features strong, .login-features small { display: block; }
.login-features small { margin-top: 5px; color: #d1e9f5; }
.login-panel { display: grid; place-items: center; padding: 35px; }
.login-card { width: min(430px, 100%); padding: 35px; }
.login-card > p { color: var(--muted); margin-bottom: 25px; }
.login-card form { display: grid; gap: 16px; }
.login-card .button { margin-top: 7px; }
.login-note { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.company-brand-preview { display: flex; align-items: center; gap: 17px; border: 1px solid #cfe5ef; border-radius: 10px; background: linear-gradient(110deg,#f8fbfb,#edf9fc); margin-bottom: 19px; padding: 11px 15px; }
.company-brand-preview img { display: block; width: min(310px, 45%); height: auto; }
.company-brand-preview p { margin: 7px 0 0; color: var(--muted); }

/* App shell and grouped top navigation */
.app-shell { min-height: 100vh; display: block; }
.sidebar { position: sticky; z-index: 40; top: 0; min-height: 70px; display: flex; align-items: center; gap: 14px; background: linear-gradient(100deg, #043c91 0%, #154d9a 62%, #092f66 100%); color: #d6e8f4; padding: 8px 18px; overflow: visible; box-shadow: 0 5px 18px rgba(4,60,145,.16); }
.sidebar-brand { display: flex; width: 178px; height: 54px; min-width: 178px; align-items: center; justify-content: center; overflow: hidden; border-radius: 8px; background: #f8fbfb; padding: 5px 8px; box-shadow: 0 7px 16px rgba(0,0,0,.15); }
.sidebar-logo { display: block !important; width: 100% !important; max-width: 100% !important; height: 44px !important; max-height: 44px !important; object-fit: contain !important; object-position: center !important; }
.nav-list { min-width: 0; display: flex; align-items: center; gap: 3px; margin: 0; }
.nav-home, .nav-group > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(159,220,235,.24); border-radius: 8px; background: rgba(255,255,255,.06); padding: 0 14px; color: #edf9fc; font-size: 14px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.nav-home span, .nav-group > summary span { width: 17px; color: #8ce5f2; text-align: center; font-size: 15px; }
.nav-home:hover, .nav-group:hover > summary { border-color: rgba(151,235,247,.58); background: rgba(14,165,199,.26); box-shadow: 0 6px 14px rgba(0,0,0,.12); transform: translateY(-1px); color: #fff; }
.nav-home.active, .nav-group.active > summary, .nav-group[open] > summary { border-color: #79e2f1; background: linear-gradient(120deg,#0ea5c7,#087bb3); box-shadow: 0 7px 17px rgba(0,24,73,.26), inset 0 1px 0 rgba(255,255,255,.22); color: #fff; }
.nav-home:focus-visible, .nav-group > summary:focus-visible { outline: 3px solid rgba(121,226,241,.45); outline-offset: 2px; }
.nav-group { position: relative; }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: "▾"; margin-left: 2px; color: #8fd9e9; font-size: 9px; }
.nav-group[open] > summary::after { transform: rotate(180deg); }
.nav-dropdown { position: absolute; z-index: 50; top: calc(100% + 11px); left: 0; min-width: 235px; max-height: min(650px, calc(100vh - 90px)); overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); padding: 7px; box-shadow: 0 18px 42px rgba(4,60,145,.2); }
.nav-dropdown::before { content: ""; position: absolute; top: -6px; left: 22px; width: 10px; height: 10px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: #fff; transform: rotate(45deg); }
.nav-dropdown a { position: relative; z-index: 1; display: flex; align-items: center; min-height: 36px; border-radius: 7px; padding: 7px 10px; color: #27445f; font-size: 12px; font-weight: 650; }
.nav-dropdown a:hover, .nav-dropdown a.active { background: var(--primary-soft); color: var(--primary); }
.nav-dropdown-end { right: 0; left: auto; }
.nav-dropdown-end::before { right: 22px; left: auto; }
.nav-dropdown-wide { width: 480px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.nav-dropdown-mega { left: -115px; width: min(900px, calc(100vw - 260px)); display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.nav-dropdown-mega::before { left: 137px; }
.nav-dropdown-section { min-width: 0; }
.nav-dropdown-section > strong { display: block; margin: 2px 7px 5px; border-bottom: 1px solid var(--line); padding: 6px 3px 8px; color: var(--primary); font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.nav-count { min-width: 21px; height: 20px; display: inline-grid; place-items: center; border-radius: 99px; color: #fff; background: #e34c5b; font-size: 9px; font-style: normal; font-weight: 850; }
.sidebar-status { margin-left: auto; display: flex; align-items: center; gap: 6px; color: #a9d9e8; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.sidebar-status > span { width: 8px; height: 8px; border-radius: 50%; background: #4ce2b5; box-shadow: 0 0 0 4px rgba(76,226,181,.14); }
.sidebar-status small { color: #a9d9e8; }
.main-column { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { min-height: 76px; display: flex; align-items: center; gap: 14px; background: #fff; border-top: 3px solid #0ea5c7; border-bottom: 1px solid var(--line); padding: 8px 26px 11px; }
.menu-button { display: none; border: 0; background: transparent; font-size: 24px; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.user-menu strong, .user-menu small { display: block; }
.user-menu small { color: var(--muted); margin-top: 2px; }
.user-menu > a { margin-left: 10px; color: var(--primary); font-weight: 750; }
.avatar { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#154d9a,#0ea5c7); font-weight: 850; }
.topbar-tools { display: flex; align-items: center; gap: 7px; margin-right: 8px; }
.topbar-tools > a { position: relative; min-width: 62px; height: 42px; display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 4px; border: 1px solid #cfe2eb; border-radius: 9px; background: #f1f8fb; padding: 0 8px; color: var(--primary); }
.topbar-tools > a:hover { border-color: var(--accent); background: #e5f6fa; }
.topbar-tools span { color: var(--accent); font-weight: 900; text-align: center; }
.topbar-tools small { font-size: 10px; font-weight: 800; }
.topbar-tools em { position: absolute; top: -7px; right: -6px; min-width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 99px; background: #e34c5b; color: #fff; font-size: 9px; font-style: normal; font-weight: 900; }
.content { flex: 1; padding: 24px 26px 38px; }
.app-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); background: #fff; padding: 13px 26px; font-size: 11px; }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.page-actions p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric { position: relative; overflow: hidden; padding: 18px; }
.metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(#154d9a,#0ea5c7); }
.metric-top { display: flex; justify-content: space-between; color: var(--muted); font-weight: 650; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(145deg,#154d9a,#0ea5c7); box-shadow: 0 6px 13px rgba(21,77,154,.15); }
.metric strong { display: block; margin-top: 14px; font-size: 27px; }
.metric small { display: block; color: var(--muted); margin-top: 4px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: 18px; }
.panel { padding: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 13px; margin-bottom: 15px; }
.panel-header p { margin-bottom: 0; color: var(--muted); }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.module-tile { display: block; border: 1px solid var(--line); border-radius: 9px; padding: 14px; transition: .15s ease; }
.module-tile:hover { border-color: var(--accent); box-shadow: 0 8px 18px rgba(14,165,199,.09); transform: translateY(-1px); }
.module-tile strong, .module-tile small { display: block; }
.module-tile small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.status-list { display: grid; gap: 11px; }
.status-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf0f4; padding-bottom: 10px; }
.status-row:last-child { border-bottom: 0; }
.status-row span { color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 800; }
.badge.gray { background: #edf1f5; color: #4e5f73; }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.data-layout { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr); gap: 18px; align-items: start; }
.form-card, .table-card { padding: 20px; }
.form-card form { display: grid; gap: 14px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
th { color: var(--muted); background: #f8fafc; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
td { font-size: 13px; }
.table-empty { padding: 35px 15px; text-align: center; color: var(--muted); }
.search-bar { display: flex; gap: 9px; margin-bottom: 14px; }
.search-bar input { max-width: 330px; }
.placeholder-page { max-width: 780px; margin: 40px auto; padding: 35px; text-align: center; }
.placeholder-page .metric-icon { margin: 0 auto 15px; width: 52px; height: 52px; font-size: 22px; }
.placeholder-page p { color: var(--muted); line-height: 1.6; }
.purchase-metrics .metric strong { font-size: 23px; }
.master-metrics .metric strong { font-size: 24px; }
.filter-grid { display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(150px, .8fr) 145px 145px auto auto; gap: 10px; align-items: end; margin-bottom: 18px; }
.party-filters { grid-template-columns: minmax(230px, 1.5fr) 170px 150px auto auto; }
.item-filters { grid-template-columns: minmax(220px, 1.4fr) 145px 155px 165px 130px auto auto; }
.status-badge { display: inline-flex; align-items: center; min-height: 25px; border-radius: 99px; padding: 0 9px; color: #1b5a83; background: #e5f3fc; font-size: 10px; font-weight: 850; white-space: nowrap; }
.status-draft { color: #5e6874; background: #edf0f3; }
.status-new { color: #2456a6; background: #e7effd; }
.status-follow-up, .status-sent { color: #925b06; background: #fff0d2; }
.status-quoted { color: #18528b; background: #e9f3fd; }
.status-won, .status-accepted, .status-dispatched { color: var(--success); background: var(--success-soft); }
.status-lost, .status-rejected, .status-expired { color: var(--danger); background: var(--danger-soft); }
.status-open, .status-approved { color: #087a55; background: #e2f7ef; }
.status-part-received { color: #925b06; background: #fff0d2; }
.status-received, .status-closed { color: #2456a6; background: #e7effd; }
.status-cancelled { color: var(--danger); background: var(--danger-soft); }
.status-unpaid { color: var(--danger); background: var(--danger-soft); }
.status-partial { color: #925b06; background: #fff0d2; }
.status-paid, .status-posted { color: var(--success); background: var(--success-soft); }
.status-submitted { color: #925b06; background: #fff0d2; }
.status-assigned, .status-in-progress { color: #2456a6; background: #e7effd; }
.status-blocked { color: #8d4d00; background: #fff0d2; }
.status-resolved, .status-completed { color: var(--success); background: var(--success-soft); }
.status-in-stock { color: var(--success); background: var(--success-soft); }
.status-in-production, .status-dispatched { color: #2456a6; background: #e7effd; }
.status-issued { color: #875400; background: #fff0d2; }
.status-consumed { color: #5c3b9e; background: #eee8ff; }
.status-approved { color: var(--success); background: var(--success-soft); }
.status-available { color: var(--success); background: var(--success-soft); }
.status-low { color: #925b06; background: #fff0d2; }
.status-out, .status-negative { color: var(--danger); background: var(--danger-soft); }
.table-actions { display: flex; align-items: center; gap: 10px; }
.table-actions a, .back-link { color: var(--primary); font-weight: 750; }
.document-form-card { padding: 21px; margin-bottom: 18px; }
.document-form-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 19px; padding-bottom: 14px; }
.po-lines-wrap { width: 100%; overflow-x: auto; }
.po-lines { min-width: 1060px; }
.po-lines th:first-child, .po-lines td:first-child { width: 38px; text-align: center; }
.po-lines th:nth-child(2) { width: 260px; }
.po-lines th:nth-child(3) { width: 185px; }
.po-lines th:nth-child(4), .po-lines th:nth-child(5), .po-lines th:nth-child(6) { width: 105px; }
.po-lines th:nth-child(7), .po-lines th:nth-child(8) { width: 125px; }
.po-lines td { padding: 7px 5px; }
.po-lines input, .po-lines select { min-width: 90px; padding: 8px; }
.taxable-cell, .total-cell { text-align: right; font-weight: 750; white-space: nowrap; }
.remove-line { width: 29px; height: 29px; border: 0; border-radius: 6px; color: var(--danger); background: var(--danger-soft); cursor: pointer; font-size: 18px; }
.po-total-box { width: min(390px, 100%); margin: 18px 0 0 auto; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.po-total-box > div { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 10px 13px; }
.po-total-box > div:last-child { border-bottom: 0; }
.po-total-box span { color: var(--muted); }
.po-total-box .grand { color: #fff; background: linear-gradient(110deg,#154d9a,#0ea5c7); font-size: 16px; }
.po-total-box .grand span { color: #d8f1ee; }
.document-form-actions, .action-row { display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.task-filter-grid { grid-template-columns: minmax(230px,1.5fr) 155px 145px 185px auto auto; }
.task-progress-block { padding: 17px 12px; border-bottom: 1px solid var(--line); }
.task-progress-block > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; }
.task-progress { height: 10px; overflow: hidden; border-radius: 99px; background: #e8edf3; }
.task-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#154d9a,#0ea5c7); }
.task-progress.compact { width: 125px; height: 7px; margin-bottom: 4px; }
.task-update-card { padding: 20px; margin-top: 18px; }
.task-update-card form { display: grid; gap: 14px; }
.workload-meter { width: 125px; height: 8px; overflow: hidden; border-radius: 99px; background: #e8edf3; }
.workload-meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#22a77b,#f0ad32,#e34c5b); }
.priority-low { color: #4e5f73; background: #edf1f5; }
.priority-normal { color: #2456a6; background: #e7effd; }
.priority-high { color: #925b06; background: #fff0d2; }
.priority-critical { color: var(--danger); background: var(--danger-soft); }
.overdue-row { box-shadow: inset 4px 0 0 #e34c5b; background: #fffafb; }
.text-danger { color: var(--danger) !important; }
.wrap-cell { min-width: 280px; white-space: normal; line-height: 1.5; }
.po-view-card { padding: 23px; }
.po-view-heading { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.document-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.document-info-grid > div { padding: 15px 12px; border-right: 1px solid var(--line); }
.document-info-grid > div:last-child { border-right: 0; }
.document-info-grid span, .address-grid span, .view-bottom-grid > div > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.address-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.address-grid > div { min-height: 125px; padding: 17px 12px; border-right: 1px solid var(--line); }
.address-grid > div:last-child { border-right: 0; }
.address-grid h3 { margin-bottom: 6px; }
.address-grid p { margin: 0; color: #526175; line-height: 1.55; }
.document-table { margin-top: 18px; }
.view-bottom-grid { display: grid; grid-template-columns: 1fr minmax(300px, .55fr); gap: 18px; margin-top: 18px; }
.view-bottom-grid p { color: #526175; line-height: 1.55; }
.terms-text { white-space: normal; }
.view-totals { width: 100%; margin-top: 0; align-self: start; }
.tracking-card { display: flex; align-items: center; gap: 1px; margin-top: 17px; padding: 16px; }
.tracking-card > div { min-width: 150px; border-right: 1px solid var(--line); padding: 3px 18px; }
.tracking-card > div:first-child { padding-left: 5px; }
.tracking-card span, .tracking-card strong { display: block; }
.tracking-card span { color: var(--muted); font-size: 11px; }
.tracking-card strong { margin-top: 4px; font-size: 18px; }
.tracking-card form { margin-left: auto; }
.quick-create-card { margin-bottom: 18px; padding: 15px 18px; }
.quick-create-form { display: grid; grid-template-columns: minmax(260px,1fr) auto; gap: 12px; align-items: end; }
.register-filters { grid-template-columns: minmax(230px,1fr) 160px 160px auto auto; }
.register-main-filters { grid-template-columns: 150px 150px minmax(230px,1fr) 160px auto; }
.stock-filters { grid-template-columns: minmax(210px,1.3fr) 180px 180px 150px auto auto; }
.ledger-filters { grid-template-columns: minmax(240px,1.3fr) 170px 170px 145px 145px auto; }

@media print {
    @page { size: A4 landscape; margin: 8mm; }
    .sidebar, .topbar, .app-footer, .page-actions, .no-print { display: none !important; }
    .app-shell, .main-column { display: block; min-height: 0; }
    .content { padding: 0; }
    .report-sheet { border: 0; box-shadow: none; padding: 0; }
    .report-sheet .table-wrap { overflow: visible; }
    .report-sheet table { font-size: 9px; }
    .report-sheet th, .report-sheet td { padding: 5px 4px; white-space: normal; }
    .metric-grid { break-inside: avoid; }
}
.issue-filters { grid-template-columns: minmax(280px,1fr) 170px auto auto; }
.compact-filters { grid-template-columns: 210px auto auto; justify-content: start; }
.register-summary { margin-top: 18px; }
.register-summary .metric { box-shadow: none; }
.purchase-detail-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(310px,.6fr); gap: 18px; margin-top: 18px; align-items: start; }
.invoice-lines input,.grn-lines input { min-width: 95px; }
.register-card tfoot th { color: var(--ink); background: #eaf4fa; font-size: 11px; }
.positive-text { color: var(--success); font-weight: 800; }
.negative-text { color: var(--danger); font-weight: 800; }
.crm-filters { grid-template-columns: minmax(280px,1fr) 180px auto auto; justify-content: start; }
.followup-list { display: grid; gap: 11px; }
.followup-list article { border: 1px solid var(--line); border-radius: 9px; padding: 13px; }
.followup-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.followup-list article p { margin: 10px 0; color: #526175; line-height: 1.5; }
.followup-list article small, .approval-note { color: var(--muted); }
.approval-note { margin: 12px 2px 0; text-align: right; font-size: 12px; }
.production-filters { grid-template-columns: minmax(280px,1fr) 180px auto auto; justify-content: start; }
.compact-selector { max-width: 560px; margin-bottom: 18px; padding: 16px 18px; }
.compact-selector label { display: grid; grid-template-columns: 150px minmax(220px,1fr); align-items: center; gap: 12px; }
.gate-reference-selector { width: 100%; margin-bottom: 18px; padding: 18px 20px; }
.gate-reference-grid { display: grid; grid-template-columns: minmax(240px,.8fr) minmax(380px,1.6fr) auto; align-items: end; gap: 16px; }
.gate-reference-grid label { display: grid; grid-template-columns: 1fr; align-items: initial; gap: 7px; margin: 0; }
.gate-reference-grid .button { min-width: 190px; white-space: nowrap; }
.production-history-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-top: 18px; }
.procurement-card { margin-bottom: 18px; }
.procurement-card .panel-header { align-items: flex-start; }
.production-history-grid .card { padding: 18px; }
.history-list { display: grid; gap: 9px; }
.history-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
.history-list strong,.history-list small { display: block; }
.history-list small { margin-top: 3px; color: var(--muted); }
.history-list a { color: var(--primary); font-weight: 750; }
.status-shortage,.status-partial-shortage { color: var(--danger); background: var(--danger-soft); }
.status-available,.status-partial-available,.status-issued { color: var(--success); background: var(--success-soft); }
.status-in-progress,.status-partial { color: #8a5800; background: #fff2cc; }

@media print {
    .sidebar,.topbar,.app-footer,.page-actions,.register-main-filters { display: none !important; }
    .app-shell { display: block; }
    .content { padding: 0; }
    .card { border: 0; box-shadow: none; }
    .register-summary { grid-template-columns: repeat(4,1fr); }
}
.party-parent-card { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 19px 22px; }
.party-parent-card p { margin-bottom: 0; color: var(--muted); }
.location-count { min-width: 92px; border-left: 1px solid var(--line); text-align: center; }
.location-count strong, .location-count span { display: block; }
.location-count strong { font-size: 25px; }
.location-count span { color: var(--muted); font-size: 11px; }
.check-stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0 14px; padding: 11px 0; }
.location-list { display: grid; gap: 11px; }
.location-card { border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.location-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.location-card-head h3 { margin: 8px 0 0; }
.location-card-head > a { color: var(--primary); font-weight: 750; }
.location-card > p { color: #526175; line-height: 1.5; }
.location-card dl { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; margin: 0; }
.location-card dt { color: var(--muted); }
.location-card dd { margin: 0; font-weight: 650; }
.location-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.location-tags span { border-radius: 99px; padding: 4px 8px; color: #285378; background: #e8f2fa; font-size: 10px; font-weight: 800; }
.location-tags span.active { color: var(--success); background: var(--success-soft); }
.location-tags span.inactive { color: var(--danger); background: var(--danger-soft); }
.import-layout { display: grid; grid-template-columns: minmax(300px, .65fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }
.import-result { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 17px; overflow: hidden; }
.import-result > div { border-right: 1px solid var(--line); padding: 15px 18px; }
.import-result > div:last-child { border-right: 0; }
.import-result span, .import-result strong { display: block; }
.import-result span { color: var(--muted); font-size: 11px; }
.import-result strong { margin-top: 5px; font-size: 21px; }
.template-list { display: grid; gap: 9px; }
.template-list article { display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; }
.template-list strong, .template-list small { display: block; }
.template-list small { color: var(--muted); margin-top: 4px; line-height: 1.45; }
.import-help { margin: 15px 0 0; line-height: 1.6; }

/* Authorization, approvals and notifications */
.permission-user-selector { margin-bottom: 18px; padding: 16px 18px; }
.permission-selector-form { display: grid; grid-template-columns: minmax(320px,1fr) minmax(240px,.45fr); align-items: end; gap: 18px; }
.permission-selector-form > div { border-left: 3px solid var(--accent); padding: 5px 13px; }
.permission-selector-form span,.permission-selector-form strong,.permission-selector-form small { display: block; }
.permission-selector-form span,.permission-selector-form small { color: var(--muted); }
.permission-selector-form strong { margin: 3px 0; font-size: 17px; }
.permission-matrix-card { margin-bottom: 18px; }
.permission-matrix { min-width: 1050px; }
.permission-matrix th:not(:first-child),.permission-matrix td:not(:first-child) { text-align: center; }
.permission-matrix td:first-child { min-width: 175px; }
.permission-matrix td:first-child small { display: block; margin-top: 3px; color: var(--muted); }
.document-permission-matrix{min-width:1450px}.document-permission-matrix select{min-width:118px;padding:7px 8px;font-size:11px;font-weight:750}.permission-module-row td{padding:9px 12px!important;background:linear-gradient(90deg,#154d9a,#087b9b)!important;color:#fff!important;font-size:11px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.permission-check { display: inline-grid; place-items: center; gap: 3px; color: var(--muted); font-size: 9px; cursor: pointer; }
.permission-check input { width: 19px; height: 19px; margin: 0; accent-color: var(--primary); }
.permission-check span { display: none; }
.notification-preference-card { margin-bottom: 18px; }
.notification-preference-card .check-stack { grid-template-columns: repeat(4,minmax(0,1fr)); }
.approval-pending-row { background: #fffaf0; }
.approval-history-card { margin-top: 18px; padding: 20px; }
.approval-timeline { display: grid; gap: 0; }
.approval-timeline article { position: relative; display: grid; grid-template-columns: 115px 1fr; gap: 16px; border-left: 2px solid #cfe2eb; margin-left: 10px; padding: 0 0 22px 22px; }
.approval-timeline article::before { content:""; position:absolute; top:3px; left:-7px; width:12px; height:12px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px #e5f6fa; }
.approval-timeline p { margin: 5px 0; color: var(--muted); }
.approval-timeline small { color: var(--muted); }
.notification-list-card { padding: 20px; }
.notification-list { display: grid; gap: 8px; }
.notification-item { display: grid; grid-template-columns: 38px 1fr 20px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; transition: .15s ease; }
.notification-item:hover { border-color: var(--accent); box-shadow: 0 7px 18px rgba(14,165,199,.1); transform: translateY(-1px); }
.notification-item.unread { border-left: 4px solid var(--accent); background: #f1fbfd; }
.notification-item.read { opacity: .76; }
.notification-item p { margin: 4px 0; color: var(--muted); }
.notification-item small { color: var(--muted); }
.notification-type { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg,#154d9a,#0ea5c7); color: #fff; font-weight: 900; }

/* Phase 29 · company themes, modern navigation and universal search */
.login-story,.sidebar { background: linear-gradient(135deg,var(--nav) 0%,var(--primary) 64%,var(--accent) 125%); }
.button.primary,.avatar,.metric-icon,.notification-type,.section-heading > span,.brand-mark,.attachment-file-icon,.topbar-context-links a { background: linear-gradient(120deg,var(--primary),var(--accent)); }
.button.primary:hover { background: linear-gradient(120deg,var(--nav),var(--primary)); }
.button.secondary,.nav-dropdown a:hover,.nav-dropdown a.active { color: var(--primary); }
.nav-home.active,.nav-group.active > summary,.nav-group[open] > summary { border-color: color-mix(in srgb,var(--accent) 72%,white); background: linear-gradient(120deg,var(--accent),var(--primary)); }
.topbar { position: sticky; z-index: 30; top: 70px; min-height: 72px; border-top-color: var(--accent); box-shadow: 0 5px 18px rgba(25,44,70,.05); }
.metric::before,.task-progress > span,.po-total-box .grand { background:linear-gradient(120deg,var(--primary),var(--accent)); }
.permission-module-row td { background:linear-gradient(90deg,var(--nav),var(--primary))!important; }
.module-tabs a.active { border-color:var(--primary); background:linear-gradient(120deg,var(--primary),var(--accent)); }
.report-selector-grid a.active { border-color:var(--accent); box-shadow:inset 3px 0 var(--accent); }
.summary-grid strong,.quick-entry-menu > summary,.quick-entry-menu a:hover,.module-tabs a:hover,label small a { color:var(--primary); }
.topbar-title { min-width: 190px; }
.topbar-global-search { width: min(610px,42vw); height: 42px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 2px; margin-left: clamp(4px,2vw,28px); border: 1px solid #cadbe5; border-radius: 9px; background: #f8fbfd; padding-left: 8px; transition: .16s ease; }
.topbar-global-search:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent); }
.topbar-global-search > span { color: var(--accent); font-size: 20px; text-align: center; }
.topbar-global-search input { min-width: 0; border: 0; background: transparent; box-shadow: none; padding: 8px 5px; text-transform: none; }
.topbar-global-search button { align-self: stretch; border: 0; border-radius: 0 8px 8px 0; background: var(--primary); color: #fff; padding: 0 13px; cursor: pointer; font-weight: 800; }
.user-menu { min-width: max-content; }
.user-dropdown { position: relative; }
.user-dropdown > summary { min-height: 44px; display: flex; align-items: center; gap: 9px; list-style: none; border: 1px solid transparent; border-radius: 10px; padding: 3px 8px 3px 4px; cursor: pointer; }
.user-dropdown > summary::-webkit-details-marker { display:none; }
.user-dropdown > summary:hover,.user-dropdown[open] > summary { border-color: var(--line); background: #f5f9fb; }
.user-dropdown > summary strong,.user-dropdown > summary small { display:block; max-width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-dropdown > summary b { color:var(--muted); font-size:10px; }
.user-dropdown > div { position:absolute; z-index:80; top:calc(100% + 8px); right:0; width:245px; display:grid; gap:3px; border:1px solid var(--line); border-radius:10px; background:#fff; padding:7px; box-shadow:0 18px 42px rgba(25,44,70,.18); }
.user-dropdown > div a { min-height:37px; display:flex; align-items:center; border-radius:7px; padding:7px 10px; color:#29445d; font-weight:700; }
.user-dropdown > div a:hover { background:var(--primary-soft); color:var(--primary); }
.company-theme-fields input[type="color"] { height:46px; padding:4px; cursor:pointer; }
.theme-preview { display:flex; align-items:center; gap:14px; border:1px solid var(--line); border-left:8px solid var(--preview-nav); border-radius:10px; margin:18px 0; padding:15px; background:#f8fafc; }
.theme-preview strong { color:var(--preview-nav); margin-right:auto; }
.theme-preview span { border-radius:7px; background:var(--preview-nav); color:#fff; padding:8px 12px; }
.theme-preview button { border:0; border-radius:7px; background:var(--preview-primary); color:#fff; padding:9px 13px; }
.theme-preview em { color:var(--preview-accent); font-style:normal; font-weight:850; }
.universal-select { position:relative; min-width:180px; }
.universal-select > input { padding-right:35px; text-transform:none !important; }
.universal-select > button { position:absolute; z-index:2; top:1px; right:1px; width:34px; height:38px; border:0; border-radius:0 7px 7px 0; background:#eef5f8; color:var(--primary); cursor:pointer; }
.universal-select-menu { position:absolute; z-index:95; top:calc(100% + 5px); left:0; right:0; min-width:310px; max-height:310px; overflow:auto; border:1px solid #bfd3de; border-radius:9px; background:#fff; padding:6px; box-shadow:0 16px 38px rgba(25,44,70,.2); }
.universal-select-menu button { width:100%; display:block; border:0; border-radius:6px; background:transparent; padding:9px 10px; color:var(--ink); text-align:left; cursor:pointer; }
.universal-select-menu button:hover,.universal-select-menu button.active { background:var(--primary-soft); color:var(--primary); }
.universal-select-menu small { display:block; border-top:1px solid var(--line); margin-top:4px; padding:7px 8px 3px; color:var(--muted); }
.universal-native-select { position:absolute !important; width:1px !important; height:1px !important; opacity:0 !important; pointer-events:none !important; }
.smart-button-bar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.smart-button { min-width:150px; display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto auto; align-items:center; column-gap:10px; border:1px solid var(--line); border-radius:8px; background:#fff; padding:9px 13px; box-shadow:0 3px 10px rgba(25,44,70,.05); text-decoration:none; }
.smart-button:hover { border-color:var(--accent); transform:translateY(-1px); box-shadow:0 5px 14px rgba(14,165,199,.15); }
.smart-button strong { grid-row:1/3; color:var(--primary); font-size:15px; font-weight:900; white-space:nowrap; letter-spacing:-.01em; padding-right:2px; }
.smart-button span { grid-column:2; color:#1e3a50; font-weight:800; font-size:11px; line-height:1.3; white-space:nowrap; }
.smart-button small { grid-column:2; color:var(--muted); font-size:10px; white-space:nowrap; line-height:1.2; }
.search-result-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.search-result-card { padding:0; overflow:hidden; }
.search-result-card .panel-header { margin:0; padding:15px 17px; }
.search-result-list { display:grid; }
.search-result-list a { display:grid; grid-template-columns:1fr auto; gap:8px; border-top:1px solid var(--line); padding:12px 17px; }
.search-result-list a:hover { background:var(--primary-soft); }
.search-result-list strong,.search-result-list small { display:block; }
.search-result-list small { margin-top:3px; color:var(--muted); }
.search-result-list em { color:var(--primary); font-style:normal; font-weight:850; }
.party-activity-tabs { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:17px; }
.party-activity-tabs a { border:1px solid var(--line); border-radius:7px; background:#fff; padding:9px 13px; color:var(--muted); font-weight:750; }
.party-activity-tabs a.active { border-color:var(--primary); background:var(--primary); color:#fff; }
.so-bom-select.not-applicable { opacity:.62; background:#f1f5f9; color:#64748b; }
.company-document-actions { display:flex; flex-wrap:wrap; gap:8px; }

@media (max-width:1450px){.topbar-global-search{width:min(430px,34vw)}.quick-entry-menu{display:none}.user-dropdown > summary small{display:none}}
@media (max-width:900px){.topbar{top:0}.topbar-global-search{order:3;width:100%;margin:4px 0 0}.topbar{flex-wrap:wrap}.topbar-title{flex:1}.search-result-grid{grid-template-columns:1fr}.theme-preview{align-items:stretch;flex-direction:column}.theme-preview strong{margin-right:0}}

@media (max-width: 1200px) {
    .sidebar { position: fixed; z-index: 40; top: 0; left: -292px; width: 280px; height: 100vh; align-items: stretch; flex-direction: column; gap: 13px; overflow-y: auto; padding: 14px; transition: left .18s ease; }
    .menu-open .sidebar { left: 0; }
    .menu-open { overflow: hidden; }
    .menu-open::after { content: ""; position: fixed; z-index: 35; inset: 0; background: rgba(5,30,57,.42); }
    .sidebar-brand { width: 100%; min-width: 0; height: 70px; }
    .sidebar-logo { height: 58px !important; max-height: 58px !important; }
    .nav-list { display: grid; align-items: stretch; gap: 4px; }
    .nav-home, .nav-group > summary { width: 100%; min-height: 45px; font-size: 14px; }
    .nav-group { width: 100%; }
    .nav-dropdown, .nav-dropdown-end { position: static; width: auto; min-width: 0; max-height: none; display: block; margin: 3px 0 7px 22px; border-color: rgba(216,230,238,.3); box-shadow: none; }
    .nav-dropdown::before { display: none; }
    .nav-dropdown-section + .nav-dropdown-section { margin-top: 7px; }
    .sidebar-status { margin: auto 8px 0; }
    .menu-button { display: block; }
    .topbar { position: sticky; z-index: 30; top: 0; }
}

@media (max-width: 1050px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid, .data-layout, .purchase-detail-grid, .production-history-grid { grid-template-columns: 1fr; }
    .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-grid, .register-main-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .task-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .document-info-grid { grid-template-columns: repeat(2, 1fr); }
    .tracking-card { align-items: stretch; flex-wrap: wrap; }
    .tracking-card form { width: 100%; margin: 10px 0 0; }
    .import-layout { grid-template-columns: 1fr; }
    .gate-reference-grid { grid-template-columns: minmax(220px,.8fr) minmax(280px,1.2fr) auto; }
}

@media (max-width: 760px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-story { display: none; }
    .login-card-logo { display: block; }
    .app-shell { display: block; }
    .sidebar { left: -267px; width: 255px; }
    .menu-open .sidebar { left: 0; }
    .topbar { padding: 10px 15px; }
    .content { padding: 18px 15px 30px; }
    .user-menu > div:not(.avatar):not(.topbar-tools) { display: none; }
    .user-menu .topbar-tools { display: flex; }
    .topbar-tools > a { min-width: 40px; width: 40px; grid-template-columns: 1fr; padding: 0; }
    .topbar-tools small { display: none; }
    .metric-grid, .module-grid, .form-grid.four, .form-grid.three, .form-grid.two { grid-template-columns: 1fr; }
    .filter-grid, .address-grid, .view-bottom-grid, .document-info-grid, .quick-create-form { grid-template-columns: 1fr; }
    .task-filter-grid { grid-template-columns: 1fr; }
    .permission-selector-form,.notification-preference-card .check-stack { grid-template-columns: 1fr; }
    .compact-selector label { grid-template-columns: 1fr; }
    .gate-reference-grid { grid-template-columns: 1fr; }
    .gate-reference-grid .button { width: 100%; }
    .document-info-grid > div, .address-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .document-form-actions, .action-row { align-items: stretch; flex-direction: column; }
    .tracking-card > div { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 5px; }
    .party-parent-card { align-items: stretch; flex-direction: column; gap: 15px; }
    .location-count { border-top: 1px solid var(--line); border-left: 0; padding-top: 12px; text-align: left; }
    .check-stack { grid-template-columns: 1fr; }
    .import-result { grid-template-columns: 1fr 1fr; }
    .import-result > div { border-bottom: 1px solid var(--line); }
    .template-list article { align-items: stretch; flex-direction: column; }
    .company-brand-preview { align-items: flex-start; flex-direction: column; }
    .company-brand-preview img { width: min(310px, 100%); }
    .form-grid .span-2 { grid-column: auto; }
    .setup-actions, .page-actions, .app-footer { align-items: stretch; flex-direction: column; }
}

.nav-combined-dashboard{grid-column:1/-1;background:linear-gradient(135deg,rgba(21,77,154,.12),rgba(0,166,196,.12));border:1px solid rgba(0,166,196,.28)!important;border-radius:9px!important;color:#154d9a!important;font-weight:800!important;text-align:center}
.customer-operations-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:18px}
@media(max-width:1100px){.customer-operations-grid{grid-template-columns:1fr}}

/* Extended operations · price, service, communication and administrator tools */
.quick-entry-menu{position:relative}
.quick-entry-menu>summary{list-style:none;min-height:38px;display:flex;align-items:center;border:1px solid rgba(14,165,199,.42);border-radius:8px;padding:0 12px;color:#154d9a;background:#effbfe;font-size:12px;font-weight:800;cursor:pointer;white-space:nowrap}
.quick-entry-menu>summary::-webkit-details-marker{display:none}
.quick-entry-menu>div{position:absolute;z-index:90;right:0;top:44px;width:220px;display:grid;border:1px solid var(--line);border-radius:10px;padding:7px;background:#fff;box-shadow:0 16px 38px rgba(7,41,75,.18)}
.quick-entry-menu a{border-radius:7px;padding:9px 10px;color:var(--ink);font-size:12px;font-weight:700;text-decoration:none}
.quick-entry-menu a:hover{color:#154d9a;background:#edf8fb}
.quick-entry-menu>div>strong{padding:8px 10px 3px;color:#0a7f9d;font-size:9px;letter-spacing:.12em;border-top:1px solid #e5eef2}
.quick-entry-menu>div>strong:first-child{border-top:0}
.module-tabs{display:flex;gap:10px;margin:0 0 18px;padding:8px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 7px 20px rgba(11,62,99,.06)}
.module-tabs a{min-width:150px;display:flex;align-items:center;justify-content:center;gap:9px;border:1px solid #cfe1e8;border-radius:9px;padding:12px 20px;color:#31526a;background:#f7fbfc;font-size:15px;font-weight:850;text-decoration:none;transition:.16s ease}
.module-tabs a span{color:#0b8eae;font-size:18px}
.module-tabs a:hover{border-color:#61cadd;background:#edfbfe;color:#154d9a;transform:translateY(-1px)}
.module-tabs a.active{border-color:#118fb2;background:linear-gradient(120deg,#0ea5c7,#087bb3);color:#fff;box-shadow:0 7px 16px rgba(8,123,179,.22)}
.module-tabs a.active span{color:#fff}
.single-tab-panel{grid-template-columns:minmax(0,1fr)}
.report-selector-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.report-selector-grid a{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:9px;padding:12px;color:var(--ink);background:#f8fbfc;text-decoration:none}
.report-selector-grid a span{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:#dff6fa;color:#087b9b;font-size:11px;font-weight:900}
.report-selector-grid a strong{font-size:12px}.report-selector-grid a.active{border-color:#1aa3c1;background:#ecfbfe;box-shadow:inset 3px 0 #0e9fbe}
.ai-response{margin-top:18px;border:1px solid #bfe3eb;border-radius:10px;padding:18px;background:#f4fcfe}
.ai-response pre{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.65 "Segoe UI",sans-serif;color:#183c54}
.topbar-context-links{display:flex;gap:7px;margin-top:5px}
.topbar-context-links a{border-radius:99px;padding:3px 9px;color:#fff;background:linear-gradient(135deg,#154d9a,#0ea5c7);font-size:9px;font-weight:800;letter-spacing:.04em;text-decoration:none;text-transform:uppercase}
.nav-danger-link{color:#b42318!important;background:#fff1f0!important}
.password-input-wrap{display:flex;align-items:stretch;gap:0;width:100%}.password-input-wrap>input{flex:1;min-width:0;border-radius:8px 0 0 8px!important}.password-toggle{border:1px solid #b8c8d7;border-left:0;border-radius:0 8px 8px 0;background:#e8f7fb;color:#075985;font-weight:800;padding:0 12px;cursor:pointer}.password-toggle:hover{background:#c9f1f7}.danger-zone>summary{cursor:pointer;color:#b42318;padding:4px 0}
.price-list-controls{display:grid;grid-template-columns:180px minmax(280px,1fr) auto;align-items:end;gap:12px;border-bottom:1px solid var(--line);padding:16px}
.attachment-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.attachment-card{overflow:hidden;border:1px solid var(--line);border-radius:10px;background:#fff}
.attachment-card img{display:block;width:100%;height:150px;object-fit:cover;background:#edf4f8}
.attachment-card>div{padding:11px}
.attachment-card small{display:block;margin:5px 0;color:var(--muted)}
.attachment-file-icon{display:grid;place-items:center;height:150px;color:#fff;background:linear-gradient(135deg,#154d9a,#0ea5c7);font-size:30px;font-weight:900;text-decoration:none}
.attachment-upload-form{display:grid;grid-template-columns:minmax(240px,1fr) minmax(240px,1fr) auto;align-items:end;gap:12px}
.alternative-price-card{margin-top:18px}
.danger-link{border:0;padding:0;color:var(--danger);background:none;font:inherit;font-weight:750;cursor:pointer}
.summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.summary-grid article{border:1px solid var(--line);border-radius:10px;padding:15px;background:#f8fbfd}
.summary-grid span,.summary-grid strong{display:block}.summary-grid span{color:var(--muted);font-size:10px;font-weight:800}.summary-grid strong{margin-top:5px;font-size:23px;color:#154d9a}
.signature-setting-grid{display:grid;grid-template-columns:minmax(280px,.55fr) minmax(320px,1fr);gap:24px;align-items:start}
.signature-preview,.signature-empty{width:100%;max-width:430px;height:190px;border:1px dashed #a9bfce;border-radius:10px;object-fit:contain;background:#f8fbfd;padding:16px}
.signature-empty{display:grid;place-items:center;color:var(--muted);font-weight:800}
.inline-update{display:grid;grid-template-columns:150px minmax(180px,1fr) auto;gap:6px;margin-top:8px}
.danger-zone{border:1px solid #f0a6a0;box-shadow:0 8px 24px rgba(180,35,24,.08)}
.danger-zone .panel-header h2{color:#b42318}
.badge.danger{color:#b42318;background:#ffebe9}
@media(max-width:1000px){.attachment-grid,.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.price-list-controls,.signature-setting-grid{grid-template-columns:1fr}}
@media(max-width:760px){.quick-entry-menu>summary{width:40px;overflow:hidden;padding:0 9px}.quick-entry-menu>div{position:fixed;top:68px;right:12px}.attachment-grid,.inline-update{grid-template-columns:1fr}.topbar-context-links{display:none}.module-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.module-tabs a{min-width:0;padding:10px 6px;font-size:12px}.report-selector-grid{grid-template-columns:1fr 1fr}}
.generated-code-box{min-height:43px;display:flex;align-items:center;padding:10px 12px;border:1px dashed #38bdf8;border-radius:8px;background:#effaff;color:#075985;font-weight:800;letter-spacing:.04em}
.persistent-filter-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0 16px;padding:10px 12px;border:1px solid #bae6fd;border-radius:10px;background:#f0f9ff}
.persistent-filter-bar>strong{font-size:10px;letter-spacing:.08em;color:#0369a1;margin-right:2px}
.filter-chip{border:1px solid #7dd3fc;border-radius:999px;background:#fff;color:#075985;padding:6px 10px;font:700 11px inherit;cursor:pointer}
.filter-chip:hover{background:#e0f2fe;border-color:#0ea5e9}.filter-clear{margin-left:auto}
code{font-family:Consolas,Monaco,monospace;background:#eaf3f8;border-radius:4px;padding:1px 4px}

/* Phase 30 · app launcher, large vouchers, activity and read-only smart view */
.app-launcher{position:relative;flex:0 0 auto}.app-launcher>summary{list-style:none;min-height:42px;display:flex;align-items:center;gap:7px;border:1px solid color-mix(in srgb,var(--primary) 28%,#dbe7ee);border-radius:9px;padding:0 11px;background:color-mix(in srgb,var(--primary) 6%,#fff);color:var(--primary);font-size:13px;font-weight:850;cursor:pointer}.app-launcher>summary::-webkit-details-marker{display:none}.app-launcher-grid{position:absolute;z-index:1300;top:48px;left:0;width:390px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff;box-shadow:0 22px 55px rgba(15,42,70,.24)}.app-launcher-grid a{min-height:82px;display:grid;place-items:center;align-content:center;gap:6px;border:1px solid #dce8ee;border-radius:11px;background:#f8fbfd;color:#27465f;text-align:center;text-decoration:none;font-size:11px;font-weight:800}.app-launcher-grid a:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,#fff);transform:translateY(-1px)}.app-launcher-grid b{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:linear-gradient(135deg,var(--primary),var(--accent));color:#fff;font-size:17px}
.document-form-card{padding:24px}.document-form-card+.document-form-card{margin-top:20px}.po-lines-wrap,.document-form-card>.table-wrap{max-height:64vh;overflow:auto;border:1px solid #dbe7ee;border-radius:10px}.po-lines{min-width:1320px}.po-lines th{position:sticky;z-index:5;top:0;background:#edf4f8;box-shadow:0 1px #cbdbe4}.po-lines th:nth-child(2){width:470px}.po-lines th:nth-child(3){width:220px}.po-lines td{padding:10px 7px;vertical-align:top}.po-lines tbody tr:nth-child(even){background:#fbfdfe}.po-lines tbody tr:focus-within{background:#f0fbfd;box-shadow:inset 3px 0 var(--accent)}.po-total-box{margin-top:16px}.item-inline-add{display:block;margin:5px 0 2px;border:0;background:transparent;color:var(--primary);padding:2px 4px;font-size:10px;font-weight:850;cursor:pointer}.item-inline-add:hover{text-decoration:underline;color:var(--accent)}
.dashboard-smart-view{margin:18px 0}.smart-party-selector{display:grid;grid-template-columns:minmax(320px,650px);margin:0 0 16px}.dashboard-smart-view .smart-button-bar{margin-bottom:0}.dashboard-smart-view .smart-button{min-width:170px}.dashboard-smart-view .smart-button strong{font-size:14px}.pending-po-stock-panel{margin-bottom:18px;border-left:4px solid var(--accent)}
.permission-console-nav{position:sticky;z-index:12;top:145px;display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:16px;padding:12px 16px}.permission-console-nav label{width:min(520px,55vw)}.permission-console-nav .action-row{margin:0}.permission-matrix-card{scroll-margin-top:160px}.permission-matrix thead th{position:sticky;z-index:4;top:0}.permission-search-table tr[hidden]{display:none}
.danger-zone .button.danger{border-color:#b42318;background:#b42318;color:#fff}.danger-zone .button.danger:hover{background:#8f1c13}
@media(max-width:1100px){.app-launcher>summary span{display:none}.app-launcher-grid{position:fixed;top:72px;left:12px;width:min(390px,calc(100vw - 24px))}.permission-console-nav{position:static;align-items:stretch;flex-direction:column}.permission-console-nav label{width:100%}}
@media(max-width:700px){.app-launcher-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.document-form-card{padding:16px}.smart-party-selector{grid-template-columns:1fr}}
@media(max-width:720px){.persistent-filter-bar{align-items:stretch}.filter-chip{text-align:left}.filter-clear{margin-left:0}}
.smart-item-line{display:grid;grid-template-columns:minmax(390px,1fr) auto;align-items:start;gap:6px;min-width:500px}.item-combobox{position:relative;min-width:390px}.item-combobox-input{width:100%!important;min-width:390px!important;padding-right:38px!important;text-overflow:ellipsis}.item-combobox-toggle{position:absolute;right:2px;top:2px;width:34px;height:calc(100% - 4px);border:0;border-left:1px solid #cbd5e1;background:#f8fafc;color:#155e75;border-radius:0 6px 6px 0;font-size:18px;cursor:pointer}.item-native-select{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;overflow:hidden!important}.item-combobox-menu{position:absolute;z-index:1200;left:0;right:0;top:calc(100% + 4px);max-height:330px;overflow:auto;padding:5px;background:#fff;border:1px solid #94a3b8;border-radius:9px;box-shadow:0 18px 45px rgba(15,23,42,.2)}.item-combobox-menu button{display:block;width:100%;padding:9px 10px;border:0;border-radius:6px;background:#fff;color:#0f172a;text-align:left;font-size:12px;line-height:1.35;white-space:normal;cursor:pointer}.item-combobox-menu button:hover,.item-combobox-menu button.active{background:#e0f2fe;color:#075985}.item-combobox-note{display:block;padding:8px 10px;color:#64748b;font-size:10px;font-weight:800;letter-spacing:.03em}.item-history-button{border:1px solid #0891b2;background:#ecfeff;color:#155e75;border-radius:7px;padding:8px 10px;font-size:11px;font-weight:800;white-space:nowrap;cursor:pointer}.item-history-button:disabled{opacity:.45;cursor:not-allowed}.item-rate-preview{display:block;min-height:16px;margin-top:4px;color:#0369a1;font-size:10px;font-weight:800;letter-spacing:.02em}.global-search-help{display:block;margin-top:4px;color:#475569;font-size:10px;font-weight:750}.price-history-dialog{width:min(980px,94vw);max-height:88vh;border:0;border-radius:16px;padding:24px;box-shadow:0 30px 80px rgba(15,23,42,.35)}.price-history-dialog::backdrop{background:rgba(15,23,42,.55)}.dialog-close{position:absolute;right:12px;top:10px}.dialog-close button{border:0;background:#e2e8f0;width:34px;height:34px;border-radius:50%;font-size:22px;cursor:pointer}.history-valuations{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
@media(max-width:700px){.smart-item-line{grid-template-columns:1fr;min-width:300px}.item-combobox,.item-combobox-input{min-width:290px!important}.price-history-dialog{padding:16px}}
.multi-company-create{margin-top:18px}.multi-company-advanced,.register-company-existing{margin-top:18px}.multi-company-advanced>summary,.register-company-existing>summary{cursor:pointer;padding:14px 16px;border:1px solid #bae6fd;border-radius:9px;background:#f0f9ff;color:#0c4a6e}.multi-company-advanced[open]>summary,.register-company-existing[open]>summary{margin-bottom:18px}.register-company-existing>form{margin-top:18px}.multi-company-advanced summary small,.register-company-existing summary small{color:#64748b;font-weight:600}

/* =========================================================
   Phase 33 Modern Workspace UI
   Odoo-inspired information density and app navigation while
   preserving HYDTECH branding, routes and existing workflows.
   ========================================================= */
:root {
    --surface-soft: #f7f7f9;
    --surface-muted: #f1f2f4;
    --ink-strong: #26272b;
    --modern-radius: 10px;
    --modern-shadow: 0 1px 2px rgba(18, 24, 40, .04), 0 6px 20px rgba(18, 24, 40, .06);
}
body {
    background: #f6f6f8;
    color: #2f3340;
    line-height: 1.45;
}
.card {
    border-color: #e4e5e9;
    border-radius: var(--modern-radius);
    box-shadow: var(--modern-shadow);
}
.sidebar {
    min-height: 58px;
    padding: 6px 16px;
    gap: 10px;
    background: linear-gradient(105deg, color-mix(in srgb,var(--nav) 92%,#322238), color-mix(in srgb,var(--nav-soft) 88%,#5b3b56));
    box-shadow: 0 2px 10px rgba(34,22,32,.16);
}
.sidebar-brand {
    width: 154px;
    min-width: 154px;
    height: 44px;
    border-radius: 7px;
    padding: 4px 7px;
    box-shadow: none;
}
.sidebar-logo { height: 36px !important; max-height: 36px !important; }
.nav-list { gap: 2px; }
.nav-home, .nav-group > summary {
    min-height: 38px;
    border-color: transparent;
    border-radius: 6px;
    background: transparent;
    padding: 0 11px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0;
}
.nav-home:hover, .nav-group:hover > summary {
    border-color: rgba(255,255,255,.08);
    background: rgba(255,255,255,.10);
    box-shadow: none;
    transform: none;
}
.nav-home.active, .nav-group.active > summary, .nav-group[open] > summary {
    border-color: rgba(255,255,255,.10);
    background: rgba(255,255,255,.16);
    box-shadow: inset 0 -2px 0 color-mix(in srgb,var(--accent) 76%,white);
}
.nav-dropdown {
    top: calc(100% + 7px);
    border-color: #dedfe4;
    border-radius: 9px;
    padding: 7px;
    box-shadow: 0 14px 38px rgba(23,24,29,.16);
}
.nav-dropdown a {
    border-radius: 6px;
    padding: 8px 10px;
}
.nav-dropdown a:hover, .nav-dropdown a.active { background: color-mix(in srgb,var(--primary-soft) 72%,#f7f0f5); }
.topbar {
    top: 58px;
    min-height: 66px;
    border-top: 0;
    border-bottom-color: #e4e5e9;
    padding: 8px 22px;
    box-shadow: 0 1px 5px rgba(22,24,29,.05);
}
.topbar-title h1 { font-size: 21px; color: var(--ink-strong); font-weight: 700; }
.eyebrow { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.topbar-context-links a {
    background: #f2eef1;
    color: var(--primary);
    border: 1px solid #e5dfe3;
    border-radius: 6px;
    text-transform: none;
    letter-spacing: 0;
}
.topbar-global-search {
    height: 40px;
    border-color: #d9dadd;
    border-radius: 8px;
    background: #f7f7f9;
}
.topbar-global-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent); }
.topbar-global-search > span { color: var(--muted); }
.topbar-global-search button {
    border-radius: 0 7px 7px 0;
    background: var(--primary);
    font-weight: 650;
}
.topbar-tools > a {
    border-color: #e0e1e4;
    border-radius: 7px;
    background: #f8f8fa;
    color: #4c5060;
}
.topbar-tools > a:hover { border-color: color-mix(in srgb,var(--primary) 35%,#ddd); background: color-mix(in srgb,var(--primary-soft) 52%,#fff); }
.topbar-tools span { color: var(--primary); }
.user-dropdown > summary { border-radius: 8px; }
.user-dropdown > div { border-radius: 9px; box-shadow: 0 14px 38px rgba(23,24,29,.15); }
.content { max-width: 1760px; width: 100%; margin: 0 auto; padding: 22px 24px 40px; }
.page-actions { margin-bottom: 16px; }
.button {
    min-height: 38px;
    border-radius: 7px;
    padding: 0 15px;
    font-weight: 650;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.button.primary {
    background: var(--primary);
    box-shadow: 0 2px 6px color-mix(in srgb,var(--primary) 20%,transparent);
}
.button.primary:hover { background: color-mix(in srgb,var(--primary) 88%,#111); transform: translateY(-1px); }
.button.secondary { border-color: #dbdce0; background: #fff; color: #4c5060; }
.button.secondary:hover { border-color: color-mix(in srgb,var(--primary) 35%,#ddd); background: #f8f7f8; }
input, select, textarea {
    border-color: #d7d9de;
    border-radius: 7px;
    padding: 9px 10px;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb,var(--primary) 11%,transparent); }
.panel { padding: 18px; }
.panel-header { padding-bottom: 11px; margin-bottom: 14px; }
.panel-header h2 { color: var(--ink-strong); font-size: 17px; }
.metric-grid { gap: 12px; }
.metric {
    min-height: 128px;
    padding: 16px;
    border: 1px solid #e5e6e9;
    box-shadow: 0 1px 2px rgba(18,24,40,.03);
}
.metric::before { width: 3px; background: var(--primary); }
.metric-top { font-size: 12px; }
.metric-icon {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    background: color-mix(in srgb,var(--primary) 12%,#fff);
    color: var(--primary);
    box-shadow: none;
    font-weight: 800;
}
.metric strong { margin-top: 10px; font-size: 25px; color: var(--ink-strong); }
.dashboard-grid { gap: 16px; }
.module-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.module-tile {
    position: relative;
    min-height: 108px;
    overflow: hidden;
    border-color: #e2e3e7;
    border-radius: 9px;
    background: #fff;
    padding: 16px 14px 14px 17px;
}
.module-tile::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15px;
    bottom: 15px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: color-mix(in srgb,var(--primary) 78%,var(--accent));
}
.module-tile:hover {
    border-color: color-mix(in srgb,var(--primary) 28%,#ddd);
    background: color-mix(in srgb,var(--primary-soft) 28%,#fff);
    box-shadow: 0 8px 20px rgba(28,29,35,.07);
    transform: translateY(-2px);
}
.module-tile strong { color: var(--ink-strong); font-size: 14px; }
.module-tile small { font-size: 11px; }
.smart-button {
    border-color: #e1e2e5;
    border-radius: 8px;
    box-shadow: none;
}
.smart-button:hover { border-color: color-mix(in srgb,var(--primary) 35%,#ddd); box-shadow: 0 5px 14px rgba(30,31,37,.06); }
.smart-button strong { color: var(--primary); }
.badge { border-radius: 99px; font-size: 10px; letter-spacing: .02em; }
.table-wrap {
    border: 1px solid #e2e3e7;
    border-radius: 9px;
    background: #fff;
}
table { border-collapse: separate; border-spacing: 0; }
thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f3f5;
    color: #545866;
    font-size: 11px;
    letter-spacing: .025em;
    text-transform: uppercase;
}
tbody tr:hover td { background: color-mix(in srgb,var(--primary-soft) 24%,#fff); }
td, th { border-color: #ececef !important; }
.document-form-card, .po-view-card, .task-update-card { border-radius: 10px; }
.po-lines input, .po-lines select { padding: 7px 8px; }
.po-total-box { border-radius: 8px; }
.po-total-box .grand { background: var(--primary); }
.alert { border-radius: 8px; box-shadow: 0 1px 2px rgba(18,24,40,.03); }
.quick-notes-panel .qn-item { border-radius: 8px; background: #faf9fb; }

@media (max-width: 1400px) {
    .module-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 1200px) {
    .sidebar { top: 0; min-height: 100vh; padding: 14px; }
    .topbar { top: 0; }
    .sidebar-brand { width: 100%; min-width: 0; height: 64px; }
    .sidebar-logo { height: 52px !important; max-height: 52px !important; }
    .nav-home, .nav-group > summary { min-height: 42px; }
}
@media (max-width: 900px) {
    .module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
    .content { padding: 16px 12px 28px; }
    .module-grid { grid-template-columns: 1fr; }
    .module-tile { min-height: 92px; }
    .metric-grid { grid-template-columns: 1fr; }
}

/* Phase 34: field/data permission console */
.field-permission-matrix .permission-page-row td{background:rgba(113,75,103,.06);font-weight:700;padding-left:28px}
.field-permission-matrix td:first-child small{display:block;opacity:.62;margin-top:2px}
.field-permission-matrix select.field-right{min-width:132px}
[data-field-permission-readonly="1"]{background:var(--surface-soft,#f6f7f9)!important;cursor:not-allowed!important;opacity:.82}
@media (max-width:900px){.field-permission-matrix{min-width:760px}}

/* Phase 35 · full-screen compact color workspace */
:root{
    --ink-strong:#102a43;
    --surface-soft:color-mix(in srgb,var(--primary) 4%,#fff);
    --surface-accent:color-mix(in srgb,var(--accent) 7%,#fff);
    --line-soft:color-mix(in srgb,var(--primary) 11%,#e6edf3);
}
body{background:linear-gradient(145deg,color-mix(in srgb,var(--primary) 3%,#f8fbfd),#f7fafc 48%,color-mix(in srgb,var(--accent) 4%,#f8fbfd));font-size:13px}
.content{max-width:none;width:100%;margin:0;padding:14px 16px 28px}
.sidebar{min-height:58px;padding:5px 12px;gap:9px;box-shadow:0 3px 14px rgba(15,40,70,.14)}
.sidebar-brand{width:145px;min-width:145px;height:46px;padding:4px 7px;border-radius:7px}
.sidebar-logo{height:38px!important;max-height:38px!important}
.nav-list{gap:2px}
.nav-home,.nav-group>summary{min-height:36px;padding:0 10px;border-radius:7px;font-size:12px;gap:6px}
.nav-home span,.nav-group>summary span{font-size:13px}
.sidebar-status{font-size:8px}
.topbar{top:58px;min-height:57px;padding:6px 16px 7px;gap:9px;border-top-width:2px;box-shadow:0 3px 12px rgba(25,44,70,.045)}
.topbar-title{min-width:155px}.topbar-title h1{font-size:18px}.topbar-title .eyebrow{font-size:8px;margin-bottom:1px}
.topbar-global-search{height:34px;width:min(560px,42vw);grid-template-columns:27px 1fr auto;border-radius:7px;margin-left:8px;padding-left:6px}
.topbar-global-search>span{font-size:16px}.topbar-global-search input{padding:5px}.topbar-global-search button{padding:0 10px;font-size:11px;border-radius:0 6px 6px 0}
.quick-entry-menu>summary{min-height:34px!important;font-size:11px!important;padding:0 9px!important}
.topbar-tools>a{min-width:44px;height:34px;grid-template-columns:14px 1fr;padding:0 6px;border-radius:7px}.topbar-tools small{font-size:8px}.topbar-tools em{top:-5px;right:-5px;min-width:17px;height:17px;font-size:8px}
.user-dropdown>summary{min-height:36px;padding:2px 6px 2px 3px;border-radius:8px}.avatar{width:29px!important;height:29px!important;font-size:11px!important}.user-dropdown>summary strong{font-size:11px}.user-dropdown>summary small{font-size:9px}
.card{border-color:var(--line-soft);border-radius:9px;box-shadow:0 5px 16px rgba(21,55,90,.055)}
.panel,.form-card,.table-card{padding:13px}.panel-header{padding-bottom:8px;margin-bottom:10px}.panel-header h2{font-size:15px;margin-bottom:2px}.panel-header p{font-size:11px}
h1{font-size:20px}h2{font-size:16px}h3{font-size:13px}
input,select,textarea{border-radius:6px;padding:7px 8px;font-size:12px}textarea{min-height:66px}label{gap:4px;font-size:11px}.form-grid{gap:10px}
.button{min-height:30px;border-radius:6px;padding:0 10px;font-size:11px;font-weight:800;box-shadow:none!important}.button.small{min-height:25px;padding:0 8px;font-size:10px}.action-row{gap:6px!important}
.badge,.status-badge{min-height:19px;padding:0 6px;border-radius:5px;font-size:9px;line-height:1}
.page-actions{margin-bottom:10px;gap:8px;min-height:28px}.page-actions p{font-size:11px}
.metric-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-bottom:12px}.metric{min-height:94px;padding:11px 12px;background:linear-gradient(150deg,#fff,var(--surface-soft))}.metric::before{width:3px}.metric-top{font-size:10px}.metric-icon{width:25px;height:25px;border-radius:6px;font-size:11px;box-shadow:none}.metric strong{margin-top:6px;font-size:20px}.metric small{margin-top:2px;font-size:9px;line-height:1.25}
.metric-grid>.metric:nth-child(1){--metric-tone:#2563eb}.metric-grid>.metric:nth-child(2){--metric-tone:#7c3aed}.metric-grid>.metric:nth-child(3){--metric-tone:#0891b2}.metric-grid>.metric:nth-child(4){--metric-tone:#059669}.metric-grid>.metric:nth-child(5){--metric-tone:#ea580c}.metric-grid>.metric:nth-child(6){--metric-tone:#db2777}
.metric-grid>.metric::before{background:var(--metric-tone,var(--primary))}.metric-grid>.metric .metric-icon{background:var(--metric-tone,var(--primary))}.metric-grid>.metric strong{color:var(--metric-tone,var(--ink-strong))}
.dashboard-grid{grid-template-columns:minmax(0,1.55fr) minmax(230px,.45fr);gap:10px}.module-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.module-tile{position:relative;min-height:74px;border-radius:8px;padding:10px 10px 9px 13px;overflow:hidden;background:linear-gradient(145deg,#fff,var(--surface-accent))}.module-tile::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--tile-tone,var(--primary))}.module-tile strong{font-size:12px;color:var(--tile-tone,var(--ink-strong))}.module-tile small{font-size:9px;line-height:1.25;margin-top:4px}.module-tile:nth-child(8n+1){--tile-tone:#2563eb}.module-tile:nth-child(8n+2){--tile-tone:#7c3aed}.module-tile:nth-child(8n+3){--tile-tone:#0891b2}.module-tile:nth-child(8n+4){--tile-tone:#059669}.module-tile:nth-child(8n+5){--tile-tone:#ea580c}.module-tile:nth-child(8n+6){--tile-tone:#db2777}.module-tile:nth-child(8n+7){--tile-tone:#4f46e5}.module-tile:nth-child(8n){--tile-tone:#0f766e}.module-tile:hover{border-color:var(--tile-tone,var(--accent));box-shadow:0 6px 16px color-mix(in srgb,var(--tile-tone,var(--accent)) 16%,transparent);transform:translateY(-1px)}
.status-list{gap:5px}.status-row{padding:6px 1px;border-bottom:1px solid var(--line-soft);font-size:11px}
.smart-button-bar{gap:5px;margin-bottom:10px}.smart-button{min-width:112px;min-height:42px;column-gap:7px;border-radius:6px;padding:5px 8px;box-shadow:none}.smart-button strong{font-size:12px}.smart-button span{font-size:9px}.smart-button small{font-size:8px}
.table-wrap{border:1px solid var(--line-soft);border-radius:7px;background:#fff}th,td{padding:6px 7px}th{font-size:8px;background:linear-gradient(180deg,color-mix(in srgb,var(--primary) 6%,#fff),#f8fafc);position:sticky;top:0;z-index:1}td{font-size:11px}tbody tr:nth-child(even){background:color-mix(in srgb,var(--primary) 1.8%,#fff)}tbody tr:hover{background:color-mix(in srgb,var(--accent) 7%,#fff)}
.alert{margin-bottom:9px;border-radius:7px;padding:8px 10px;font-size:11px}
.app-footer{padding:8px 16px;font-size:9px}.section-heading{padding-bottom:8px;margin:4px 0 11px}.section-heading:not(:first-of-type){margin-top:18px}.section-heading>span{width:24px;height:24px;font-size:10px}
.dashboard-smart-view{background:linear-gradient(120deg,#fff,color-mix(in srgb,var(--accent) 5%,#fff))}
.phase35-dashboard-strip{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;margin-bottom:10px;padding:10px 12px;border:1px solid var(--line-soft);border-radius:9px;background:linear-gradient(105deg,color-mix(in srgb,var(--nav) 96%,#fff),color-mix(in srgb,var(--primary) 88%,#fff) 58%,color-mix(in srgb,var(--accent) 86%,#fff));color:#fff;box-shadow:0 6px 18px rgba(10,45,85,.12)}
.phase35-dashboard-strip h2{margin:0 0 2px;color:#fff;font-size:15px}.phase35-dashboard-strip p{margin:0;color:rgba(255,255,255,.8);font-size:10px}.phase35-dashboard-strip .phase35-pills{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.phase35-dashboard-strip .phase35-pills span{padding:4px 7px;border:1px solid rgba(255,255,255,.22);border-radius:5px;background:rgba(255,255,255,.1);font-size:9px;font-weight:800}
@media(max-width:1550px){.metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.module-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1200px){.topbar{top:0}.sidebar{min-height:100vh}.sidebar-brand{width:100%;height:58px}.sidebar-logo{height:50px!important;max-height:50px!important}.module-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){.content{padding:10px}.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}.module-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.phase35-dashboard-strip{grid-template-columns:1fr}.phase35-dashboard-strip .phase35-pills{justify-content:flex-start}}
@media(max-width:560px){.metric-grid,.module-grid{grid-template-columns:1fr}.metric{min-height:82px}.content{padding:8px}.button{min-height:29px}.phase35-dashboard-strip{padding:9px}}


/* Phase 37 notification ticker */
.phase37-notice-bar{display:flex;align-items:center;gap:10px;margin:0 14px;padding:5px 10px;background:linear-gradient(90deg,rgba(14,165,199,.12),rgba(21,77,154,.08));border:1px solid rgba(14,165,199,.22);border-radius:8px;min-height:30px;overflow:hidden}
.phase37-notice-bar>strong{font-size:10px;letter-spacing:.1em;background:var(--primary);color:#fff;border-radius:5px;padding:3px 6px;flex:0 0 auto}.phase37-notice-scroll{display:flex;gap:16px;overflow-x:auto;scrollbar-width:none;white-space:nowrap;flex:1}.phase37-notice-scroll::-webkit-scrollbar{display:none}.phase37-notice-item{display:inline-flex;align-items:center;gap:5px;font-size:11px}.phase37-notice-item a{color:var(--text);text-decoration:none}.phase37-notice-close{border:0;background:transparent;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;padding:0 3px}.phase37-notice-close:hover{color:var(--danger)}
/* Phase 38 persistent compact module tabs */
.phase38-module-tabs{position:sticky;top:0;z-index:35;display:flex;gap:4px;overflow-x:auto;margin:-2px 0 10px;padding:4px 5px;border-radius:8px}.phase38-module-tabs a{min-width:auto!important;padding:6px 10px!important;font-size:11px!important;border-radius:6px!important;white-space:nowrap}.phase38-admin-return{margin-right:8px}.smart-party-search{max-width:760px}.smart-party-search label{margin:0}

/* Phase 39 — consistent controls and Odoo-inspired compact workflow navigation */
:root{--control-h:32px}
input:not([type=checkbox]):not([type=radio]):not([type=color]),select{min-height:var(--control-h);height:var(--control-h);box-sizing:border-box;line-height:1.2}
textarea{box-sizing:border-box}select{appearance:auto;background:#fff}.universal-select>input,.item-combobox-input{height:var(--control-h)!important;min-height:var(--control-h)!important}.universal-select>button,.item-combobox-toggle{height:calc(var(--control-h) - 2px)!important}
.phase39-flow-tabs{position:sticky;top:0;z-index:34;display:flex;align-items:center;gap:4px;overflow-x:auto;padding:5px;margin:0 0 10px;border:1px solid #e2e8f0;border-radius:8px;background:rgba(255,255,255,.96);box-shadow:0 4px 12px rgba(15,23,42,.05)}
.phase39-flow-tabs a{white-space:nowrap;text-decoration:none;padding:5px 9px;border-radius:6px;border:1px solid #dbe3ea;background:#f8fafc;color:#334155;font-size:10px;font-weight:850}.phase39-flow-tabs a:hover,.phase39-flow-tabs a.active{background:#334155;color:#fff;border-color:#334155}.phase39-flow-tabs .flow-arrow{color:#94a3b8;font-size:11px}.phase39-flow-tabs .flow-new{background:#ecfdf5;border-color:#bbf7d0;color:#166534}
.finance-command-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.finance-command-grid .module-tile{min-height:76px;padding:11px}.finance-command-grid .module-tile strong{font-size:12px}.finance-command-grid .module-tile small{font-size:10px}
.bulk-edit-table input{min-width:92px}.bulk-edit-table td:first-child{position:sticky;left:0;background:#fff;z-index:2}.bulk-edit-table th:first-child{position:sticky;left:0;z-index:4}
@media(max-width:900px){.finance-command-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Phase 40: compact accounting/module tabs + transaction price history */
.phase40-flow-tabs{position:sticky;top:0;z-index:36;display:flex;align-items:center;gap:3px;overflow-x:auto;padding:4px 5px;margin:0 0 9px;border:1px solid #e2e8f0;border-radius:8px;background:rgba(255,255,255,.98);box-shadow:0 4px 12px rgba(15,23,42,.05);scrollbar-width:thin}
.phase40-flow-tabs a{white-space:nowrap;text-decoration:none;padding:5px 8px;border-radius:6px;border:1px solid #dde5ec;background:#f8fafc;color:#334155;font-size:10px;font-weight:800}.phase40-flow-tabs a:hover,.phase40-flow-tabs a.active{background:#334155;color:#fff;border-color:#334155}.phase40-flow-tabs .flow-arrow{color:#94a3b8;font-size:10px}.phase40-flow-tabs .flow-new{background:#ecfdf5;border-color:#bbf7d0;color:#166534}
.phase40-price-panel{position:fixed;right:14px;bottom:14px;width:min(640px,calc(100vw - 28px));z-index:120;background:#fff;border:1px solid #cbd5e1;border-radius:10px;box-shadow:0 18px 50px rgba(15,23,42,.22);overflow:hidden}.phase40-price-head{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:9px 11px;background:#f8fafc;border-bottom:1px solid #e2e8f0}.phase40-price-head strong{display:block;font-size:12px}.phase40-price-head small{display:block;color:#64748b;max-width:520px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.phase40-price-head button{border:0;background:transparent;font-size:22px;line-height:1;cursor:pointer;color:#475569}.phase40-price-table{max-height:260px;overflow:auto}.phase40-price-table table{width:100%;border-collapse:collapse;font-size:10px}.phase40-price-table th,.phase40-price-table td{padding:6px 8px;border-bottom:1px solid #eef2f7;text-align:left}.phase40-price-table td small{display:block;color:#64748b}.phase40-price-table tr.same-party{background:#f0fdf4}.phase40-price-empty{padding:18px;color:#64748b;text-align:center}
@media(max-width:760px){.phase40-price-panel{right:6px;bottom:6px;width:calc(100vw - 12px)}.phase40-flow-tabs a{font-size:9px;padding:5px 7px}}
/* Phase 40 control geometry normalization */
.content input:not([type=checkbox]):not([type=radio]):not([type=file]),.content select,.topbar input,.topbar select{min-height:32px;border-radius:6px;box-sizing:border-box}.content textarea{border-radius:6px;box-sizing:border-box}.content .choices__inner,.content .ts-control,.content .select2-container .select2-selection--single{min-height:32px!important;border-radius:6px!important;box-sizing:border-box}.content .select2-container .select2-selection--single .select2-selection__rendered{line-height:30px}.content .select2-container .select2-selection--single .select2-selection__arrow{height:30px}
/* Phase 41 — internal activity and simplified open-module navigation */
.phase41-activity-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(300px,.8fr);gap:12px;align-items:start}.phase41-activity-grid>aside{display:grid;gap:12px}.phase41-comment-form{border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:12px}.phase41-timeline{display:grid;gap:8px}.phase41-timeline article{padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:#fbfdfe}.phase41-timeline article strong{display:inline-block;margin-right:8px}.phase41-timeline article small{color:var(--muted)}.phase41-timeline article p{margin:6px 0 0;white-space:normal}.phase41-file-list{display:grid;gap:6px;margin-top:10px}.phase41-file-list>a{display:flex;flex-direction:column;padding:8px 10px;border:1px solid var(--line);border-radius:7px;text-decoration:none;background:#fbfdfe}.phase41-file-list small{color:var(--muted)}.phase41-overdue td{background:#fff7f7}.table-subtext{display:block;color:var(--muted);margin-top:3px}.button.compact{min-height:26px!important;padding:3px 8px!important;font-size:11px!important}
body.phase41-ready .module-tabs:not(.phase41-functional-tabs){display:none!important}
@media(max-width:900px){.phase41-activity-grid{grid-template-columns:1fr}}
/* Phase 41 BOM reliable component picker */
.bom-component-picker{display:grid;grid-template-columns:minmax(230px,1fr) minmax(260px,1.25fr);gap:6px;align-items:center;min-width:520px}
.bom-component-search,.bom-component-select{width:100%;min-width:0}
@media(max-width:900px){.bom-component-picker{grid-template-columns:1fr;min-width:320px}}


/* Phase 41 UI alignment hotfix — consistent forms, voucher grids, and BOM autocomplete */
:root{--erp-control-h:32px}
.content .card,.content .document-form-card,.content .table-wrap,.content .po-lines-wrap{max-width:100%;box-sizing:border-box}
.content .form-grid{align-items:start}
.content .form-grid>label,.content .form-grid>div{min-width:0}
.content .form-grid input:not([type=checkbox]):not([type=radio]):not([type=file]),
.content .form-grid select,.content .form-grid textarea{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.content input:not([type=checkbox]):not([type=radio]):not([type=file]),
.content select{height:var(--erp-control-h);min-height:var(--erp-control-h);line-height:1.2;padding:6px 8px}
.content textarea{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.content .po-lines{width:100%;border-collapse:separate;border-spacing:0}
.content .po-lines th,.content .po-lines td{box-sizing:border-box;vertical-align:middle}
.content .po-lines td>input:not([type=checkbox]):not([type=radio]):not([type=file]),
.content .po-lines td>select,
.content .po-lines td>div>input:not([type=checkbox]):not([type=radio]):not([type=file]),
.content .po-lines td>div>select{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.content .universal-select,.content .item-combobox,.content .smart-item-line{max-width:100%;min-width:0}
.content .universal-select>input,.content .item-combobox-input{width:100%!important;max-width:100%!important;min-width:0!important}
.content .po-lines-wrap{overflow:auto;overscroll-behavior:contain}

/* BOM: one compact search control, real select kept hidden as the submitted ID field. */
#bom-lines{min-width:1180px;table-layout:fixed}
#bom-lines th:nth-child(1){width:38px}
#bom-lines th:nth-child(2){width:390px}
#bom-lines th:nth-child(3){width:90px}
#bom-lines th:nth-child(4){width:105px}
#bom-lines th:nth-child(5){width:105px}
#bom-lines th:nth-child(6){width:150px}
#bom-lines th:nth-child(7){width:125px}
#bom-lines th:nth-child(8){width:165px}
#bom-lines th:nth-child(9){width:48px}
#bom-lines td{padding:6px 5px;overflow:visible}
#bom-lines .bom-component-picker{position:relative;display:block;min-width:0;width:100%}
#bom-lines .bom-component-search{display:block;width:100%;min-width:0;padding-right:28px;text-overflow:ellipsis}
#bom-lines .bom-component-select{position:absolute!important;left:-99999px!important;top:auto!important;width:1px!important;height:1px!important;min-width:1px!important;opacity:0!important;pointer-events:none!important}
#bom-lines .bom-component-menu{position:absolute;z-index:1500;left:0;right:0;top:calc(100% + 3px);max-height:260px;overflow:auto;padding:4px;background:#fff;border:1px solid #aebdca;border-radius:7px;box-shadow:0 12px 28px rgba(15,23,42,.18)}
#bom-lines .bom-component-menu[hidden]{display:none!important}
#bom-lines .bom-component-menu button{display:block;width:100%;border:0;background:#fff;color:#172033;text-align:left;padding:7px 8px;border-radius:5px;font-size:11px;line-height:1.25;white-space:normal;cursor:pointer}
#bom-lines .bom-component-menu button:hover,#bom-lines .bom-component-menu button.active{background:#eaf4fb;color:#0f4c81}
#bom-lines .bom-component-empty{padding:8px;color:#64748b;font-size:11px}
#bom-lines .qty-input,#bom-lines .waste-input,#bom-lines .rate-input,#bom-lines .warehouse-select,#bom-lines [name="line_remarks[]"]{width:100%;min-width:0}
#bom-lines .total-cell{text-align:right;white-space:nowrap;font-weight:750}
#bom-lines .remove-line{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-width:28px;border:0;border-radius:6px;background:#fee9e7;color:#b42318;cursor:pointer}
@media(max-width:900px){#bom-lines{min-width:1080px}.document-form-card{overflow:visible}}


/* Phase 41 wide item-column correction for voucher entry grids */
@media (min-width:1100px){
  .content .po-lines:has(select[name="item_id[]"]) th:nth-child(2),
  .content .po-lines:has(select[name="item_id[]"]) td:nth-child(2){min-width:520px;width:520px}
  .content .po-lines:has(select[name="item_id[]"]) .item-combobox,
  .content .po-lines:has(select[name="item_id[]"]) .item-combobox-input,
  .content .po-lines:has(select[name="item_id[]"]) .smart-item-line{min-width:0!important;width:100%!important;max-width:none!important}
}
.item-combobox-menu,.universal-select-menu{z-index:2147482000}


/* Phase 41 final voucher grid width and floating dropdown correction */
@media (min-width:1100px){
  .content .po-lines:has(select[name="item_id[]"]) th:nth-child(2),
  .content .po-lines:has(select[name="item_id[]"]) td:nth-child(2){width:560px!important;min-width:560px!important;max-width:none!important}
  .content .po-lines:has(select[name="item_id[]"]){min-width:max(1320px,100%)!important}
  .content .po-lines:has(select[name="item_id[]"]) .smart-item-line,
  .content .po-lines:has(select[name="item_id[]"]) .item-combobox,
  .content .po-lines:has(select[name="item_id[]"]) .item-combobox-input{width:100%!important;min-width:0!important;max-width:none!important}
}
.item-combobox-menu{position:fixed!important;z-index:2147483000!important;min-width:520px;max-width:calc(100vw - 20px)}
#bom-lines .bom-component-menu{position:fixed!important;z-index:2147483100!important}


/* Phase 42 startup stabilization */
.phase42-processing{pointer-events:none;opacity:.82}
.phase42-price-history-panel{margin-top:14px;clear:both}
.phase42-price-history-panel .table-wrap{max-height:300px;overflow:auto}
.phase42-price-history-panel tr.same-party td{font-weight:600}
.phase42-serial-picker{position:relative;min-width:240px;max-width:100%}
.phase42-serial-button{width:100%;min-height:32px;text-align:left;border:1px solid var(--border,#cbd5e1);background:#fff;border-radius:6px;padding:6px 28px 6px 9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phase42-serial-menu{position:absolute;z-index:10050;top:calc(100% + 3px);left:0;min-width:100%;width:max-content;max-width:min(600px,85vw);max-height:280px;overflow:auto;background:#fff;border:1px solid var(--border,#cbd5e1);border-radius:7px;box-shadow:0 12px 30px rgba(15,23,42,.18);padding:6px}
.phase42-serial-option{display:block;padding:6px 8px;white-space:nowrap;cursor:pointer}
.phase42-serial-option:hover{background:#f1f5f9}
/* Phase 43 - high-volume serial entry and traceability layout */
.phase43-serial-entry{display:grid;grid-template-columns:minmax(420px,1fr) auto auto;gap:8px;align-items:end;margin-top:16px}.phase43-serial-entry label{min-width:0}.phase43-serial-entry input{font-size:16px;font-weight:700;letter-spacing:.02em}.serial-count-card{min-height:66px;border:1px solid var(--line);border-radius:9px;background:#f7fafc;padding:8px 12px;display:flex;flex-direction:column;justify-content:center}.serial-count-card small{font-size:9px;color:var(--muted);font-weight:800;letter-spacing:.08em}.serial-count-card strong{font-size:25px;line-height:1.05}.serial-count-card span{font-size:10px;color:var(--muted)}.serial-entry-message{margin:8px 0;padding:8px 10px;border-radius:7px;background:#eef8f1;color:#166534;font-weight:700}.serial-entry-message.error{background:#fff0f0;color:#b42318}.serial-recent{border:1px solid var(--line);border-radius:8px;padding:9px 10px;min-height:48px}.serial-recent>strong{display:block;font-size:10px;color:var(--muted);margin-bottom:6px}.serial-chip{display:inline-block;margin:2px 5px 2px 0;border:1px solid var(--line);border-radius:6px;background:#fff;padding:4px 7px;font-size:11px}.serial-chip b{font-size:8px;color:var(--primary)}.serial-trace-page .table-wrap{overflow:auto;isolation:isolate}.serial-trace-page .nav-dropdown,.serial-trace-page .smart-entry-results,.serial-trace-page [class*="popup"]{z-index:1200!important}.serial-trace-page table{min-width:1050px}.serial-trace-page td,.serial-trace-page th{vertical-align:top}@media(max-width:900px){.phase43-serial-entry{grid-template-columns:1fr 1fr}.phase43-serial-entry label{grid-column:1/-1}}


/* Phase 43 master/import + inline quick create */
.phase43-inline-master-wrap{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center;width:100%}.phase43-inline-master-add{min-height:34px;padding:0 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fafc;color:#0f4c81;font-size:11px;font-weight:800;cursor:pointer;white-space:nowrap}.phase43-quick-master-dialog{border:0;border-radius:12px;padding:0;width:min(680px,calc(100vw - 30px));box-shadow:0 24px 70px rgba(15,23,42,.28)}.phase43-quick-master-dialog::backdrop{background:rgba(15,23,42,.42)}.phase43-qm-card{padding:18px}.phase43-qm-card .p43qm-x{border:0;background:transparent;font-size:24px;cursor:pointer}.import-layout{grid-template-columns:minmax(390px,.85fr) minmax(560px,1.15fr)!important;align-items:start}.template-list article{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:14px!important;align-items:center!important}.template-list article small{line-height:1.45}.phase43-bom-live{margin-top:14px;padding:0!important}.phase43-bom-live>summary{display:flex;justify-content:space-between;gap:12px;padding:13px 16px;cursor:pointer;border-bottom:1px solid var(--line)}.phase43-bom-live .table-wrap{max-height:340px;overflow:auto}.phase43-bom-live table{min-width:760px}
@media(max-width:1000px){.import-layout{grid-template-columns:1fr!important}.phase43-inline-master-wrap{grid-template-columns:1fr}.phase43-inline-master-add{justify-self:start}}

.price-list-controls{display:grid!important;grid-template-columns:minmax(170px,.7fr) minmax(260px,1.4fr) auto!important;gap:12px!important;align-items:end!important}.price-list-controls label{margin:0!important}.price-list-controls input{width:100%!important}.table-card .filter-grid{align-items:end}.table-card table input[type="number"]{min-width:120px}@media(max-width:900px){.price-list-controls{grid-template-columns:1fr!important}}

/* Phase 43.3 full-master voucher popup */
.phase43-full-master-dialog{width:min(1180px,96vw);height:min(850px,94vh);max-width:none;max-height:none;padding:0;border:0;border-radius:14px;overflow:hidden}.phase43-full-master-dialog::backdrop{background:rgba(15,23,42,.58)}.phase43-full-master-card{height:100%;display:grid;grid-template-rows:auto 1fr;background:#fff}.phase43-full-master-card>.panel-header{padding:12px 16px;border-bottom:1px solid #e5e7eb;margin:0}.phase43-full-master-card iframe{width:100%;height:100%;border:0;background:#f8fafc}.p43fm-x{border:0;background:#eef2f7;border-radius:8px;font-size:24px;line-height:1;padding:4px 10px;cursor:pointer}.phase43-inline-master-wrap{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center}.phase43-inline-master-add{white-space:nowrap;border:1px solid #cbd5e1;background:#fff;border-radius:7px;padding:7px 9px;font-size:12px;font-weight:700;cursor:pointer}


/* Phase 43.4 - Item Bulk Edit alignment and opening-stock controls */
.phase434-bulk-wrap{overflow:auto;max-width:100%}
.bulk-edit-table.phase434-item{table-layout:fixed;min-width:1760px;width:100%}
.bulk-edit-table.phase434-supplier{table-layout:fixed;min-width:1120px;width:100%}
.bulk-edit-table.phase434-item th,.bulk-edit-table.phase434-item td,.bulk-edit-table.phase434-supplier th,.bulk-edit-table.phase434-supplier td{vertical-align:middle;box-sizing:border-box}
.bulk-edit-table.phase434-item th,.bulk-edit-table.phase434-supplier th{white-space:normal;line-height:1.15;text-align:left}
.bulk-edit-table.phase434-item th.center,.bulk-edit-table.phase434-item td.center,.bulk-edit-table.phase434-supplier th.center,.bulk-edit-table.phase434-supplier td.center{text-align:center}
.bulk-edit-table.phase434-item input[type=number],.bulk-edit-table.phase434-supplier input[type=number]{width:100%;min-width:0;box-sizing:border-box}
.bulk-edit-table.phase434-item .c-select,.bulk-edit-table.phase434-supplier .c-select{width:48px}
.bulk-edit-table.phase434-item .c-item{width:360px}.bulk-edit-table.phase434-supplier .c-item{width:430px}
.bulk-edit-table.phase434-item .c-price{width:150px}.bulk-edit-table.phase434-item .c-gst{width:105px}.bulk-edit-table.phase434-item .c-openqty{width:145px}.bulk-edit-table.phase434-item .c-openrate{width:145px}.bulk-edit-table.phase434-item .c-openvalue{width:150px}.bulk-edit-table.phase434-item .c-stock{width:135px}
.bulk-edit-table.phase434-supplier .c-list{width:220px}.bulk-edit-table.phase434-supplier .c-disc{width:180px}.bulk-edit-table.phase434-supplier .c-net{width:210px}
.bulk-edit-table.phase434-item td:first-child,.bulk-edit-table.phase434-item th:first-child,.bulk-edit-table.phase434-supplier td:first-child,.bulk-edit-table.phase434-supplier th:first-child{position:static}
.bulk-edit-table .item-cell strong{display:block}.bulk-edit-table .item-cell span{display:block;margin-top:3px;font-size:12px;white-space:normal}
.bulk-edit-table .opening-value,.bulk-edit-table .net-preview{font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap}


/* Phase 43.4.1 - deterministic bulk table alignment */
.phase434-tabs{display:flex!important;gap:6px!important;align-items:center!important;flex-wrap:wrap!important}
.phase434-bulk-wrap{overflow-x:auto!important;overflow-y:visible!important;width:100%!important}
.bulk-edit-table.phase434-item,.bulk-edit-table.phase434-supplier{border-collapse:collapse!important;table-layout:fixed!important;width:max-content!important;max-width:none!important}
.bulk-edit-table.phase434-item{min-width:1740px!important}
.bulk-edit-table.phase434-supplier{min-width:1120px!important}
.bulk-edit-table.phase434-item th,.bulk-edit-table.phase434-item td,.bulk-edit-table.phase434-supplier th,.bulk-edit-table.phase434-supplier td{padding:8px 10px!important;box-sizing:border-box!important;text-align:left!important;vertical-align:middle!important;overflow:visible!important}
.bulk-edit-table.phase434-item th.center,.bulk-edit-table.phase434-item td.center,.bulk-edit-table.phase434-supplier th.center,.bulk-edit-table.phase434-supplier td.center{text-align:center!important}
.bulk-edit-table.phase434-item input[type=number],.bulk-edit-table.phase434-supplier input[type=number]{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;margin:0!important;box-sizing:border-box!important}
.bulk-edit-table.phase434-item .item-cell,.bulk-edit-table.phase434-supplier .item-cell{white-space:normal!important;line-height:1.25!important}
.bulk-edit-table.phase434-item .item-cell strong,.bulk-edit-table.phase434-supplier .item-cell strong{display:block!important}
.bulk-edit-table.phase434-item .item-cell span,.bulk-edit-table.phase434-supplier .item-cell span{display:block!important;margin-top:2px!important}
.bulk-edit-table.phase434-item col.c-select{width:54px!important}.bulk-edit-table.phase434-item col.c-item{width:350px!important}.bulk-edit-table.phase434-item col.c-price{width:145px!important}.bulk-edit-table.phase434-item col.c-gst{width:105px!important}.bulk-edit-table.phase434-item col.c-openqty{width:140px!important}.bulk-edit-table.phase434-item col.c-openrate{width:140px!important}.bulk-edit-table.phase434-item col.c-openvalue{width:145px!important}.bulk-edit-table.phase434-item col.c-stock{width:135px!important}
.bulk-edit-table.phase434-supplier col.c-select{width:54px!important}.bulk-edit-table.phase434-supplier col.c-item{width:430px!important}.bulk-edit-table.phase434-supplier col.c-list{width:220px!important}.bulk-edit-table.phase434-supplier col.c-disc{width:180px!important}.bulk-edit-table.phase434-supplier col.c-net{width:220px!important}


/* Phase 45 final-stage UI governance */
.feature-control-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:10px}.feature-switch{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border:1px solid var(--border,#d9e0e7);border-radius:12px;background:#fff;min-width:0}.feature-switch span{display:grid;gap:3px;min-width:0}.feature-switch small{color:#667085}.feature-switch input{width:20px;height:20px;flex:0 0 auto}.smart-attention-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}.smart-attention,.smart-clear{display:grid;gap:6px;padding:15px;border:1px solid var(--border,#d9e0e7);border-radius:14px;text-decoration:none;color:inherit;background:#fff;min-width:0}.smart-attention strong{font-size:26px;line-height:1}.smart-attention small,.smart-clear small{color:#667085}.form-grid>*{min-width:0}.form-grid input,.form-grid select,.form-grid textarea{max-width:100%;box-sizing:border-box}.table-wrap{max-width:100%;overflow:auto}.table-wrap table{width:100%}.nav-dropdown{max-width:min(92vw,420px)}
@media(max-width:700px){.feature-control-grid,.smart-attention-grid{grid-template-columns:1fr}.page-actions{align-items:flex-start}.form-grid{grid-template-columns:1fr!important}}
/* Phase 45.0.5 visible build marker */
.erp-build-mark{display:inline-flex;align-items:center;padding:1px 6px;border:1px solid currentColor;border-radius:999px;font-size:9px;font-weight:800;letter-spacing:.04em;opacity:.82;vertical-align:middle}

/* BUILD 45.0.9 - Smart Business Dashboard + standard ERP visual system */
.smart45-head{display:flex;justify-content:space-between;gap:22px;align-items:flex-end;padding:18px 20px;margin-bottom:14px;border:1px solid #d7e1ec;border-radius:16px;background:linear-gradient(135deg,#f8fbff 0%,#eef7f8 55%,#f7fafc 100%)}
.smart45-head small{font-size:10px;letter-spacing:.12em;font-weight:900;color:#37637a}.smart45-head h1{margin:3px 0 4px;font-size:25px}.smart45-head p{margin:0;color:#607184}.smart45-head-meta{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.smart45-head-meta span{border:1px solid #d7e1ec;border-radius:999px;background:#fff;padding:6px 9px;font-size:10px;font-weight:800;color:#526476}.smart45-live i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#16a66a;margin-right:5px}
.smart45-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:14px}.smart45-kpi{position:relative;display:grid;gap:5px;min-height:104px;padding:14px 15px;border:1px solid #dfe6ee;border-top:3px solid var(--kpi,#60758a);border-radius:14px;background:#fff;text-decoration:none;color:#172b3d;overflow:hidden}.smart45-kpi:after{content:"";position:absolute;right:-28px;top:-32px;width:90px;height:90px;border-radius:50%;background:color-mix(in srgb,var(--kpi,#60758a) 8%,transparent)}.smart45-kpi span{font-size:11px;font-weight:800;color:#536779}.smart45-kpi strong{font-size:23px;line-height:1.1;letter-spacing:-.02em;overflow-wrap:anywhere}.smart45-kpi small{color:#708193;font-size:10px}.tone-sales{--kpi:#0f86b5}.tone-purchase{--kpi:#6556c8}.tone-receivable{--kpi:#07966a}.tone-payable{--kpi:#d47a19}.tone-orders{--kpi:#2d6cdf}.tone-po{--kpi:#7550a9}.tone-stock{--kpi:#c44c4c}.tone-production{--kpi:#267e8b}
.smart45-main-grid,.smart45-chart-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(320px,.75fr);gap:14px;margin-bottom:14px}.smart45-chart-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.smart45-attention-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:9px}.smart45-attn{display:grid;gap:5px;border:1px solid #dfe6ee;border-left:4px solid #5c7185;border-radius:10px;padding:11px 12px;text-decoration:none;color:#24384a;background:#fff}.smart45-attn.warning{border-left-color:#d98a21}.smart45-attn.danger{border-left-color:#c94b4b}.smart45-attn.finance{border-left-color:#07966a}.smart45-attn.action{border-left-color:#2d6cdf}.smart45-attn span{font-size:11px;font-weight:700}.smart45-attn strong{font-size:20px}.smart45-attn small{color:#718295}.smart45-empty{padding:16px;border:1px dashed #cdd8e4;border-radius:10px;color:#738397;background:#fbfcfe}.smart45-clear{color:#287259}
.smart45-work-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}.smart45-work-grid a{display:grid;gap:4px;border:1px solid #dfe6ee;border-radius:11px;padding:11px;text-decoration:none;color:#263b4e;background:#fbfcfe}.smart45-work-grid span{font-size:10px;font-weight:800;color:#65788a}.smart45-work-grid strong{font-size:21px}
.smart45-module-flow{display:grid;grid-template-columns:repeat(7,minmax(145px,1fr));gap:8px;overflow:auto;padding-bottom:3px}.smart45-module{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;min-width:155px;border:1px solid #dce5ee;border-radius:12px;padding:11px;background:#fff;text-decoration:none;color:#253a4c}.smart45-module>b{display:grid;place-items:center;width:26px;height:26px;border-radius:8px;background:#edf3f8;color:#426279;font-size:10px}.smart45-module span{display:grid;gap:3px;min-width:0}.smart45-module strong{font-size:12px}.smart45-module small{font-size:9px;color:#708193;line-height:1.25}.smart45-module em{font-style:normal;color:#7990a2}.smart45-module:hover{border-color:#9fb5c7;background:#f8fbfd}
.smart45-chart{min-height:205px;display:flex;flex-direction:column;justify-content:flex-end}.smart45-legend{display:flex;gap:14px;margin-bottom:8px;font-size:10px;color:#667789}.smart45-legend span{display:flex;align-items:center;gap:5px}.smart45-legend i{width:8px;height:8px;border-radius:2px}.smart45-legend .sales,.smart45-col-bars .sales{background:#1687ad}.smart45-legend .purchase,.smart45-col-bars .purchase{background:#7062bd}.smart45-columns{height:170px;display:grid;grid-template-columns:repeat(6,1fr);gap:10px;align-items:end;border-bottom:1px solid #dce4ec;padding:0 8px}.smart45-col{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px}.smart45-col-bars{height:150px;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:4px}.smart45-col-bars i{display:block;width:min(18px,35%);border-radius:5px 5px 1px 1px;min-height:2px}.smart45-col>b{font-size:9px;color:#697b8e}
.smart45-bars{display:grid;gap:10px}.smart45-bar-row{display:grid;grid-template-columns:22px minmax(0,1fr) auto;gap:8px;align-items:center}.smart45-bar-row>b{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#edf3f8;font-size:9px;color:#526a7d}.smart45-bar-row>div{min-width:0}.smart45-bar-row span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;font-weight:700;margin-bottom:4px}.smart45-bar-row i{display:block;height:6px;border-radius:99px;background:#eef2f6;overflow:hidden}.smart45-bar-row i em{display:block;height:100%;border-radius:inherit;background:#3c7597}.smart45-bar-row>strong{font-size:10px;white-space:nowrap}
.smart45-finance-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.smart45-finance-grid a{display:grid;gap:6px;padding:15px;border:1px solid #dfe6ee;border-radius:12px;text-decoration:none;color:#263a4d;background:#fbfcfe}.smart45-finance-grid span{font-size:11px;font-weight:800}.smart45-finance-grid strong{font-size:18px}.smart45-finance-grid small{color:#708193}.smart45-footer-note{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:3px 0 12px;padding:9px 11px;border-top:1px solid #dfe6ee;color:#6d7e8f;font-size:9px}.smart45-footer-note span:first-child{font-weight:900;color:#40586a}
@media(max-width:1180px){.smart45-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.smart45-module-flow{grid-template-columns:repeat(4,minmax(160px,1fr))}}
@media(max-width:800px){.smart45-head{align-items:flex-start;flex-direction:column}.smart45-main-grid,.smart45-chart-grid{grid-template-columns:1fr}.smart45-kpis{grid-template-columns:1fr 1fr}.smart45-module-flow{grid-template-columns:1fr 1fr}.smart45-head-meta{justify-content:flex-start}}
@media(max-width:520px){.smart45-kpis,.smart45-work-grid,.smart45-module-flow,.smart45-finance-grid{grid-template-columns:1fr}.smart45-kpi{min-height:88px}.smart45-kpi strong{font-size:19px}}

/* Standard ERP print sheet - BUILD 45.0.9 */
@media print{
  html,body{background:#fff!important;color:#111!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .smart45-head,.smart45-kpis,.smart45-main-grid,.smart45-chart-grid,.smart45-modules,.smart45-footer-note{display:none!important}
  table{border-collapse:collapse!important;width:100%!important}
  th{background:#eaf1f6!important;color:#172b3d!important;font-weight:800!important;border:1px solid #b9c8d5!important}
  td{border:1px solid #ccd6df!important}
  .document-form-card,.print-sheet,.card{box-shadow:none!important}
}

.bulk-pager{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:12px 0;padding:10px 14px}.bulk-pager .action-row{margin:0}@media(max-width:700px){.bulk-pager{align-items:flex-start;flex-direction:column}}

/* BUILD 45.1.2 International Trade */
.trade-cost-note{padding:10px 12px;border-left:3px solid var(--primary);background:#f8fbff}.detail-grid>div{min-width:0}

/* BUILD 45.1.8 voucher quick-master cleanup */
.phase43-inline-master-wrap{display:grid!important;grid-template-columns:minmax(0,1fr) 34px!important;gap:5px!important;align-items:center!important;width:100%!important}
.phase43-inline-master-wrap>.item-combobox-line,.phase43-inline-master-wrap>select{min-width:0!important;width:100%!important}
.phase43-inline-master-add.phase43-master-plus{width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;border:1px solid #cbd5e1!important;border-radius:7px!important;background:#fff!important;color:#0f4c81!important;font-size:20px!important;font-weight:800!important;line-height:1!important;white-space:nowrap!important}
.phase43-inline-master-add.phase43-master-plus:hover{background:#eff6ff!important;border-color:#93c5fd!important}


/* BUILD 45.1.10 - compact voucher master create button */
.phase43-inline-master-wrap{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 34px!important;
  gap:5px!important;
  align-items:start!important;
  width:100%!important;
}
.phase43-inline-master-wrap>.phase43-inline-master-add,
.phase43-inline-master-wrap>.phase43-master-plus{
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
  min-height:34px!important;
  padding:0!important;
  margin:0!important;
  justify-self:end!important;
  align-self:start!important;
  font-size:17px!important;
  line-height:1!important;
}
@media(max-width:1000px){
  .phase43-inline-master-wrap{
    grid-template-columns:minmax(0,1fr) 34px!important;
  }
  .phase43-inline-master-add{
    justify-self:end!important;
  }
}


/* BUILD 45.1.12 - single-line voucher item entry */
.content .po-lines-wrap{overflow-x:auto!important;overflow-y:visible!important;max-height:none!important}
.content .po-lines{min-width:1180px!important;table-layout:fixed!important}
.content .po-lines th:nth-child(1){width:34px!important}
.content .po-lines th:nth-child(2){width:360px!important}
.content .po-lines th:nth-child(3){width:190px!important}
.content .po-lines th:nth-child(4){width:82px!important}
.content .po-lines th:nth-child(5){width:95px!important}
.content .po-lines th:nth-child(6){width:95px!important}
.content .po-lines th:nth-child(7){width:95px!important}
.content .po-lines th:nth-child(8){width:110px!important}
.content .po-lines th:nth-child(9){width:110px!important}
.content .po-lines th:nth-child(10){width:45px!important}
.content .po-lines td{padding:7px 6px!important;vertical-align:middle!important}
.content .po-lines td input,.content .po-lines td select{margin:0!important}
.content .po-lines .smart-item-line.phase4512-item-master-line{display:grid!important;grid-template-columns:minmax(0,1fr) 34px!important;gap:5px!important;align-items:center!important;min-width:0!important;width:100%!important}
.content .po-lines .smart-item-line.phase4512-item-master-line>.item-combobox{min-width:0!important;width:100%!important}
.content .po-lines .smart-item-line.phase4512-item-master-line>.phase43-master-plus{width:34px!important;height:34px!important;min-width:34px!important;padding:0!important;margin:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}
.content .po-lines .item-rate-preview{display:none!important}
.content .po-lines .item-inline-add{display:none!important}

/* BUILD 45.2.22 - ERP process architecture + overlap/alignment normalization */
.sidebar{min-width:0}
.nav-list{flex:1 1 auto;min-width:0;max-width:100%;overflow-x:auto;overflow-y:visible;scrollbar-width:thin;padding:1px 0 3px}
.nav-list>.nav-home,.nav-list>.nav-group{flex:0 0 auto}
.sidebar-status{flex:0 0 auto}

.topbar{min-width:0}
.topbar-title{flex:0 1 270px;min-width:150px;overflow:hidden}
.topbar-title h1,.topbar-title .eyebrow{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar-global-search{flex:1 1 360px;width:auto!important;max-width:720px;min-width:240px;margin-left:0!important}
.user-menu{flex:0 0 auto;min-width:0}

.erp-process-flow{display:flex;align-items:center;gap:5px;max-width:100%;margin:8px 16px 0;padding:6px 8px;border:1px solid var(--line);border-radius:9px;background:#fff;box-shadow:0 4px 12px rgba(15,23,42,.04);overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.erp-process-flow a{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:4px 9px;border:1px solid #dbe4eb;border-radius:7px;background:#f8fafc;color:#334155;text-decoration:none;font-size:10px;font-weight:850;white-space:nowrap}
.erp-process-flow a b{display:grid;place-items:center;min-width:20px;height:20px;padding:0 4px;border-radius:5px;background:#e8eef4;color:#526779;font-size:8px}
.erp-process-flow a.active{border-color:var(--primary);background:var(--primary);color:#fff;box-shadow:0 4px 10px color-mix(in srgb,var(--primary) 22%,transparent)}
.erp-process-flow a.active b{background:rgba(255,255,255,.18);color:#fff}
.erp-process-flow i{flex:0 0 auto;color:#94a3b8;font-style:normal;font-size:12px}

/* Search/filter rows must never overlap adjacent controls. */
.search-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;max-width:100%}
.search-bar>*{min-width:0}
.search-bar input{flex:1 1 260px;width:auto;max-width:none}
.filter-grid,.party-filters,.item-filters{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;gap:8px!important;align-items:end!important;max-width:100%}
.filter-grid>*,.party-filters>*,.item-filters>*{min-width:0!important;max-width:100%}
.filter-grid .button,.party-filters .button,.item-filters .button{width:auto;white-space:nowrap}

/* Old sticky module-tab generations were stacking over the topbar/search. Keep one aligned row, horizontally scrollable. */
.module-tabs,.phase38-module-tabs,.phase39-flow-tabs,.phase40-flow-tabs,.phase434-tabs{position:relative!important;top:auto!important;z-index:10!important;display:flex!important;align-items:center!important;gap:5px!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;flex-wrap:nowrap!important;scrollbar-width:thin}
.module-tabs a,.phase38-module-tabs a,.phase39-flow-tabs a,.phase40-flow-tabs a,.phase434-tabs a{flex:0 0 auto!important;min-width:auto!important;white-space:nowrap!important}

/* Searchable select/dropdown must stay inside the viewport and above tables without covering neighboring fields permanently. */
.universal-select,.item-combobox{min-width:0!important;max-width:100%!important}
.universal-select-menu,.item-combobox-menu{left:0!important;right:auto!important;width:max(100%,min(420px,calc(100vw - 40px)))!important;min-width:0!important;max-width:calc(100vw - 40px)!important;box-sizing:border-box!important}
.form-grid>label,.document-form-card label{min-width:0}
.form-grid input,.form-grid select,.form-grid textarea,.document-form-card input,.document-form-card select,.document-form-card textarea{width:100%;max-width:100%;min-width:0;box-sizing:border-box}

.mrp-attention-row td{background:#fffaf0}
.mrp-metrics .metric strong{font-size:21px}
.negative-text{color:#b42318!important}.positive-text{color:#087a55!important}

@media(max-width:1450px){
  .topbar-title{flex-basis:220px}
  .topbar-global-search{flex-basis:300px;min-width:220px}
  .user-dropdown>summary small{display:none}
}
@media(max-width:1200px){
  .nav-list{overflow:visible;padding:0}
  .topbar{flex-wrap:wrap!important}
  .topbar-title{flex:1 1 240px}
  .topbar-global-search{order:4;flex:1 0 100%;max-width:none!important;width:100%!important;margin:3px 0 0!important}
  .erp-process-flow{margin:6px 10px 0}
  .module-tabs,.phase38-module-tabs,.phase39-flow-tabs,.phase40-flow-tabs,.phase434-tabs{position:relative!important;top:auto!important}
}
@media(max-width:700px){
  .filter-grid,.party-filters,.item-filters{grid-template-columns:1fr!important}
  .filter-grid .button,.party-filters .button,.item-filters .button{width:100%}
  .erp-process-flow{margin:5px 8px 0;padding:5px}
  .erp-process-flow a{padding:4px 7px}
}
/* BUILD 45.2.22 - process dashboard and list-table finishing */
.smart45-module-flow{display:flex!important;grid-template-columns:none!important;gap:8px!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:thin!important}
.smart45-module{flex:0 0 190px!important;min-width:190px!important}
.filter-grid>label:first-child{grid-column:span 2}
.table-actions{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important;white-space:normal!important}
.table-actions>a,.table-actions>button{white-space:nowrap}
.table-wrap th:last-child,.table-wrap td:last-child{padding-right:12px}
@media(max-width:900px){.filter-grid>label:first-child{grid-column:span 1}}

/* BUILD 45.2.23 - module navigation opens submenu only; visible right-side caret */
.nav-group > summary::after{
  content:"⌄"!important;
  display:inline-grid!important;
  place-items:center!important;
  flex:0 0 15px!important;
  width:15px!important;
  height:15px!important;
  margin-left:auto!important;
  border:1px solid rgba(143,217,233,.42)!important;
  border-radius:4px!important;
  color:#b8eef5!important;
  font-size:10px!important;
  font-weight:900!important;
  line-height:1!important;
  transform:none!important;
  transition:transform .14s ease,background .14s ease,border-color .14s ease!important;
}
.nav-group[open] > summary::after{
  transform:rotate(180deg)!important;
  background:rgba(255,255,255,.10)!important;
  border-color:rgba(255,255,255,.38)!important;
}
.nav-group > summary{justify-content:flex-start!important}
.nav-group[open]{z-index:220!important}
.nav-group[open] > .nav-dropdown{z-index:230!important}

/* Desktop module bar must not clip dropdown menus. 45.2.22 horizontal scrolling
   could turn the nav row into an overflow clipping container. Wrap compactly instead. */
@media(min-width:1201px){
  .sidebar{overflow:visible!important;align-items:flex-start!important;min-height:58px!important}
  .sidebar-brand{flex:0 0 145px!important}
  .nav-list{
    display:flex!important;
    flex:1 1 auto!important;
    flex-wrap:wrap!important;
    align-items:flex-start!important;
    align-content:flex-start!important;
    gap:3px!important;
    min-width:0!important;
    max-width:none!important;
    overflow:visible!important;
    padding:0!important;
  }
  .nav-list>.nav-home,.nav-list>.nav-group{flex:0 0 auto!important}
  .nav-home,.nav-group>summary{min-height:36px!important;padding:0 8px!important;gap:5px!important;font-size:11px!important}
  .nav-dropdown,.nav-dropdown-end{
    top:calc(100% + 6px)!important;
    max-height:calc(100vh - 86px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  .nav-dropdown-end{right:0!important;left:auto!important}
  .sidebar-status{align-self:center!important;flex:0 0 auto!important}
}

/* Side-menu mode: keep the caret at the far right and reveal submenu below. */
@media(max-width:1200px){
  .nav-group>summary{display:flex!important;width:100%!important}
  .nav-group>summary::after{margin-left:auto!important}
  .nav-group[open]>.nav-dropdown{margin-top:3px!important}
}


/* BUILD 45.2.29 - running document number visible on every new entry form */
.entry-running-number{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 10px;padding:8px 12px;border:1px solid var(--border,#dbe3ea);border-radius:8px;background:#fff;font-size:12px}
.entry-running-number>span{font-size:10px;font-weight:900;letter-spacing:.08em;color:#607086}
.entry-running-number>strong{padding:4px 8px;border-radius:6px;background:#f3f6f9;color:#17263a;font-size:12px}
.entry-running-number>small{margin-left:auto;color:#6b7787}
@media(max-width:720px){.entry-running-number>small{width:100%;margin-left:0}.entry-running-number{gap:6px}}

/* BUILD 45.2.30 - complete user permission overview */
.permission-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:10px;margin-top:8px}
.permission-summary-grid>div{border:1px solid var(--line,#d9e5ec);border-radius:10px;padding:10px 12px;background:var(--panel-soft,#f7fbfd);min-width:0}
.permission-summary-grid span{display:block;font-size:11px;line-height:1.25;opacity:.72;text-transform:uppercase;letter-spacing:.04em}
.permission-summary-grid strong{display:block;font-size:20px;line-height:1.25;margin-top:3px}
.permission-overview-card .panel-header{align-items:flex-start}
.permission-matrix-card .panel-header .action-row{flex-wrap:wrap}
@media(max-width:900px){.permission-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.permission-summary-grid{grid-template-columns:1fr}}


/* BUILD 45.2.31 - register alignment, compact GRN picker, item identity */
.table-card .table-wrap>table{min-width:920px}
.table-card .table-wrap>table th,.table-card .table-wrap>table td{vertical-align:middle}
.table-card .table-wrap>table th:last-child,.table-card .table-wrap>table td:last-child{width:92px;min-width:92px;white-space:nowrap}
.table-card .table-wrap>table th:nth-last-child(2),.table-card .table-wrap>table td:nth-last-child(2){width:116px;min-width:116px;white-space:nowrap}
.table-card .table-wrap>table .table-actions{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:11px!important;white-space:nowrap!important}
.erp-item-cell{min-width:210px;white-space:normal!important;line-height:1.3}
.erp-item-cell>strong,.erp-item-cell>small{display:block}
.erp-item-cell>small{margin-top:2px;color:var(--muted);font-size:10px;white-space:normal}
.pending-po-filters{grid-template-columns:minmax(300px,1.7fr) minmax(260px,1fr) minmax(260px,1fr) 120px auto auto!important;align-items:end!important}
.pending-po-filters>label,.pending-po-filters>.phase43-inline-master-wrap{min-width:0}
.pending-po-filters .check-label{height:40px;align-self:end;margin:0}
.grn-combined-form{grid-template-columns:minmax(0,1fr) auto!important;align-items:end!important}
.approved-po-picker{position:relative;min-width:0}
.approved-po-picker>label{display:block;margin-bottom:6px;font-weight:750}
.approved-po-picker-toggle{width:100%;min-height:40px;display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--text);padding:8px 11px;font:inherit;cursor:pointer;text-align:left}
.approved-po-picker-toggle:hover{border-color:#93b6d4}
.approved-po-picker-menu{position:absolute;z-index:90;left:0;right:0;top:64px;max-height:360px;overflow:hidden;border:1px solid #cbd5e1;border-radius:10px;background:#fff;box-shadow:0 18px 45px rgba(15,23,42,.18);padding:10px}
.approved-po-search{width:100%;margin-bottom:8px}
.approved-po-options{max-height:285px;overflow:auto;display:grid;gap:4px}
.approved-po-option{display:grid!important;grid-template-columns:20px minmax(0,1fr);gap:9px;align-items:start;padding:8px 9px;border-radius:7px;cursor:pointer}
.approved-po-option:hover{background:#f3f7fb}
.approved-po-option input{width:16px;height:16px;margin:2px 0 0}
.approved-po-option strong,.approved-po-option small{display:block}.approved-po-option small{color:var(--muted);margin-top:2px}
.approved-po-option:has(input:disabled){opacity:.38}
.quick-entry-menu summary kbd{margin-left:5px;padding:1px 5px;border:1px solid #cbd5e1;border-bottom-width:2px;border-radius:4px;background:#fff;font:700 9px/1.4 inherit;color:#526577}
.bom-compare-dialog{width:min(980px,94vw);max-width:none;border:0;border-radius:14px;padding:0;box-shadow:0 24px 70px rgba(15,23,42,.3)}
.bom-compare-dialog::backdrop{background:rgba(15,23,42,.52)}
.bom-compare-card{padding:18px;background:#fff}.bom-compare-head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:12px}.bom-compare-head h2{margin:0}.bom-compare-summary{display:grid;grid-template-columns:1fr auto 1fr;gap:12px;align-items:center;margin-bottom:12px}.bom-compare-summary>div{border:1px solid var(--line);border-radius:9px;padding:10px}.bom-compare-summary i{font-style:normal;color:var(--muted)}.bom-diff-table{max-height:380px;overflow:auto}.bom-diff-table table{min-width:760px}.bom-diff-added{background:#f0fdf4}.bom-diff-removed{background:#fff1f2}.bom-diff-changed{background:#fff8e6}.bom-compare-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:14px}
.service-invoice-note{border-left:4px solid var(--primary);background:#f5fbff}.service-invoice-lines{min-width:980px}.service-invoice-lines .erp-item-cell{min-width:300px}
@media(max-width:1180px){.pending-po-filters{grid-template-columns:1fr 1fr 1fr!important}.pending-po-filters .check-label{align-self:end}.pending-po-filters .button{justify-self:start}}
@media(max-width:760px){.pending-po-filters,.grn-combined-form{grid-template-columns:1fr!important}.approved-po-picker-menu{position:fixed;left:12px;right:12px;top:16vh;max-height:68vh}.table-card .table-wrap>table{min-width:860px}}

/* BUILD 45.2.31 - page-specific register column geometry */
.grn-register-table{table-layout:fixed;min-width:1280px!important}.grn-register-table th:nth-child(1){width:130px}.grn-register-table th:nth-child(2){width:88px}.grn-register-table th:nth-child(3){width:230px}.grn-register-table th:nth-child(4){width:360px}.grn-register-table th:nth-child(5){width:170px}.grn-register-table th:nth-child(6),.grn-register-table th:nth-child(7){width:85px}.grn-register-table td:nth-child(3),.grn-register-table td:nth-child(4),.grn-register-table td:nth-child(5){white-space:normal}
.purchase-order-register-table{table-layout:fixed;min-width:1320px!important}.purchase-order-register-table th:nth-child(1){width:150px}.purchase-order-register-table th:nth-child(2){width:100px}.purchase-order-register-table th:nth-child(3){width:360px}.purchase-order-register-table th:nth-child(4){width:110px}.purchase-order-register-table th:nth-child(5),.purchase-order-register-table th:nth-child(6),.purchase-order-register-table th:nth-child(7){width:90px}.purchase-order-register-table th:nth-child(8){width:145px}.purchase-order-register-table td:nth-child(3){white-space:normal}
.production-register-table{table-layout:fixed;min-width:1775px!important}.production-register-table th:nth-child(1){width:150px}.production-register-table th:nth-child(2){width:350px}.production-register-table th:nth-child(3){width:300px}.production-register-table th:nth-child(4){width:80px}.production-register-table th:nth-child(5){width:150px}.production-register-table th:nth-child(6){width:115px}.production-register-table th:nth-child(7){width:430px}.production-register-table th:nth-child(8){width:120px}.production-register-table th:nth-child(9){width:80px}.production-register-table td:nth-child(2),.production-register-table td:nth-child(3),.production-register-table td:nth-child(7){white-space:normal}.production-process-layout{display:flex;align-items:flex-start;gap:10px}.production-process-count{flex:0 0 auto;min-width:38px;padding-top:3px}.production-process-steps{display:flex;flex:1 1 auto;flex-wrap:wrap;gap:5px 9px;align-items:center}.production-process-step{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}.production-process-step-name{font-size:10px;font-weight:750;color:var(--text)}.production-process-step .status-badge{min-height:18px;padding:0 5px;font-size:8px}
.quotation-register-table{table-layout:fixed;min-width:1220px!important}.quotation-register-table th:nth-child(1){width:150px}.quotation-register-table th:nth-child(2){width:125px}.quotation-register-table th:nth-child(3){width:300px}.quotation-register-table th:nth-child(4){width:310px}.quotation-register-table th:nth-child(5){width:120px}.quotation-register-table th:nth-child(6){width:140px}.quotation-register-table td:nth-child(3),.quotation-register-table td:nth-child(4){white-space:normal}
.sales-order-register-table{table-layout:fixed;min-width:1420px!important}.sales-order-register-table th:nth-child(1){width:150px}.sales-order-register-table th:nth-child(2){width:130px}.sales-order-register-table th:nth-child(3){width:310px}.sales-order-register-table th:nth-child(4){width:130px}.sales-order-register-table th:nth-child(5),.sales-order-register-table th:nth-child(6){width:95px}.sales-order-register-table th:nth-child(7){width:145px}.sales-order-register-table th:nth-child(8){width:150px}.sales-order-register-table td:nth-child(3){white-space:normal}
.purchase-invoice-register-table{table-layout:fixed;min-width:1480px!important}.purchase-invoice-register-table th:nth-child(1){width:145px}.purchase-invoice-register-table th:nth-child(2){width:150px}.purchase-invoice-register-table th:nth-child(3){width:125px}.purchase-invoice-register-table th:nth-child(4){width:260px}.purchase-invoice-register-table th:nth-child(5){width:310px}.purchase-invoice-register-table th:nth-child(6){width:110px}.purchase-invoice-register-table th:nth-child(7),.purchase-invoice-register-table th:nth-child(8),.purchase-invoice-register-table th:nth-child(9){width:120px}.purchase-invoice-register-table td:nth-child(4),.purchase-invoice-register-table td:nth-child(5){white-space:normal}
.serial-register-table{table-layout:fixed;min-width:1280px!important}.serial-register-table th:nth-child(1){width:180px}.serial-register-table th:nth-child(2){width:330px}.serial-register-table th:nth-child(3){width:120px}.serial-register-table th:nth-child(4){width:300px}.serial-register-table th:nth-child(5){width:180px}.serial-register-table th:nth-child(6){width:150px}.serial-register-table td:nth-child(2),.serial-register-table td:nth-child(4),.serial-register-table td:nth-child(5){white-space:normal}


/* BUILD 45.2.31 - final desktop alignment refinements */
.pending-po-filters>label:first-child{grid-column:auto!important}
.pending-po-filters .button{height:40px;align-self:end}
.grn-combined-form>.button{height:40px;align-self:end;white-space:nowrap}
.approved-po-picker-toggle .approved-po-picker-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.approved-po-picker-menu[hidden]{display:none!important}
@media(max-width:1180px){.pending-po-filters>label:first-child{grid-column:auto!important}}

/* BUILD 45.2.33 - premium color system, dashboard and module navigation */
@media screen {
  :root{
    --erp-blue:#2563eb;
    --erp-indigo:#4f46e5;
    --erp-violet:#7c3aed;
    --erp-cyan:#0891b2;
    --erp-teal:#0f766e;
    --erp-green:#059669;
    --erp-amber:#d97706;
    --erp-orange:#ea580c;
    --erp-rose:#e11d48;
    --erp-slate:#334155;
    --surface-soft:#f8fbff;
    --surface-accent:#f4f8fc;
  }

  body{
    background:
      radial-gradient(circle at 8% -5%,rgba(37,99,235,.08),transparent 24%),
      radial-gradient(circle at 94% 4%,rgba(8,145,178,.07),transparent 26%),
      linear-gradient(180deg,#f7fbff 0%,#f3f7fb 48%,#f7f9fc 100%);
  }

  /* Rich but business-safe top navigation */
  .sidebar{
    background:
      radial-gradient(circle at 10% 0%,rgba(34,211,238,.22),transparent 28%),
      radial-gradient(circle at 74% 120%,rgba(124,58,237,.22),transparent 35%),
      linear-gradient(105deg,#082f70 0%,#123f8f 38%,#0b5b83 72%,#12336f 100%)!important;
    border-bottom:1px solid rgba(255,255,255,.12);
    box-shadow:0 8px 24px rgba(15,45,95,.22)!important;
  }
  .sidebar-brand{
    border:1px solid rgba(255,255,255,.72);
    background:linear-gradient(145deg,#fff,#f0f8ff)!important;
    box-shadow:0 8px 20px rgba(0,18,57,.22)!important;
  }
  .nav-home,.nav-group>summary{
    --module-tone:#38bdf8;
    --module-tone-2:#0ea5e9;
    border-color:rgba(255,255,255,.16)!important;
    background:rgba(255,255,255,.055)!important;
    color:#eef8ff!important;
    backdrop-filter:blur(8px);
  }
  .nav-dashboard{--module-tone:#38bdf8;--module-tone-2:#2563eb}
  .nav-master{--module-tone:#22c55e;--module-tone-2:#059669}
  .nav-sales{--module-tone:#2dd4bf;--module-tone-2:#0891b2}
  .nav-production{--module-tone:#a78bfa;--module-tone-2:#7c3aed}
  .nav-procurement{--module-tone:#fb923c;--module-tone-2:#ea580c}
  .nav-inventory{--module-tone:#60a5fa;--module-tone-2:#2563eb}
  .nav-crm{--module-tone:#f472b6;--module-tone-2:#db2777}
  .nav-finance{--module-tone:#34d399;--module-tone-2:#059669}
  .nav-admin{--module-tone:#cbd5e1;--module-tone-2:#64748b}
  .nav-home>span,.nav-group>summary>span{
    width:24px!important;
    height:24px!important;
    display:inline-grid!important;
    place-items:center!important;
    flex:0 0 24px!important;
    border:1px solid color-mix(in srgb,var(--module-tone) 64%,white)!important;
    border-radius:7px!important;
    background:color-mix(in srgb,var(--module-tone) 22%,transparent)!important;
    color:#fff!important;
    font-size:12px!important;
    line-height:1!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
  }
  .nav-home:hover,.nav-group:hover>summary{
    border-color:color-mix(in srgb,var(--module-tone) 60%,white)!important;
    background:color-mix(in srgb,var(--module-tone) 18%,rgba(255,255,255,.07))!important;
    box-shadow:0 7px 16px rgba(0,0,0,.15)!important;
  }
  .nav-home.active,.nav-group.active>summary,.nav-group[open]>summary{
    border-color:color-mix(in srgb,var(--module-tone) 65%,white)!important;
    background:linear-gradient(125deg,var(--module-tone-2),var(--module-tone))!important;
    box-shadow:0 8px 18px color-mix(in srgb,var(--module-tone-2) 34%,transparent)!important;
  }
  .nav-dropdown{
    border-top:3px solid var(--module-tone,#38bdf8)!important;
    border-radius:12px!important;
    background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%)!important;
    box-shadow:0 22px 48px rgba(15,43,78,.22)!important;
  }
  .nav-dropdown a{
    border-left:3px solid transparent;
    transition:background .14s ease,color .14s ease,border-color .14s ease,transform .14s ease;
  }
  .nav-dropdown a:hover,.nav-dropdown a.active{
    border-left-color:var(--module-tone,#38bdf8);
    background:color-mix(in srgb,var(--module-tone,#38bdf8) 9%,white)!important;
    color:color-mix(in srgb,var(--module-tone-2,#2563eb) 80%,#172b3d)!important;
    transform:translateX(2px);
  }
  .nav-dropdown-section>strong{
    color:color-mix(in srgb,var(--module-tone-2,#2563eb) 82%,#334155)!important;
  }
  .sidebar-status{
    border:1px solid rgba(255,255,255,.14);
    border-radius:999px;
    background:rgba(255,255,255,.07);
    padding:5px 8px;
  }

  /* Premium top workbar */
  .topbar{
    background:linear-gradient(105deg,rgba(255,255,255,.98),rgba(246,250,255,.98) 62%,rgba(240,253,250,.96))!important;
    border-top:0!important;
    border-bottom:1px solid #dbe7f0!important;
    box-shadow:0 5px 18px rgba(28,55,88,.07)!important;
  }
  .topbar-title h1{
    color:#18324d;
    text-shadow:0 1px 0 #fff;
  }
  .topbar-title .eyebrow{
    color:#2574a9!important;
  }
  .topbar-global-search{
    border-color:#cbdce8!important;
    background:linear-gradient(180deg,#fff,#f7fbfe)!important;
    box-shadow:0 4px 12px rgba(31,67,104,.05);
  }
  .topbar-global-search:focus-within{
    border-color:#38a7c8!important;
    box-shadow:0 0 0 3px rgba(14,165,199,.12),0 7px 18px rgba(31,67,104,.08)!important;
  }
  .topbar-global-search button{
    background:linear-gradient(135deg,#1f5fa9,#0d91b5)!important;
  }
  .quick-entry-menu>summary{
    background:linear-gradient(135deg,#173f74,#0e7490)!important;
    border-color:#1a6d98!important;
    box-shadow:0 5px 14px rgba(17,76,118,.15)!important;
  }
  .topbar-tools>a{
    background:linear-gradient(180deg,#fff,#eef7fb)!important;
    border-color:#cddfe9!important;
  }
  .topbar-tools>a:hover{
    background:linear-gradient(180deg,#eefaff,#e4f7fa)!important;
    border-color:#5fbfd1!important;
    transform:translateY(-1px);
  }

  /* Common application surfaces */
  .card,.panel,.form-card,.table-card,.document-form-card{
    border-color:#dce7ef!important;
    background:linear-gradient(180deg,#fff 0%,#fdfefe 100%)!important;
    box-shadow:0 8px 22px rgba(28,63,98,.055)!important;
  }
  .panel-header,.document-form-title,.section-heading{
    border-bottom-color:#dce7ef!important;
  }
  .panel-header h2,.document-form-title h2,.section-heading h2{
    color:#183b5c!important;
  }
  .panel-header h2::after,.document-form-title h2::after{
    content:"";
    display:block;
    width:36px;
    height:3px;
    margin-top:5px;
    border-radius:99px;
    background:linear-gradient(90deg,#2563eb,#14b8a6);
  }
  .page-actions{
    border-radius:10px;
  }
  input,select,textarea{
    border-color:#cbdce8!important;
    background:linear-gradient(180deg,#fff,#fcfeff)!important;
    transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;
  }
  input:focus,select:focus,textarea:focus{
    border-color:#0ea5c7!important;
    background:#fff!important;
    box-shadow:0 0 0 3px rgba(14,165,199,.11)!important;
  }
  .button.primary{
    background:linear-gradient(135deg,#245eb7,#0e98b7)!important;
    box-shadow:0 6px 14px rgba(26,92,159,.16)!important;
  }
  .button.primary:hover{
    background:linear-gradient(135deg,#1d4f9d,#087f9d)!important;
    transform:translateY(-1px);
  }
  .button.secondary{
    border-color:#c6d9e5!important;
    background:linear-gradient(180deg,#fff,#edf6fb)!important;
    color:#245887!important;
  }
  .button.secondary:hover{
    border-color:#8bbfd3!important;
    background:#e9f7fb!important;
  }

  /* Tables: clearer headings and row tracking */
  .table-wrap{
    border-color:#dce7ef!important;
    border-radius:10px!important;
    background:#fff;
  }
  .table-wrap table thead th,
  .document-table thead th,
  .po-lines thead th{
    background:linear-gradient(180deg,#f4f8fc,#eaf1f7)!important;
    color:#26445f!important;
    border-bottom-color:#cfdee8!important;
    box-shadow:inset 0 1px 0 #fff;
  }
  .table-wrap table tbody tr:nth-child(even),
  .document-table tbody tr:nth-child(even){
    background:#fcfdff;
  }
  .table-wrap table tbody tr:hover,
  .document-table tbody tr:hover{
    background:linear-gradient(90deg,rgba(37,99,235,.045),rgba(14,165,199,.035))!important;
  }
  .table-wrap table tbody td,.document-table tbody td{
    border-bottom-color:#edf2f6!important;
  }
  .status-badge,.badge{
    box-shadow:inset 0 0 0 1px rgba(15,23,42,.035);
    font-weight:900!important;
  }

  /* Reusable module and metric cards across module dashboards */
  .metric{
    border-color:#dce7ef!important;
    background:linear-gradient(145deg,#fff 0%,color-mix(in srgb,var(--metric-tone,var(--primary)) 4%,#f7fbff) 100%)!important;
    transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
  }
  .metric:hover{
    transform:translateY(-2px);
    border-color:color-mix(in srgb,var(--metric-tone,var(--primary)) 30%,#dce7ef)!important;
    box-shadow:0 10px 22px color-mix(in srgb,var(--metric-tone,var(--primary)) 10%,transparent)!important;
  }
  .module-tile{
    background:linear-gradient(145deg,#fff,color-mix(in srgb,var(--tile-tone,var(--primary)) 5%,#f6f9fc))!important;
    box-shadow:0 4px 12px rgba(28,63,98,.035);
  }
  .module-tile:hover{
    box-shadow:0 10px 22px color-mix(in srgb,var(--tile-tone,var(--accent)) 14%,transparent)!important;
  }
  .module-tabs,.phase38-module-tabs,.phase39-flow-tabs,.phase40-flow-tabs,.phase434-tabs{
    padding:4px!important;
    border:1px solid #dbe7ef!important;
    border-radius:10px!important;
    background:linear-gradient(180deg,#fff,#f4f8fb)!important;
  }
  .module-tabs a,.phase38-module-tabs a,.phase39-flow-tabs a,.phase40-flow-tabs a,.phase434-tabs a{
    border-radius:7px!important;
    transition:.14s ease;
  }
  .module-tabs a:hover,.phase38-module-tabs a:hover,.phase39-flow-tabs a:hover,.phase40-flow-tabs a:hover,.phase434-tabs a:hover{
    background:#eaf6fb!important;
    color:#155a83!important;
  }

  /* Smart dashboard premium color treatment */
  .smart45-head{
    position:relative;
    overflow:hidden;
    border:1px solid #cfe0ec!important;
    background:
      radial-gradient(circle at 88% 15%,rgba(45,212,191,.18),transparent 28%),
      radial-gradient(circle at 72% 110%,rgba(124,58,237,.14),transparent 30%),
      linear-gradient(125deg,#f6fbff 0%,#eef6ff 44%,#effcf8 100%)!important;
    box-shadow:0 10px 26px rgba(34,73,113,.075);
  }
  .smart45-head:before{
    content:"";
    position:absolute;
    left:0;top:0;bottom:0;width:5px;
    background:linear-gradient(180deg,#2563eb,#14b8a6,#7c3aed);
  }
  .smart45-head h1{
    color:#153958!important;
  }
  .smart45-head-meta span{
    border-color:#cfe0ea!important;
    box-shadow:0 3px 9px rgba(31,70,105,.04);
  }
  .smart45-kpi{
    --kpi:#2563eb;
    grid-template-columns:auto 1fr;
    grid-template-areas:"icon label" "icon value" "icon note";
    column-gap:11px;
    border:1px solid color-mix(in srgb,var(--kpi) 18%,#dfe6ee)!important;
    border-top:0!important;
    background:linear-gradient(145deg,#fff 18%,color-mix(in srgb,var(--kpi) 7%,#f9fbfd) 100%)!important;
    box-shadow:0 6px 16px color-mix(in srgb,var(--kpi) 7%,transparent);
    transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
  }
  .smart45-kpi:before{
    content:"";
    position:absolute;left:0;top:0;bottom:0;width:4px;
    background:linear-gradient(180deg,var(--kpi),color-mix(in srgb,var(--kpi) 65%,#fff));
  }
  .smart45-kpi:after{
    width:105px!important;height:105px!important;
    background:color-mix(in srgb,var(--kpi) 9%,transparent)!important;
  }
  .smart45-kpi:hover{
    transform:translateY(-3px);
    border-color:color-mix(in srgb,var(--kpi) 42%,#dfe6ee)!important;
    box-shadow:0 12px 24px color-mix(in srgb,var(--kpi) 14%,transparent)!important;
  }
  .smart45-kpi-icon{
    grid-area:icon;
    align-self:center;
    display:grid;
    place-items:center;
    width:42px;height:42px;
    border-radius:12px;
    background:linear-gradient(145deg,var(--kpi),color-mix(in srgb,var(--kpi) 72%,#0f172a));
    color:#fff;
    font-size:13px;
    font-style:normal;
    font-weight:950;
    box-shadow:0 7px 16px color-mix(in srgb,var(--kpi) 22%,transparent);
  }
  .smart45-kpi>span{grid-area:label}.smart45-kpi>strong{grid-area:value}.smart45-kpi>small{grid-area:note}
  .tone-sales{--kpi:#0e7490!important}.tone-purchase{--kpi:#7c3aed!important}.tone-receivable{--kpi:#059669!important}.tone-payable{--kpi:#d97706!important}.tone-orders{--kpi:#2563eb!important}.tone-po{--kpi:#9333ea!important}.tone-stock{--kpi:#e11d48!important}.tone-production{--kpi:#0f766e!important}

  .smart45-attn,.smart45-work-grid a,.smart45-finance-grid a{
    background:linear-gradient(145deg,#fff,#f8fbfd)!important;
    transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
  }
  .smart45-attn:hover,.smart45-work-grid a:hover,.smart45-finance-grid a:hover{
    transform:translateY(-2px);
    box-shadow:0 8px 18px rgba(34,73,113,.08);
  }

  .smart45-module-flow{
    padding:2px 2px 7px!important;
  }
  .smart45-module{
    --module-card:#2563eb;
    position:relative;
    grid-template-columns:44px minmax(0,1fr) auto auto!important;
    gap:9px!important;
    min-height:86px;
    border:1px solid color-mix(in srgb,var(--module-card) 18%,#dce5ee)!important;
    border-radius:14px!important;
    background:linear-gradient(145deg,#fff,color-mix(in srgb,var(--module-card) 6%,#f7fafc))!important;
    box-shadow:0 5px 14px color-mix(in srgb,var(--module-card) 7%,transparent);
    overflow:hidden;
    transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
  }
  .smart45-module:before{
    content:"";
    position:absolute;left:0;top:0;bottom:0;width:4px;
    background:var(--module-card);
  }
  .smart45-module:hover{
    transform:translateY(-3px);
    border-color:color-mix(in srgb,var(--module-card) 45%,#dce5ee)!important;
    box-shadow:0 12px 24px color-mix(in srgb,var(--module-card) 14%,transparent)!important;
  }
  .smart45-module-icon{
    display:grid;
    place-items:center;
    width:38px;height:38px;
    border-radius:11px;
    background:linear-gradient(145deg,var(--module-card),color-mix(in srgb,var(--module-card) 72%,#0f172a));
    color:#fff;
    font-size:16px;
    font-style:normal;
    font-weight:950;
    box-shadow:0 6px 14px color-mix(in srgb,var(--module-card) 20%,transparent);
  }
  .smart45-module>b{
    width:auto!important;height:auto!important;min-width:22px!important;
    background:color-mix(in srgb,var(--module-card) 9%,#fff)!important;
    color:var(--module-card)!important;
    border:1px solid color-mix(in srgb,var(--module-card) 18%,#e2e8f0);
    border-radius:7px!important;
    padding:4px 5px;
    align-self:start;
  }
  .smart45-module strong{color:#1d3b55!important;font-size:12px!important}.smart45-module small{color:#65798c!important}.smart45-module em{color:var(--module-card)!important;font-size:17px!important}
  .smart45-module.tone-crm{--module-card:#db2777}.smart45-module.tone-sales{--module-card:#0891b2}.smart45-module.tone-mrp{--module-card:#4f46e5}.smart45-module.tone-procurement{--module-card:#ea580c}.smart45-module.tone-production{--module-card:#7c3aed}.smart45-module.tone-inventory{--module-card:#2563eb}.smart45-module.tone-delivery{--module-card:#0f766e}.smart45-module.tone-finance{--module-card:#059669}.smart45-module.tone-service{--module-card:#d97706}

  .smart45-bar-row i em{
    background:linear-gradient(90deg,#2563eb,#14b8a6)!important;
  }
  .smart45-legend .sales,.smart45-col-bars .sales{background:#0891b2!important}
  .smart45-legend .purchase,.smart45-col-bars .purchase{background:#7c3aed!important}

  .entry-running-number{
    border-color:#bfdbfe!important;
    background:linear-gradient(90deg,#eff6ff,#ecfeff)!important;
    box-shadow:0 5px 14px rgba(37,99,235,.06);
  }
}

@media screen and (max-width:800px){
  .smart45-kpi{grid-template-columns:38px 1fr;column-gap:9px}.smart45-kpi-icon{width:36px;height:36px;border-radius:10px}
  .smart45-module{grid-template-columns:38px minmax(0,1fr) auto auto!important}.smart45-module-icon{width:34px;height:34px}
}

/* BUILD 45.2.34 - Customer/Supplier DR-CR defaults and GST state-code dropdown */

/* BUILD 45.2.35 - Balance Sheet opening AR/AP and calculation consistency */

/* BUILD 45.2.36 - All ledger outstanding single-window and dashboard AR/AP breakdown */

/* BUILD 45.2.40 - Simple table header ascending / descending arrows only */
.smart-table-enabled thead th.smart-head-cell{
    position:relative;
    padding-right:34px!important;
    white-space:nowrap;
}
.smart-head-sort-controls{
    position:absolute;
    right:4px;
    top:50%;
    transform:translateY(-50%);
    display:inline-flex;
    flex-direction:column;
    gap:0;
    z-index:2;
}
.smart-head-sort-btn{
    width:14px;
    height:11px;
    min-width:14px;
    padding:0;
    margin:0;
    border:0;
    background:transparent;
    color:#64748b;
    font:900 10px/10px Arial,sans-serif;
    cursor:pointer;
    opacity:.75;
}
.smart-head-sort-btn:hover,.smart-head-sort-btn:focus{color:#0f172a;opacity:1;outline:none}
.smart-head-sort-btn.is-active{color:#2563eb;opacity:1}
@media(max-width:700px){
    .smart-table-enabled thead th.smart-head-cell{padding-right:30px!important}
    .smart-head-sort-controls{right:2px}
}
@media print{
    .smart-head-sort-controls{display:none!important}
    .smart-table-enabled thead th.smart-head-cell{padding-right:inherit!important}
}
/* BUILD 45.2.42 - entry-time contextual Alt+A master creation */
.alt-a-master-toast{position:fixed;z-index:4000;left:50%;bottom:28px;transform:translate(-50%,18px);opacity:0;pointer-events:none;max-width:min(720px,calc(100vw - 28px));padding:9px 14px;border-radius:9px;background:#17263a;color:#fff;font-size:12px;font-weight:750;box-shadow:0 12px 32px rgba(15,23,42,.25);transition:.16s ease}.alt-a-master-toast.show{opacity:1;transform:translate(-50%,0)}
.alt-a-compact-master{width:min(560px,calc(100vw - 28px))}.alt-a-master-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}.alt-a-master-fields label{min-width:0}.alt-a-master-error{margin:10px 0 0;padding:8px 10px;border-radius:7px;background:#fff0f0;color:#b42318;font-weight:700}.alt-a-compact-master .panel-header{margin-bottom:4px}.alt-a-compact-master .p43qm-x{border:0;background:transparent;font-size:24px;cursor:pointer}@media(max-width:640px){.alt-a-master-fields{grid-template-columns:1fr}}

/* BUILD 45.2.43 - equal-size desktop module navigation blocks */
@media(min-width:1201px){
  .nav-list{
    --module-nav-block-width:128px;
  }
  .nav-list>.nav-home,
  .nav-list>.nav-group{
    flex:0 0 var(--module-nav-block-width)!important;
    width:var(--module-nav-block-width)!important;
    min-width:var(--module-nav-block-width)!important;
    max-width:var(--module-nav-block-width)!important;
    box-sizing:border-box!important;
  }
  .nav-list>.nav-home,
  .nav-list>.nav-group>summary{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .nav-list>.nav-home{
    justify-content:flex-start!important;
  }
  .nav-list>.nav-group>summary::after{
    margin-left:auto!important;
    flex:0 0 auto!important;
  }
  .nav-list>.nav-group>summary>span,
  .nav-list>.nav-home>span{
    flex:0 0 auto!important;
  }
}
@media(min-width:1201px) and (max-width:1399px){
  .nav-list{--module-nav-block-width:118px}
  .nav-home,.nav-group>summary{font-size:10px!important;padding-left:7px!important;padding-right:6px!important;gap:4px!important}
}

/* BUILD 45.2.44 - compact equal module blocks with clean label/caret alignment */
@media(min-width:1201px){
  .nav-list{--module-nav-block-width:116px!important;gap:3px!important}
  .nav-list>.nav-home,.nav-list>.nav-group{
    flex:0 0 var(--module-nav-block-width)!important;
    width:var(--module-nav-block-width)!important;
    min-width:var(--module-nav-block-width)!important;
    max-width:var(--module-nav-block-width)!important;
  }
  .nav-list>.nav-home,.nav-list>.nav-group>summary{
    min-height:38px!important;
    height:38px!important;
    padding:0 5px!important;
    gap:4px!important;
    font-size:10px!important;
    line-height:1!important;
    overflow:hidden!important;
  }
  .nav-list>.nav-group>summary{
    display:grid!important;
    grid-template-columns:22px minmax(0,1fr) 13px!important;
    align-items:center!important;
  }
  .nav-list>.nav-home{
    display:grid!important;
    grid-template-columns:22px minmax(0,1fr)!important;
    align-items:center!important;
  }
  .nav-list>.nav-home>span,.nav-list>.nav-group>summary>span{
    width:22px!important;height:22px!important;flex:0 0 22px!important;font-size:11px!important
  }
  .nav-list>.nav-group>summary::after{
    width:13px!important;height:13px!important;flex:0 0 13px!important;margin:0!important;font-size:8px!important
  }
}
@media(min-width:1400px){
  .nav-list{--module-nav-block-width:128px!important}
  .nav-list>.nav-home,.nav-list>.nav-group>summary{font-size:10.5px!important;padding:0 7px!important;gap:5px!important}
}

/* 45.2.44 responsive refinement: keep all nine desktop modules on one row without label/caret collision. */
@media(min-width:1201px) and (max-width:1399px){
  .nav-list{--module-nav-block-width:clamp(109px,calc((100vw - 219px)/9),116px)!important}
  .nav-list>.nav-home,.nav-list>.nav-group>summary{
    white-space:normal!important;
    min-height:40px!important;
    height:40px!important;
    font-size:9.25px!important;
    line-height:1.05!important;
  }
}

/* BUILD 45.2.45 - notification close controls always visible */
.phase37-notice-bar{overflow:visible}
.phase37-notice-scroll{min-width:0}
.phase37-notice-item{flex:0 1 520px;min-width:220px;max-width:520px;padding:3px 4px 3px 8px;border:1px solid rgba(14,165,199,.18);border-radius:7px;background:rgba(255,255,255,.76);overflow:hidden}
.phase37-notice-item a{display:flex;min-width:0;overflow:hidden;white-space:nowrap;align-items:center;flex:1}
.phase37-notice-item a b{flex:0 0 auto}.phase37-notice-item a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.phase37-notice-close{display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 24px;width:24px;height:24px;border:1px solid rgba(220,38,38,.28)!important;border-radius:6px!important;background:#fff!important;color:#b91c1c!important;font-size:18px!important;font-weight:900!important;line-height:1!important;padding:0!important}
.phase37-notice-close:hover{background:#fee2e2!important;color:#991b1b!important}
.phase37-notice-close-all{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;height:26px;padding:0 8px;border:1px solid rgba(220,38,38,.28);border-radius:6px;background:#fff;color:#b91c1c;font-size:10px;font-weight:900;cursor:pointer;white-space:nowrap}
.phase37-notice-close-all:hover{background:#fee2e2;color:#991b1b}
@media(max-width:720px){.phase37-notice-item{min-width:78vw;max-width:78vw}.phase37-notice-close-all{padding:0 6px;font-size:0}.phase37-notice-close-all::first-letter{font-size:18px}}


/* BUILD 45.2.51 - voucher register Action column alignment */
.table-card .table-wrap>table td.table-actions{display:table-cell!important;vertical-align:middle!important;white-space:nowrap!important}
.table-card .table-wrap>table td.table-actions>a,.table-card .table-wrap>table td.table-actions>button{display:inline-flex!important;align-items:center!important;vertical-align:middle!important;margin:0 10px 0 0!important;white-space:nowrap!important}
.table-card .table-wrap>table td.table-actions>a:last-child,.table-card .table-wrap>table td.table-actions>button:last-child{margin-right:0!important}
.table-card .table-wrap>table th:last-child,.table-card .table-wrap>table td:last-child{vertical-align:middle!important}

/* Build 45.2.56 - voucher usability */
.voucher-sticky-actions{position:sticky;top:72px;z-index:70;display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:9px 12px;margin:0 0 12px;background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:10px;box-shadow:0 4px 14px rgba(15,23,42,.08);backdrop-filter:blur(8px)}
.voucher-sticky-actions .action-row,.voucher-sticky-actions form.action-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0}
.voucher-status-sticky{margin-top:-4px}
.table-actions .voucher-direct-print,td .voucher-direct-print{margin-left:10px;white-space:nowrap}
#purchase-grn-select{width:100%;min-width:620px;white-space:nowrap;font-variant-numeric:tabular-nums}
#extra-purchase-lines .extra-serials{min-width:150px}
#extra-purchase-lines input,#extra-purchase-lines select{min-width:92px}
@media(max-width:900px){.voucher-sticky-actions{top:62px;overflow-x:auto;justify-content:flex-start}#purchase-grn-select{min-width:100%}}
@media print{.voucher-sticky-actions{display:none!important}}
