:root {
  --navy-950: #050a16;
  --navy-900: #071020;
  --navy-800: #0c1930;
  --ink: #eef5ff;
  --muted: #8595ae;
  --faint: #4f607c;
  --line: rgba(164, 187, 222, 0.14);
  --cyan: #6be4ff;
  --cyan-bright: #2bc9ff;
  --green: #63e7a8;
  --purple: #bd8dff;
  --radius-lg: 28px;
  --font-body: "DM Sans", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--navy-950);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; position: relative; overflow: hidden; }
.app-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at 18% 5%, #142d51 0, transparent 33%), linear-gradient(135deg, #050b17 0%, #081327 52%, #061020 100%); }
.grid-glow { position: absolute; inset: 0; opacity: .28; background-image: linear-gradient(rgba(122, 163, 214, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(122, 163, 214, .045) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(to bottom, #000, transparent 82%); }
.light-orb { position: absolute; border-radius: 50%; filter: blur(3px); opacity: .15; }
.orb-one { width: 520px; height: 520px; top: 11%; right: -160px; background: #126ebd; filter: blur(120px); }
.orb-two { width: 330px; height: 330px; bottom: -160px; left: 11%; background: #6020be; filter: blur(110px); opacity: .12; }
.orb-three { width: 270px; height: 270px; top: 38%; left: 42%; background: #0fb8db; filter: blur(130px); opacity: .07; }
.view { min-height: 100vh; position: relative; z-index: 1; animation: view-in .5s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.landing-view { max-width: 1240px; margin: auto; padding: 44px 58px 54px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 70px; }
.landing-view #welcome-title,
.landing-view .landing-copy {
  display: none !important;
}
.brand-lockup { display: flex; gap: 13px; align-items: center; }
.brand-mark { width: 44px; height: 44px; border: 1px solid rgba(136, 226, 255, .7); border-radius: 13px 13px 13px 4px; color: var(--cyan); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; letter-spacing: -3px; font-size: 20px; box-shadow: inset 0 0 18px rgba(63, 209, 255, .12), 0 0 24px rgba(23, 178, 234, .14); }
.brand-mark span { color: white; font-size: 16px; }
.brand-name { margin: 2px 0 0; font: 600 15px var(--font-display); letter-spacing: -.25px; color: #dce8fa; }
.eyebrow { color: #7788a2; font: 600 9px var(--font-display); letter-spacing: 2px; margin: 0; }
.accent-eyebrow { color: var(--cyan); }
.landing-copy { align-self: center; padding-top: 1vh; }
.hero-copy { margin-top: 0; max-width: 620px; }
.hero-copy h1 { font: 500 clamp(54px, 6.3vw, 88px)/.99 var(--font-display); letter-spacing: -5px; margin: 17px 0 25px; color: #f5f9ff; }
h1 em, .main-title-wrap em { font-style: normal; color: transparent; -webkit-text-stroke: 1px #7a92af; }
.hero-description { color: #9aaac2; font-size: 15px; line-height: 1.7; max-width: 390px; margin: 0; }
.location-line { display: flex; align-items: center; gap: 9px; margin-top: clamp(70px, 13vh, 125px); color: #71829d; font-size: 12px; }
.location-pin svg { width: 16px; height: 16px; stroke: var(--cyan); stroke-width: 1.6; }
.access-panel { position: relative; max-width: 455px; width: 100%; justify-self: end; padding: clamp(38px, 5vw, 59px); border: 1px solid rgba(169, 200, 238, .16); border-radius: 28px; background: linear-gradient(150deg, rgba(21, 40, 70, .82), rgba(7, 17, 34, .72)); box-shadow: 0 30px 90px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.06); overflow: hidden; }
.panel-shine { position: absolute; width: 220px; height: 220px; border-radius: 50%; top: -150px; right: -40px; background: #2588bf; filter: blur(80px); opacity: .18; }
.panel-topline { display: flex; align-items: center; gap: 8px; color: #6e849e; font: 600 9px var(--font-display); letter-spacing: 2px; }
.status-dot, .signed-in-as .status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #54e2a4; box-shadow: 0 0 9px #54e2a4; }
.access-panel h2 { font: 500 32px var(--font-display); letter-spacing: -1.5px; margin: 24px 0 7px; }
.panel-intro, .auth-description { color: #8496b1; font-size: 13px; margin: 0; line-height: 1.6; }
.access-actions { display: grid; gap: 12px; margin-top: 0; }
.access-card { position: relative; display: flex; align-items: center; gap: 15px; width: 100%; text-align: left; border-radius: 16px; padding: 17px 16px; color: var(--ink); background: rgba(255,255,255,.045); border: 1px solid rgba(156,190,232,.13); transition: transform .25s ease, background .25s ease, border .25s ease; }
.access-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.085); border-color: rgba(117,216,255,.45); }
.access-card:active { transform: translateY(0) scale(.985); }
.access-card-admin:hover { box-shadow: 0 8px 28px rgba(36, 189, 235, .1); }
.access-card-user:hover { border-color: rgba(111, 230, 174, .42); box-shadow: 0 8px 28px rgba(35, 202, 145, .08); }
.access-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: rgba(64, 205, 245, .1); color: var(--cyan); }
.access-card-user .access-icon { background: rgba(85, 225, 164, .1); color: var(--green); }
.access-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.45; }
.access-card-copy { display: grid; gap: 3px; }
.access-card-copy strong { font: 600 14px var(--font-display); }
.access-card-copy small { color: #8192ab; font-size: 11px; }
.arrow-icon { margin-left: auto; color: #6f83a1; font-size: 20px; font-weight: 300; }
.panel-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; color: #52647f; font-size: 10px; margin: 34px 0 0; }
.lock-icon svg { width: 13px; height: 13px; stroke: #6b7e9a; stroke-width: 1.6; }

.auth-view { display: grid; place-items: center; padding: 35px 20px; }
.auth-backdrop-glow { position: absolute; width: 450px; height: 450px; border-radius: 50%; background: #105f9b; filter: blur(140px); opacity: .15; top: 13%; left: 40%; }
.auth-card { width: min(100%, 445px); padding: 10px 42px 39px; }
.back-button, .text-button { background: transparent; border: 0; color: #8194ae; padding: 8px 0; font-size: 12px; transition: color .2s; }
.back-button:hover, .text-button:hover { color: var(--cyan); }
.auth-heading { display: flex; align-items: center; gap: 17px; margin-top: 70px; }
.auth-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: rgba(71, 210, 250, .1); color: var(--cyan); }
.auth-icon svg { width: 25px; height: 25px; stroke: currentColor; stroke-width: 1.45; }
.auth-heading h2 { font: 500 30px var(--font-display); letter-spacing: -1.5px; margin: 5px 0 0; }
.auth-description { margin: 18px 0 32px; }
.form-stack { display: grid; gap: 17px; }
.field { display: grid; gap: 8px; color: #9cacbf; font-size: 11px; font-weight: 600; }
.input-wrap { position: relative; }
.field input, .field select { width: 100%; min-height: 48px; border: 1px solid rgba(156, 190, 232, .16); border-radius: 11px; background: rgba(4, 12, 25, .55); color: #eaf3ff; outline: 0; padding: 0 14px; transition: border .2s, box-shadow .2s; }
.field input::placeholder { color: #50627b; }
.field input:focus, .field select:focus { border-color: rgba(92, 215, 251, .72); box-shadow: 0 0 0 3px rgba(57, 199, 246, .09); }
.input-wrap input { padding-left: 43px; padding-right: 55px; }
.field-icon { position: absolute; z-index: 1; left: 15px; top: 15px; color: #637892; }
.field-icon svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.5; }
.password-toggle { position: absolute; right: 13px; top: 14px; color: #7f94af; background: transparent; border: 0; font-size: 11px; }
.password-toggle:hover { color: var(--cyan); }
.primary-button { min-height: 49px; padding: 0 17px; display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid rgba(135, 231, 255, .5); border-radius: 11px; color: #03111d; background: linear-gradient(115deg, #a1efff, #40c9f2); box-shadow: 0 10px 25px rgba(37, 190, 236, .14), inset 0 1px rgba(255,255,255,.7); font: 700 12px var(--font-display); transition: transform .2s, box-shadow .2s; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(37, 190, 236, .24), inset 0 1px rgba(255,255,255,.7); }
.primary-button:active { transform: translateY(0) scale(.985); }
.admin-hint { text-align: center; color: #667b97; font-size: 10px; margin: 20px 0 0; }
.admin-hint strong { color: #b5c7df; font-weight: 600; }
.auth-side-note { position: absolute; bottom: 37px; display: flex; align-items: center; gap: 10px; color: #8395ae; font: 600 11px var(--font-display); line-height: 1.4; }
.auth-side-note small { color: #50627b; font: 400 10px var(--font-body); }
.mini-mark { width: 30px; height: 30px; display: grid; place-items: center; color: var(--cyan); border: 1px solid rgba(111,224,253,.4); border-radius: 9px 9px 9px 3px; font: 700 11px var(--font-display); }
.inline-message { padding: 11px 13px; margin: -10px 0 4px; border: 1px solid rgba(255, 139, 139, .25); border-radius: 9px; background: rgba(206, 66, 66, .09); color: #ffb1b1; font-size: 11px; line-height: 1.5; }
.inline-message.success { border-color: rgba(98, 233, 172, .25); background: rgba(58, 199, 136, .08); color: #9af0c5; }

.workspace-header, .main-header { display: flex; align-items: center; justify-content: space-between; padding: 29px clamp(24px, 5vw, 72px); border-bottom: 1px solid rgba(164,187,222,.1); }
.compact .brand-mark { width: 37px; height: 37px; border-radius: 11px 11px 11px 3px; font-size: 16px; }
.compact .brand-mark span { font-size: 13px; }
.compact .brand-name { font-size: 13px; }
.header-actions, .main-header-actions { display: flex; align-items: center; gap: 25px; }
.outline-button { min-height: 37px; padding: 0 14px; border-radius: 9px; border: 1px solid rgba(133,174,221,.2); background: rgba(255,255,255,.03); color: #a7b9d0; font-size: 11px; transition: border .2s, color .2s, background .2s; }
.outline-button:hover { border-color: rgba(99,220,255,.55); color: var(--cyan); background: rgba(69,205,247,.06); }
.admin-content { max-width: 1200px; margin: auto; padding: 73px 34px 55px; }
.page-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 28px; margin-bottom: 39px; }
.page-intro h1 { font: 500 clamp(31px, 4vw, 46px) var(--font-display); letter-spacing: -2.5px; margin: 13px 0 9px; }
.page-intro p { margin: 0; color: #8293ad; font-size: 13px; }
.user-count-badge { display: grid; text-align: right; color: var(--cyan); }
.user-count-badge span { font: 500 35px var(--font-display); line-height: 1; }
.user-count-badge small { margin-top: 5px; color: #6f829d; font-size: 10px; }
.admin-data-tools { display: grid; justify-items: end; gap: 10px; }
.admin-data-actions { display: flex; gap: 9px; }
.admin-data-actions .outline-button { white-space: nowrap; }
.danger-button { min-height: 37px; padding: 0 14px; border: 1px solid rgba(179,57,77,.35); border-radius: 9px; color: #a43145; background: #fff4f5; font-size: 11px; transition: border .2s, background .2s, color .2s; }
.danger-button:hover { border-color: #b3394d; color: #8e2438; background: #ffe8eb; }
.admin-data-tools .inline-message { margin: 0; padding: 8px 11px; font-size: 10px; }
.business-profile-card { margin-bottom: 22px; }
.business-profile-card .card-heading { margin-bottom: 22px; }
.business-profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 17px; }
.opening-balance-card { margin-bottom: 22px; }
.opening-balance-card .card-heading { margin-bottom: 22px; }
.opening-balance-heading { justify-content: space-between; }
.opening-balance-title { display: flex; align-items: center; gap: 13px; }
.opening-balance-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 17px; align-items: end; }
.opening-balance-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.opening-balance-actions .primary-button { min-width: 220px; }
.opening-balance-list { display: grid; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(159,190,229,.15); }
.opening-balance-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.opening-balance-list-heading h3 { margin: 0 0 4px; color: #e9f3ff; font: 600 15px var(--font-display); }
.opening-balance-list-heading p { margin: 0; color: #8297b0; font-size: 11px; }
.opening-balance-count { padding: 6px 10px; border: 1px solid rgba(91,216,250,.2); border-radius: 999px; color: var(--cyan); background: rgba(68,202,244,.07); font-size: 10px; white-space: nowrap; }
.opening-balance-list-rows { display: grid; gap: 9px; }
.opening-balance-row { display: grid; grid-template-columns: minmax(115px,.75fr) minmax(190px,1.2fr) minmax(190px,1.2fr) minmax(120px,.8fr) auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid rgba(159,190,229,.13); border-radius: 12px; background: rgba(5,16,31,.34); }
.opening-balance-row > div { display: grid; min-width: 0; gap: 5px; }
.opening-balance-row > div > span { color: #7890aa; font: 700 9px var(--font-display); letter-spacing: .55px; text-transform: uppercase; }
.opening-balance-row > div > strong { color: #ecf5ff; font-size: 12px; overflow-wrap: anywhere; }
.opening-balance-row small { color: #9eafc2; font-size: 10px; overflow-wrap: anywhere; }
.opening-balance-account.debit > span,
.opening-balance-account.debit > small { color: #62d0a0; }
.opening-balance-account.credit > span,
.opening-balance-account.credit > small { color: #72b9f6; }
.opening-balance-status { width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.opening-balance-status.balanced { color: #82dfb4; background: rgba(58,186,125,.12); }
.opening-balance-status.unbalanced { color: #ffb1b8; background: rgba(216,72,87,.15); }
.opening-balance-edit { min-height: 38px; padding: 0 13px; white-space: nowrap; }
.opening-balance-edit:disabled { opacity: .55; cursor: not-allowed; }
.opening-balance-empty { display: grid; gap: 4px; padding: 17px; border: 1px dashed rgba(159,190,229,.2); border-radius: 11px; color: #9eafc2; font-size: 11px; }
.opening-balance-empty strong { color: #dce9f7; font-size: 12px; }
.business-profile-actions { grid-column: 1 / -1; display: flex; justify-content: end; }
.business-profile-actions .primary-button { min-width: 205px; }
.admin-grid { display: grid; grid-template-columns: minmax(290px, .8fr) minmax(430px, 1.2fr); gap: 22px; }
.surface-card { border: 1px solid rgba(159,190,229,.14); border-radius: 21px; background: rgba(11, 26, 47, .7); box-shadow: 0 22px 60px rgba(0,0,0,.13), inset 0 1px rgba(255,255,255,.04); padding: 28px; }
.card-heading { display: flex; gap: 13px; align-items: center; margin-bottom: 28px; }
.card-heading h2 { font: 500 18px var(--font-display); margin: 0 0 5px; letter-spacing: -.6px; }
.card-heading p { color: #70829d; font-size: 11px; margin: 0; }
.card-heading-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--cyan); border: 1px solid rgba(91,216,250,.24); background: rgba(68,202,244,.08); font-size: 20px; }
.user-form-card .form-stack { gap: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field input { min-width: 0; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7790ae 50%), linear-gradient(135deg, #7790ae 50%, transparent 50%); background-position: calc(100% - 17px) 21px, calc(100% - 12px) 21px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form-actions { display: flex; gap: 9px; margin-top: 6px; }
.form-actions .primary-button { flex: 1; }
.form-actions .outline-button { flex: 0 0 auto; }
.list-heading { justify-content: space-between; }
.list-live-indicator { display: flex; align-items: center; gap: 6px; color: #6fcda5; font-size: 10px; }
.list-live-indicator i, .main-footer i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; background: #5bd99d; box-shadow: 0 0 7px #5bd99d; }
.user-list { border-top: 1px solid rgba(166,194,229,.1); }
.empty-state { display: grid; place-items: center; text-align: center; min-height: 220px; color: #647894; }
.empty-state-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 13px; border: 1px dashed rgba(132,170,214,.25); color: #7289a8; font-size: 19px; }
.empty-state p { font-size: 12px; margin: 0; }
.user-row { display: grid; grid-template-columns: 1.4fr .9fr .7fr auto; align-items: center; gap: 15px; min-height: 70px; border-bottom: 1px solid rgba(166,194,229,.08); }
.user-row:last-child { border-bottom: 0; }
.user-avatar { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; color: #bcefff; background: rgba(54,196,241,.14); font: 600 11px var(--font-display); }
.user-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.user-info small, .user-username { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6e829f; font-size: 10px; margin-top: 3px; }
.user-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; }
.user-status i { width: 5px; height: 5px; border-radius: 50%; }
.user-status.active { color: #72dbaa; } .user-status.active i { background: #60dda3; }
.user-status.inactive { color: #8491a5; } .user-status.inactive i { background: #68758a; }
.row-actions { display: flex; gap: 9px; justify-content: end; }
.row-actions button { border: 0; background: transparent; color: #778aa5; padding: 5px 0; font-size: 10px; }
.row-actions button:hover { color: var(--cyan); }

.main-header { align-items: center; }
.business-details { display: grid; text-align: center; gap: 3px; position: absolute; left: 50%; transform: translateX(-50%); }
.business-details strong { font: 600 14px var(--font-display); }
.business-details span { color: #6e809b; font-size: 10px; }
.business-details b, .main-footer b { color: var(--cyan); font-weight: 400; padding: 0 3px; }
.signed-in-as { display: flex; align-items: center; gap: 7px; color: #8295ae; font-size: 10px; }
.main-content { max-width: 1300px; padding: 85px 34px 72px; margin: auto; }
.main-title-wrap { text-align: center; }
.main-title-wrap h1 { margin: 14px 0 11px; font: 500 clamp(38px, 4.5vw, 58px)/1.04 var(--font-display); letter-spacing: -3px; }
.main-title-wrap p:last-child { margin: 0; color: #7c8da7; font-size: 13px; }
.circle-options { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 26px); margin-top: 70px; }
.circle-option { position: relative; width: clamp(155px, 17vw, 215px); aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: white; transition: transform .32s ease; }
.circle-option:hover { transform: translateY(-12px); }
.circle-option:active { transform: translateY(-4px) scale(.97); }
.circle-aura { position: absolute; inset: 2%; border-radius: 50%; opacity: .25; filter: blur(25px); }
.circle-shell { position: absolute; inset: 7%; border-radius: 50%; display: grid; place-items: center; overflow: hidden; box-shadow: inset -17px -18px 30px rgba(0,0,0,.32), inset 11px 12px 28px rgba(255,255,255,.18), 0 18px 30px rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.25); }
.circle-shell::before { content: ""; position: absolute; inset: 8%; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; box-shadow: 0 0 0 8px rgba(255,255,255,.035), inset 0 0 20px rgba(255,255,255,.12); }
.circle-shell::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); }
.circle-reflection { position: absolute; width: 68%; height: 44%; border-radius: 50%; top: -10%; left: 4%; background: linear-gradient(140deg, rgba(255,255,255,.42), rgba(255,255,255,0)); transform: rotate(-28deg); filter: blur(2px); opacity: .6; }
.circle-trade .circle-aura { background: #15c5ff; box-shadow: 0 0 80px #15c5ff; }
.circle-trade .circle-shell { background: radial-gradient(circle at 30% 22%, #99f1ff 0, #269bd0 26%, #08618f 62%, #032f5c 100%); }
.circle-cash .circle-aura { background: #33dd91; box-shadow: 0 0 80px #33dd91; }
.circle-cash .circle-shell { background: radial-gradient(circle at 29% 21%, #9bffcd 0, #37bd83 27%, #157555 62%, #063e3d 100%); }
.circle-ledger .circle-aura { background: #9f5cff; box-shadow: 0 0 80px #9f5cff; }
.circle-ledger .circle-shell { background: radial-gradient(circle at 29% 21%, #d9b8ff 0, #9260d7 28%, #533390 63%, #251951 100%); }
.circle-expenses .circle-aura { background: #ef6c86; box-shadow: 0 0 80px #ef6c86; }
.circle-expenses .circle-shell { background: radial-gradient(circle at 29% 21%, #ffc1ce 0, #e96883 28%, #9f334d 63%, #56192c 100%); }
.circle-profit-loss .circle-aura { background: #f0a43d; box-shadow: 0 0 80px #f0a43d; }
.circle-profit-loss .circle-shell { background: radial-gradient(circle at 29% 21%, #ffe0a3 0, #eaa344 28%, #a86016 63%, #5d310c 100%); }
.circle-balance-sheet .circle-aura { background: #55d9c0; box-shadow: 0 0 80px #55d9c0; }
.circle-balance-sheet .circle-shell { background: radial-gradient(circle at 29% 21%, #b1fff0 0, #46c6ad 28%, #177c79 63%, #08464e 100%); }
.circle-icon { position: relative; z-index: 1; margin-top: -20px; color: rgba(236, 252, 255, .96); filter: drop-shadow(0 3px 4px rgba(0,0,0,.28)); }
.circle-icon svg { width: clamp(45px, 5vw, 61px); height: clamp(45px, 5vw, 61px); stroke: currentColor; stroke-width: 1.55; }
.circle-label { position: absolute; z-index: 1; bottom: 23%; font: 500 clamp(13px, 1.5vw, 18px) var(--font-display); letter-spacing: -.4px; text-shadow: 0 2px 4px rgba(0,0,0,.3); }
.circle-label b { font-weight: 700; }
.circle-number { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); color: #6e839f; font: 600 9px var(--font-display); letter-spacing: 1px; }
.placeholder-toast { position: fixed; left: 50%; bottom: 67px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 15px; color: #bdeefa; border: 1px solid rgba(106,226,255,.27); border-radius: 9px; background: rgba(5, 18, 34, .92); font-size: 11px; transition: opacity .25s, transform .25s; }
.placeholder-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.main-footer { display: flex; justify-content: space-between; position: fixed; bottom: 0; left: 0; right: 0; padding: 18px clamp(24px, 5vw, 72px); color: #50627c; font-size: 10px; border-top: 1px solid rgba(164,187,222,.08); background: rgba(5, 12, 24, .55); }
.main-footer span:first-child { display: flex; align-items: center; gap: 7px; }

.ledger-content { max-width: 1150px; margin: auto; padding: 62px 34px 70px; }
.ledger-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; }
.ledger-heading h1 { font: 500 clamp(34px, 4vw, 48px) var(--font-display); letter-spacing: -2.5px; margin: 12px 0 0; }
.new-party-button { min-width: 132px; }
.ledger-toolbar { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border-radius: 15px; }
.ledger-select-label { color: #a7b9d0; font: 600 11px var(--font-display); }
.ledger-filter { min-height: 42px; width: min(320px, 45vw); min-width: 260px; border: 1px solid rgba(156,190,232,.18); border-radius: 9px; background-color: rgba(4,12,25,.55); color: #eaf3ff; padding: 0 34px 0 14px; outline: 0; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7790ae 50%), linear-gradient(135deg, #7790ae 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.ledger-filter:focus { border-color: rgba(92,215,251,.72); }
.party-count { margin-left: auto; color: #6f829d; font-size: 11px; }
.party-form-card { margin-top: 18px; }
.party-form-card .card-heading { margin-bottom: 22px; }
.party-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 17px; }
.party-form.expense-party-form { grid-template-columns: minmax(0, 1fr); }
.party-address-field { grid-column: 1 / -1; }
.party-form-actions { grid-column: 1 / -1; display: flex; justify-content: end; gap: 9px; }
.party-form-actions .primary-button { min-width: 145px; }
.party-list-card { margin-top: 18px; padding: 0 28px; }
.admin-party-panel { margin: 0 0 18px; padding: 24px; }
.admin-party-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.admin-party-panel-heading .card-heading { margin: 0; }
.admin-party-panel-heading .card-heading p { margin-top: 5px; }
.admin-party-table-wrap { overflow-x: auto; border: 1px solid rgba(156,190,232,.14); border-radius: 11px; }
.admin-party-table { width: 100%; min-width: 620px; border-collapse: collapse; text-align: left; }
.admin-party-table th { padding: 13px 15px; border-bottom: 1px solid rgba(156,190,232,.15); color: #60738f; font: 600 9px var(--font-display); letter-spacing: 1px; text-transform: uppercase; }
.admin-party-table td { padding: 14px 15px; border-bottom: 1px solid rgba(156,190,232,.1); color: #aab9ce; font-size: 11px; vertical-align: middle; }
.admin-party-table tbody tr:last-child td { border-bottom: 0; }
.admin-party-table td:first-child { display: grid; gap: 4px; }
.admin-party-table td:first-child strong { color: #10263e; font-size: 14px; font-weight: 700; }
.admin-party-table td:first-child small { color: #60758d; font-size: 10px; }
.admin-party-actions { display: flex; justify-content: end; gap: 8px; }
.admin-party-actions button { min-height: 34px; padding: 0 12px; font-size: 10px; }
.admin-party-empty { padding: 24px; color: #6f829d; text-align: center; }
.admin-party-type-note { display: block; margin-top: 5px; color: #8ba0bb; font-size: 10px; }
.party-list { border-top: 0; }
.party-list-head, .party-row { display: grid; grid-template-columns: 1.55fr .75fr 1.55fr; align-items: center; gap: 22px; }
.party-list-head { min-height: 48px; border-bottom: 1px solid rgba(166,194,229,.1); color: #60738f; font: 600 9px var(--font-display); letter-spacing: 1px; text-transform: uppercase; }
.party-row { min-height: 76px; border-bottom: 1px solid rgba(166,194,229,.08); color: #aab9ce; font-size: 11px; }
.party-row:last-child { border-bottom: 0; }
.party-name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.party-name-details { display: grid; min-width: 0; gap: 4px; }
.party-name-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e1ebf8; font-weight: 600; }
.party-drilldown, .ledger-party-drilldown { overflow: hidden; border: 0; background: transparent; color: #193653; font: 600 11px var(--font-body); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.party-drilldown { padding: 0; }
.party-drilldown:hover, .ledger-party-drilldown:hover { color: #007b9f; text-decoration: underline; text-underline-offset: 3px; }
.party-name-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4d667f; font-size: 10px; }
.party-kind { font-size: 10px; }
.party-kind.customer { color: #72dbaa; }
.party-kind.supplier { color: #bd8dff; }
.party-address, .party-phones { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7c8fa9; line-height: 1.6; }
.party-empty { min-height: 235px; }

.trade-content { max-width: 1280px; margin: auto; padding: 56px 34px 70px; }
.trade-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.trade-heading h1 { margin: 12px 0 0; color: #10263e; font: 500 clamp(34px, 4vw, 48px) var(--font-display); letter-spacing: -2.5px; }
.trade-date-field { display: grid; gap: 7px; min-width: 210px; }
.trade-date-field span { color: #536b84; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.trade-date-field input { min-height: 42px; padding: 0 11px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; outline: 0; color: #10263e; background: #fff; font-size: 11px; }
.trade-date-field input:focus { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.trade-section { padding: 25px 26px 18px; margin-bottom: 20px; }
.trade-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.trade-section-heading h2 { margin: 8px 0 0; color: #10263e; font: 500 21px var(--font-display); letter-spacing: -.8px; }
.purchase-eyebrow { color: #007b9f; }
.sale-eyebrow { color: #16764d; }
.add-row-button { min-height: 34px; }
.trade-row-labels, .trade-fields-line { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; align-items: center; }
.trade-row-labels > span:first-child, .trade-fields-line > .trade-field:first-child { grid-column: 1 / -1; }
.trade-row-labels { padding: 0 13px 10px; color: #60758d; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.trade-row { position: relative; padding: 12px 13px 0; margin-bottom: 9px; border: 1px solid rgba(30,74,113,.17); border-radius: 12px; background: rgba(239,246,252,.82); }
.trade-row:last-child { margin-bottom: 0; }
.trade-field { min-width: 0; }
.trade-party-field { padding-right: 38px; }
.trade-party-search { width: 100%; min-width: 0; min-height: 36px; padding: 8px 10px; border: 1px solid rgba(30,74,113,.2); border-radius: 8px; color: #20364c; background: rgba(255,255,255,.9); font: 500 12px var(--font-body); }
.trade-party-search:focus { border-color: #49a9d8; outline: 2px solid rgba(73,169,216,.16); }
.trade-party-search::placeholder { color: #8192a3; }
.trade-field input, .trade-field select { width: 100%; min-height: 41px; padding: 0 10px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; outline: 0; color: #10263e; background: #ffffff; font-size: 11px; }
.trade-field input:focus, .trade-field select:focus { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.trade-field input::placeholder { color: #74879b; }
.trade-field select { padding-right: 26px; }
.trade-field input[readonly], .freight-field input[readonly] { cursor: not-allowed; color: #4d6680; background: #e7eef5; }
.trade-amount-line { display: grid; grid-template-columns: 95px 1fr auto; align-items: center; gap: 10px; min-height: 45px; margin-top: 11px; padding: 0 3px; border-top: 1px solid rgba(30,74,113,.14); }
.trade-amount-line strong { overflow: hidden; color: #10263e; font: 600 14px var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.trade-amount-line small { color: #60758d; font-size: 9px; white-space: nowrap; }
.remove-trade-row { position: absolute; top: 10px; right: 8px; width: 24px; height: 24px; border: 0; border-radius: 6px; color: #71869d; background: transparent; font-size: 20px; line-height: 1; }
.remove-trade-row:hover { color: #c04556; background: rgba(192,69,86,.08); }
.mobile-trade-label { display: none; }
.trade-summary { margin-top: 4px; padding: 24px 26px 26px; }
.trade-summary-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.trade-summary-heading h2 { margin: 8px 0 0; color: #10263e; font: 500 21px var(--font-display); letter-spacing: -.8px; }
.trade-summary-note { margin: 0; color: #60758d; font-size: 11px; }
.trade-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.trade-total-card, .trade-result-card { min-height: 82px; display: grid; align-content: center; gap: 8px; padding: 15px 17px; border: 1px solid rgba(30,74,113,.15); border-radius: 12px; background: rgba(239,246,252,.82); }
.trade-total-card span, .trade-result-card span { color: #60758d; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.trade-total-card strong { color: #10263e; font: 600 18px var(--font-display); }
.sale-total-card { background: rgba(233,248,241,.75); }
.trade-result-card strong { font: 600 20px var(--font-display); }
.trade-result-card small { color: #60758d; font-size: 10px; }
.trade-result-card.profit { border-color: rgba(22,118,77,.3); background: rgba(224,248,234,.9); }
.trade-result-card.profit span, .trade-result-card.profit strong { color: #16764d; }
.trade-result-card.loss { border-color: rgba(192,69,86,.3); background: rgba(255,235,238,.9); }
.trade-result-card.loss span, .trade-result-card.loss strong { color: #b3394d; }
.trade-result-card.neutral { border-color: rgba(30,74,113,.17); }
.trade-register-panel { margin-bottom: 22px; padding: 24px 26px; }
.trade-register-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 19px; }
.trade-register-heading h2 { margin: 8px 0 4px; color: #10263e; font: 500 21px var(--font-display); letter-spacing: -.8px; }
.trade-register-heading p:last-child { margin: 0; color: #60758d; font-size: 10px; }
.trade-register-filters { display: flex; gap: 9px; }
.trade-register-filters label { display: grid; gap: 6px; color: #536b84; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.trade-register-filters input { min-height: 40px; padding: 0 10px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; color: #10263e; background: #fff; outline: 0; font-size: 10px; }
.trade-register-list { overflow-x: auto; border-top: 1px solid rgba(30,74,113,.15); }
.trade-register-row { display: grid; grid-template-columns: 95px 1.15fr 1.35fr 2fr 100px 120px; gap: 13px; align-items: center; min-width: 900px; min-height: 49px; border-bottom: 1px solid rgba(30,74,113,.1); color: #486079; font-size: 10px; }
.trade-register-row > :last-child { color: #153352; text-align: right; }
.trade-register-head { min-height: 38px; color: #60758d; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.register-voucher-type { color: #007b9f; font-weight: 600; }
.register-details { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-register-summary { display: flex; gap: 10px; margin-bottom: 15px; }
.trade-register-summary > div { display: grid; gap: 4px; min-width: 120px; padding: 10px 13px; border: 1px solid rgba(30,74,113,.12); border-radius: 9px; background: #f1f6fa; }
.trade-register-summary span { color: #60758d; font: 600 9px var(--font-display); text-transform: uppercase; }
.trade-register-summary strong { color: #10263e; font: 600 15px var(--font-display); }
.trade-register-empty, .register-error { padding: 25px 0; color: #60758d; font-size: 11px; text-align: center; }
.register-error { color: #b3394d; }
.trade-post-actions { display: flex; align-items: center; justify-content: end; gap: 15px; margin: -8px 0 20px; }
.trade-post-actions .inline-message { flex: 1; margin: 0; }
.trade-post-actions .primary-button { min-width: 220px; }
.trade-post-actions .primary-button:disabled { cursor: not-allowed; opacity: .62; transform: none; box-shadow: none; }
.freight-section { margin-top: 20px; padding: 25px 26px 26px; }
.freight-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.freight-heading h2 { margin: 8px 0 0; color: #10263e; font: 500 21px var(--font-display); letter-spacing: -.8px; }
.freight-note { max-width: 360px; margin: 0; color: #60758d; font-size: 11px; text-align: right; }
.freight-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 15px; }
.freight-field { display: grid; gap: 7px; min-width: 0; }
.freight-field span { color: #536b84; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.freight-field input, .freight-field select, .ledger-party-filter { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; outline: 0; color: #10263e; background: #fff; font-size: 11px; }
.freight-field input:focus, .freight-field select:focus, .ledger-party-filter:focus { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.freight-total { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 17px; border: 1px solid rgba(22,118,77,.25); border-radius: 11px; background: rgba(224,248,234,.72); }
.freight-total span { color: #16764d; font: 600 10px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.freight-total strong { color: #16764d; font: 600 20px var(--font-display); }
.freight-form .inline-message { grid-column: 1 / -1; margin: 0; }
.freight-form-actions { grid-column: 1 / -1; display: flex; justify-content: end; }
.freight-form-actions .primary-button { min-width: 205px; }
.ledger-entries-card { margin-top: 0; padding: 23px 28px 12px; }
.ledger-toolbar { margin-top: 18px; }
.ledger-entries-heading { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; align-items: end; gap: 13px; margin-bottom: 15px; }
.ledger-entries-heading h2 { margin: 7px 0 0; color: #10263e; font: 500 20px var(--font-display); }
.ledger-party-selector { position: relative; display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 15px; }
.ledger-party-filter-label { grid-column: 1 / -1; padding: 0; color: #536b84; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.ledger-party-trigger, .ledger-party-search { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; outline: 0; color: #10263e; background: #fff; font-size: 11px; }
.ledger-party-trigger { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.ledger-party-trigger:hover, .ledger-party-trigger[aria-expanded="true"] { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.ledger-party-menu { position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; right: 0; padding: 10px; border: 1px solid rgba(30,74,113,.25); border-radius: 10px; background: #fff; box-shadow: 0 18px 40px rgba(30,74,113,.18); }
.ledger-party-search::placeholder { color: #71869d; }
.ledger-party-search:focus { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.ledger-party-options { max-height: 230px; margin-top: 8px; overflow-y: auto; }
.ledger-party-option { width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 7px; color: #294863; background: transparent; text-align: left; font-size: 11px; }
.ledger-party-option:hover, .ledger-party-option.selected { color: #006b8a; background: #eaf6fb; font-weight: 700; }
.ledger-party-filter-hidden { display: none; }
.ledger-date-filters { display: flex; align-items: end; gap: 8px; }
.ledger-date-filters label { display: grid; gap: 6px; color: #536b84; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.ledger-date-filters input { width: 132px; min-height: 38px; padding: 0 9px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; outline: 0; color: #10263e; background: #fff; font: 400 10px var(--font-body); }
.ledger-date-filters input:focus { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.ledger-balance-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 15px; }
.ledger-balance-card { display: grid; gap: 6px; min-height: 68px; align-content: center; padding: 12px 14px; border: 1px solid rgba(30,74,113,.15); border-radius: 11px; background: #f5f9fc; }
.ledger-balance-card span { color: #536b84; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.ledger-balance-card strong { font: 600 17px var(--font-display); }
.ledger-balance-card.debit-balance { border-color: rgba(179,57,77,.22); background: rgba(255,239,242,.72); }
.ledger-balance-card.debit-balance strong { color: #b3394d; }
.ledger-balance-card.credit-balance { border-color: rgba(22,118,77,.22); background: rgba(231,249,239,.72); }
.ledger-balance-card.credit-balance strong { color: #16764d; }
.ledger-balance-card.net-balance { border-color: rgba(0,123,159,.22); background: rgba(231,247,252,.8); }
.ledger-balance-card.net-balance strong { color: #007b9f; }
.ledger-balance-empty { grid-column: 1 / -1; display: grid; min-height: 68px; place-items: center; border: 1px dashed rgba(30,74,113,.24); border-radius: 11px; color: #536b84; background: #f7fafc; font-size: 11px; }
.ledger-entry-head, .ledger-entry-row { display: grid; grid-template-columns: 100px 1.05fr 70px 1.5fr 85px 105px .75fr 110px; align-items: center; gap: 12px; }
.ledger-entry-head.entry-management, .ledger-entry-row.entry-management { grid-template-columns: 100px 1.05fr 70px 1.5fr 85px 105px .75fr 110px 105px; min-width: 850px; }
.ledger-entry-head { min-height: 43px; border-bottom: 1px solid rgba(30,74,113,.16); color: #4c6680; font: 600 9px var(--font-display); letter-spacing: .8px; text-transform: uppercase; }
.ledger-entry-row { min-height: 65px; border-bottom: 1px solid rgba(30,74,113,.12); color: #4d6680; font-size: 11px; }
.ledger-entry-row:last-child { border-bottom: 0; }
.balance-forward-row { background: rgba(231,247,252,.55); font-weight: 600; }
.ledger-entry-row strong { color: #153352; }
.ledger-entry-row .ledger-party-drilldown { color: #153352; }
.ledger-entry-description { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-entry-type, .ledger-entry-amount { font-weight: 600; }
.ledger-entry-type.credit, .ledger-entry-amount.credit { color: #16764d; }
.ledger-entry-type.debit, .ledger-entry-amount.debit { color: #b3394d; }
.ledger-entry-amount { text-align: right; }
.ledger-entry-empty { display: grid; min-height: 105px; place-items: center; color: #60758d; font-size: 11px; text-align: center; }
.ledger-entry-actions { display: flex; align-items: center; gap: 7px; }
.ledger-entry-actions button { padding: 5px 7px; border: 1px solid rgba(0,123,159,.25); border-radius: 6px; color: #007b9f; background: #eef8fc; font: 600 9px var(--font-display); cursor: pointer; }
.ledger-entry-actions .delete-entry-button { border-color: rgba(179,57,77,.24); color: #b3394d; background: #fff1f3; }
.ledger-entry-actions button:hover { filter: brightness(.96); }
.permanent-user-label { color: #007b9f; font: 700 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.source-drilldown { min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(0,123,159,.35); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.source-drilldown:hover, .source-drilldown:focus-visible { color: #007b9f; text-decoration-color: currentColor; outline: 0; }
.source-text-left { overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.source-text-right { text-align: right; }
.register-party-source { color: #153352; font-weight: 700; }
.register-amount-source { color: #153352; font-weight: 700; }
.source-voucher-modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; }
.source-voucher-backdrop { position: absolute; inset: 0; background: rgba(10,31,51,.64); backdrop-filter: blur(5px); }
.source-voucher-card { position: relative; width: min(960px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 27px; border: 1px solid rgba(164,205,235,.35); border-radius: 18px; background: #f8fbfe; box-shadow: 0 30px 90px rgba(6,27,46,.32); }
.source-voucher-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.source-voucher-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.source-voucher-heading h2 { margin: 8px 0 5px; color: #10263e; font: 600 24px var(--font-display); }
.source-voucher-heading p:last-child { margin: 0; color: #60758d; font-size: 10px; }
.source-voucher-content, .source-voucher-list { display: grid; gap: 12px; }
.source-voucher-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(220px, 2fr) auto; align-items: end; gap: 10px; margin: 0 0 16px; padding: 14px; border: 1px solid rgba(30,74,113,.14); border-radius: 12px; background: #eef5fa; }
.source-voucher-filters label { display: grid; gap: 6px; min-width: 0; }
.source-voucher-filters label > span { color: #536b84; font: 600 9px var(--font-display); letter-spacing: .55px; text-transform: uppercase; }
.source-voucher-filters input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid rgba(30,74,113,.24); border-radius: 8px; color: #10263e; background: #fff; font: 400 11px var(--font-body); }
.source-voucher-filters input:focus { border-color: #007b9f; outline: 0; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.source-voucher-filters .outline-button { min-height: 40px; white-space: nowrap; }
.source-voucher-filters p { grid-column: 1 / -1; margin: 0; color: #60758d; font-size: 10px; }
.source-voucher-entry { padding: 17px 18px; border: 1px solid rgba(30,74,113,.15); border-radius: 12px; background: #fff; }
.source-voucher-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(30,74,113,.1); }
.source-voucher-entry-head > div { display: grid; gap: 4px; }
.source-voucher-entry-head > div span, .source-voucher-grid span { color: #60758d; font: 600 8px var(--font-display); letter-spacing: .65px; text-transform: uppercase; }
.source-voucher-entry-head strong { color: #10263e; font-size: 12px; }
.source-voucher-entry-head > div .source-voucher-category { color: #007b9f; font: 700 14px/1.15 var(--font-display); letter-spacing: .3px; text-transform: uppercase; }
.source-voucher-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding-top: 14px; }
.source-voucher-grid > div { display: grid; gap: 5px; min-width: 0; }
.source-voucher-root-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(30,74,113,.16); border-radius: 12px; background: rgba(236,244,251,.76); }
.source-voucher-root-actions p { flex: 1 1 240px; margin: 0; color: #60758d; font-size: 11px; }
.source-voucher-delete { border-color: rgba(192,69,86,.35); color: #b2384c; background: rgba(192,69,86,.08); }
.source-voucher-delete:hover { border-color: rgba(192,69,86,.6); background: rgba(192,69,86,.14); }
.source-voucher-entry-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.source-voucher-entry-actions .outline-button { min-height: 34px; padding-inline: 11px; font-size: 10px; }
.source-voucher-grid strong { overflow-wrap: anywhere; color: #193653; font-size: 11px; }
.source-voucher-description { grid-column: span 3; }
.source-voucher-amount { text-align: right; }
.source-voucher-amount strong { color: #007b9f; font: 700 16px var(--font-display); }
.source-voucher-open { width: 100%; margin-top: 14px; }
.source-voucher-empty { padding: 36px 15px; color: #60758d; text-align: center; font-size: 11px; }
.entry-edit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.entry-edit-form label { display: grid; gap: 7px; }
.entry-edit-form label > span { color: #536b84; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.entry-edit-form input, .entry-edit-form select, .entry-edit-form textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; outline: 0; color: #10263e; background: #fff; font: 400 11px var(--font-body); }
.entry-edit-form textarea { resize: vertical; }
.entry-edit-form input:focus, .entry-edit-form select:focus, .entry-edit-form textarea:focus { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.entry-edit-wide { grid-column: 1 / -1; }
.entry-edit-actions { display: flex; justify-content: end; gap: 9px; }
body.source-voucher-open { overflow: hidden; }

.profit-loss-content { max-width: 1050px; margin: auto; padding: 62px 34px 80px; }
.profit-loss-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.profit-loss-heading h1 { margin: 12px 0 0; color: #10263e; font: 500 clamp(34px, 4vw, 48px) var(--font-display); letter-spacing: -2.5px; }
.profit-loss-dates { display: flex; gap: 9px; }
.profit-loss-dates label { display: grid; gap: 6px; color: #536b84; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.profit-loss-dates input { min-height: 40px; padding: 0 10px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; color: #10263e; background: #fff; outline: 0; font-size: 10px; }
.profit-loss-report { display: grid; gap: 18px; }
.profit-loss-section { padding: 25px 28px; }
.profit-loss-section h2 { margin: 0 0 18px; color: #10263e; font: 600 19px var(--font-display); }
.profit-loss-table { border-top: 1px solid rgba(30,74,113,.15); }
.profit-loss-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 15px; align-items: center; min-height: 53px; border-bottom: 1px solid rgba(30,74,113,.12); color: #486079; font-size: 11px; }
.profit-loss-row > :last-child { text-align: right; color: #153352; }
.profit-loss-source { color: #153352; font-weight: 700; }
.profit-loss-head { min-height: 39px; color: #60758d; font: 600 9px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.profit-loss-note { margin: 13px 0 0; color: #60758d; font-size: 10px; }
.profit-loss-note-source { color: #007b9f; font-weight: 700; }
.profit-loss-total, .profit-loss-net { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 17px 19px; border-radius: 11px; }
.profit-loss-total-source:first-child { font: 600 11px var(--font-display); text-transform: uppercase; letter-spacing: .7px; }
.profit-loss-total-source:last-child { font: 700 20px var(--font-display); }
.profit-loss-total.profit, .profit-loss-net.profit { color: #16764d; background: #e7f9ef; border: 1px solid rgba(22,118,77,.2); }
.profit-loss-total.loss, .profit-loss-net.loss { color: #b3394d; background: #fff0f2; border: 1px solid rgba(179,57,77,.2); }
.expense-list { display: grid; }
.expense-list > div { display: flex; justify-content: space-between; min-height: 43px; align-items: center; border-bottom: 1px solid rgba(30,74,113,.1); color: #486079; font-size: 11px; }
.expense-list strong { color: #153352; }
.expense-list .expense-total { min-height: 53px; border-bottom: 0; color: #10263e; font-weight: 700; }
.profit-loss-net { margin-top: 0; min-height: 105px; padding: 23px 28px; }
.profit-loss-net span { font: 600 9px var(--font-display); letter-spacing: 1.3px; }
.profit-loss-net h2 { margin: 6px 0 0; font: 600 22px var(--font-display); }
.profit-loss-net > strong { font: 700 clamp(24px, 4vw, 34px) var(--font-display); }
.profit-loss-net > div .profit-loss-net-source { margin-top: 6px; font: 600 22px var(--font-display); }
.profit-loss-net > .profit-loss-net-source { font: 700 clamp(24px, 4vw, 34px) var(--font-display); }
.profit-loss-empty { color: #b3394d; text-align: center; }

@media (max-width: 1400px) {
  .main-view { height: 100dvh; min-height: 100dvh; max-height: none; overflow-x: hidden; overflow-y: scroll; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  .main-header { padding: 20px 28px; }
  .main-header .business-details { display: none; }
  .main-content { padding: 60px 24px 130px; }
  .cash-voucher-content, .trade-content { padding: 45px 24px 60px; }
  .cash-voucher-heading, .trade-heading { align-items: start; flex-direction: column; gap: 18px; }
  .cash-voucher-heading h1, .trade-heading h1 { font-size: 36px; }
  .cash-voucher-heading .trade-date-field, .trade-heading .trade-date-field,
  .cash-voucher-heading .print-button, .trade-heading .register-button,
  .trade-heading .print-button { width: 100%; }
  .cash-voucher-form { padding: 22px 18px; }
  .cash-voucher-fields, .cash-voucher-extra-fields { grid-template-columns: 1fr; gap: 15px; }
  .cash-voucher-options-row { grid-template-columns: 1fr; gap: 15px; }
  .cash-voucher-extra-fields { margin-top: 16px; padding-top: 16px; }
  .cash-voucher-amount-field { grid-column: auto; }
  .cash-voucher-form-actions { align-items: stretch; flex-direction: column; margin-top: 21px; }
  .cash-voucher-form-actions .primary-button { width: 100%; }
  .trade-register-heading { align-items: stretch; flex-direction: column; }
  .trade-register-filters { width: 100%; }
  .trade-register-filters label { flex: 1; }
  .trade-register-filters input { width: 100%; }
  .trade-register-summary { display: grid; grid-template-columns: repeat(3, 1fr); }
  .trade-register-summary > div { min-width: 0; }
  .trade-section { padding: 21px 16px 16px; overflow: hidden; }
  .trade-row-labels { display: none; }
  .trade-row { padding: 15px 15px 0; }
  .trade-fields-line { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
  .trade-field { display: grid; gap: 6px; }
  .mobile-trade-label { display: block; color: #07111f; font: 800 11px var(--font-display); letter-spacing: .4px; text-transform: uppercase; }
  .trade-field input, .trade-field select { color: #050b12; font-size: 15px; font-weight: 700; }
  .trade-field input::placeholder { color: #364152; opacity: 1; }
  .trade-field input[readonly] { color: #050b12; background: #e5ebf0; }
  .trade-amount-line { grid-template-columns: 1fr auto; min-height: 47px; margin-top: 13px; padding: 0; }
  .trade-amount-line strong { color: #050b12; font-size: 18px; font-weight: 800; }
  .trade-amount-line small { grid-column: 1 / -1; grid-row: 2; margin-top: -10px; color: #2a3542; font-size: 11px; font-weight: 600; }
  .remove-trade-row { position: absolute; top: 10px; right: 9px; }
  .trade-summary { padding: 21px 16px 22px; }
  .trade-summary-heading { align-items: start; flex-direction: column; gap: 8px; }
  .trade-summary-grid { grid-template-columns: 1fr; }
  .trade-total-card, .trade-result-card { min-height: 70px; }
  .trade-post-actions { align-items: stretch; flex-direction: column; margin: -4px 0 20px; }
  .trade-post-actions .primary-button { width: 100%; }
  .freight-section { padding: 21px 16px 22px; }
  .freight-heading { align-items: start; flex-direction: column; gap: 8px; }
  .freight-note { text-align: left; }
  .freight-form { grid-template-columns: 1fr; }
  .freight-total, .freight-form .inline-message, .freight-form-actions { grid-column: 1; }
  .trade-field input, .trade-field select,
  .cash-voucher-form .field input, .cash-voucher-form .field select,
  .freight-field input, .freight-field select { font-size: 13px; font-weight: 600; }
  .trade-field > .mobile-trade-label, .cash-voucher-form .field > span,
  .freight-field > span { font-size: 10px; font-weight: 700; }
  .trade-amount-line strong { font-size: 16px; font-weight: 700; }
  .trade-amount-line small { font-size: 10px; }
  .trade-register-list { overflow-x: hidden; }
  .trade-register-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    min-width: 0;
    min-height: 0;
    padding: 12px 0;
    font-size: 12px;
    font-weight: 600;
  }
  .trade-register-head { display: none; }
  .trade-register-row > * {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }
  .trade-register-row > *::before {
    flex: 0 0 auto;
    color: #71869d;
    font: 700 9px var(--font-display);
    letter-spacing: .45px;
    text-transform: uppercase;
  }
  .trade-register-row > :nth-child(1)::before { content: "Date"; }
  .trade-register-row > :nth-child(2)::before { content: "Party"; }
  .trade-register-row > :nth-child(3)::before { content: "Voucher"; }
  .trade-register-row > :nth-child(4) { grid-column: 1 / -1; }
  .trade-register-row > :nth-child(4)::before { content: "Details"; align-self: flex-start; }
  .trade-register-row > :nth-child(5)::before { content: "Qty"; }
  .trade-register-row > :nth-child(6)::before { content: "Amount"; }
  .trade-register-row .register-details,
  .trade-register-row .register-party-source,
  .trade-register-row .register-amount-source {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
  .trade-register-row > :nth-child(6) { justify-content: space-between; text-align: right; }
  .trade-register-summary { gap: 7px; }
  .trade-register-summary > div { padding: 9px 8px; }
  .trade-register-summary span { font-size: 8px; }
  .trade-register-summary strong { font-size: 13px; font-weight: 700; }
  .profit-loss-content { padding: 45px 24px 60px; }
  .profit-loss-heading { align-items: start; flex-direction: column; gap: 18px; }
  .profit-loss-heading h1 { font-size: 36px; }
  .profit-loss-dates { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .profit-loss-dates label, .profit-loss-dates input { width: 100%; }
  .profit-loss-dates .print-button { grid-column: 1 / -1; width: 100%; }
  .profit-loss-section { padding: 20px 14px; overflow: hidden; }
  .profit-loss-table { min-width: 0; }
  .profit-loss-row {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .75fr) minmax(0, 1.1fr) minmax(0, .95fr);
    gap: 6px;
    min-height: 56px;
    font-size: 12px;
    font-weight: 600;
  }
  .profit-loss-row > * { min-width: 0; overflow-wrap: anywhere; }
  .profit-loss-row .source-text-left,
  .profit-loss-row .source-text-right {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }
  .profit-loss-head { min-height: 42px; font-size: 9px; font-weight: 700; }
  .profit-loss-note { font-size: 11px; }
  .expense-list > div { min-height: 48px; font-size: 13px; font-weight: 600; }
  .expense-list strong { font-weight: 700; }
  .profit-loss-total-source:first-child { font-size: 12px; font-weight: 700; }
  .profit-loss-total-source:last-child { font-size: 22px; }
  .source-voucher-modal { padding: 10px; }
  .source-voucher-card { max-height: calc(100vh - 20px); padding: 18px 15px; border-radius: 14px; }
  .source-voucher-heading { align-items: stretch; flex-direction: column; }
  .source-voucher-actions { grid-template-columns: 1fr; }
  .source-voucher-heading .outline-button { width: 100%; }
  .source-voucher-filters { grid-template-columns: 1fr 1fr; }
  .source-voucher-filters .source-voucher-search { grid-column: 1 / -1; }
  .source-voucher-filters .outline-button { grid-column: 1 / -1; width: 100%; }
  .source-voucher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-voucher-description { grid-column: 1 / -1; }
  .source-voucher-amount { text-align: left; }
  .circle-options { width: 100%; flex-direction: column; gap: 34px; margin-top: 48px; }
  .circle-option { flex: 0 0 auto; width: min(390px, 94vw); }
  .circle-option .circle-shell { inset: 3%; }
  .circle-trade .circle-shell { background: radial-gradient(circle at 30% 22%, #5bd7f5 0, #0b82b8 28%, #064a72 62%, #021f3d 100%); }
  .circle-cash .circle-shell { background: radial-gradient(circle at 29% 21%, #5ce0a1 0, #159565 28%, #07543f 62%, #022b2f 100%); }
  .circle-ledger .circle-shell { background: radial-gradient(circle at 29% 21%, #bd8aff 0, #7041b2 28%, #3b216f 62%, #1b103d 100%); }
  .circle-expenses .circle-shell { background: radial-gradient(circle at 29% 21%, #f37f96 0, #c13b58 28%, #76213b 62%, #390e24 100%); }
  .circle-profit-loss .circle-shell { background: radial-gradient(circle at 29% 21%, #ffc05b 0, #c67817 28%, #75400b 62%, #3b1d05 100%); }
  .circle-icon svg { width: 70px; height: 70px; }
  .circle-icon { color: #ffffff; }
  .circle-label { color: #ffffff; font-size: clamp(20px, 5.8vw, 26px); font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.75); }
  .circle-number { font-size: 12px; font-weight: 700; }
}

@media (max-width: 900px) {
  .landing-view { grid-template-columns: 1fr; gap: 60px; padding: 35px 34px 48px; }
  .hero-copy { margin-top: 0; }
  .location-line { margin-top: 70px; }
  .access-panel { justify-self: start; max-width: 560px; }
  .main-view { height: 100dvh; min-height: 100dvh; max-height: none; overflow-x: hidden; overflow-y: scroll; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  .circle-options { width: 100%; flex-direction: column; gap: 34px; margin-top: 48px; }
  .circle-option { flex: 0 0 auto; width: min(390px, 94vw); }
  .circle-option .circle-shell { inset: 3%; }
  .circle-icon svg { width: 70px; height: 70px; }
  .circle-label { font-size: clamp(20px, 5.8vw, 26px); font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.75); }
  .circle-number { font-size: 12px; font-weight: 700; }
  .business-details { display: none; }
}
@media (max-width: 700px) {
  .main-view { height: 100dvh; min-height: 100dvh; max-height: none; overflow-x: hidden; overflow-y: scroll; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  .landing-view { min-height: auto; padding: 27px 22px 35px; gap: 45px; }
  .hero-copy { margin-top: 75px; }
  .hero-copy h1 { font-size: clamp(48px, 14vw, 70px); letter-spacing: -4px; }
  .location-line { margin-top: 60px; }
  .access-panel { padding: 34px 24px; border-radius: 22px; }
  .access-panel h2 { font-size: 28px; }
  .auth-card { padding: 10px 5px 30px; }
  .auth-heading { margin-top: 52px; }
  .auth-side-note { display: none; }
  .workspace-header, .main-header { padding: 20px 22px; }
  .main-header { position: sticky; top: 0; z-index: 5; background: rgba(5, 12, 24, .82); backdrop-filter: blur(16px); }
  .workspace-header .outline-button[data-action="show-main"] { display: none; }
  .header-actions { gap: 0; }
  .admin-content { padding: 46px 18px 45px; }
  .page-intro { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px; }
  .page-intro h1 { font-size: 32px; }
  .user-count-badge { flex-shrink: 0; }
  .admin-data-tools { grid-column: 1 / -1; justify-items: stretch; }
  .admin-data-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-data-actions button { width: 100%; }
  .admin-data-actions .outline-button { white-space: normal; }
  .admin-grid { grid-template-columns: 1fr; }
  .surface-card { padding: 22px 18px; }
  .field-row { grid-template-columns: 1fr; }
  .business-profile-form { grid-template-columns: 1fr; }
  .business-profile-actions { grid-column: auto; }
  .business-profile-actions .primary-button { width: 100%; }
  .opening-balance-form { grid-template-columns: 1fr; }
  .opening-balance-heading { align-items: stretch; flex-direction: column; }
  .opening-balance-heading .outline-button { width: 100%; }
  .opening-balance-actions { grid-column: auto; }
  .opening-balance-actions .primary-button { width: 100%; }
  .user-row { grid-template-columns: 1fr auto; gap: 7px 12px; padding: 13px 0; }
  .user-row > .user-username { display: none; }
  .user-row > .user-status { grid-column: 1; }
  .row-actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .main-content { padding: 60px 18px 130px; }
  .main-title-wrap h1 { letter-spacing: -2px; }
  .circle-options { width: 100%; flex-direction: column; gap: 34px; margin-top: 48px; }
  .circle-option { flex: 0 0 auto; width: min(390px, 94vw); }
  .circle-option .circle-shell { inset: 3%; }
  .circle-icon svg { width: 70px; height: 70px; }
  .circle-label { font-size: clamp(20px, 5.8vw, 26px); font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.75); }
  .circle-number { font-size: 12px; font-weight: 700; }
  .main-footer { padding: 15px 22px; }
  .main-footer span:last-child { display: none; }
  .ledger-content { padding: 45px 18px 50px; }
  .ledger-heading { align-items: start; gap: 20px; }
  .ledger-heading h1 { font-size: 36px; }
  .party-list-card { padding: 0 18px; overflow-x: auto; }
  .party-list { min-width: 620px; }
  .admin-party-panel { padding: 18px; }
  .admin-party-panel-heading { align-items: stretch; flex-direction: column; }
  .admin-party-panel-heading > .primary-button { width: 100%; }
  .admin-party-actions { justify-content: flex-start; }
  .trade-content { padding: 45px 18px 50px; }
  .trade-heading { align-items: start; flex-direction: column; gap: 18px; }
  .trade-date-field { width: 100%; }
  .trade-heading .register-button { width: 100%; }
  .trade-register-heading { align-items: stretch; flex-direction: column; }
  .trade-register-filters { width: 100%; }
  .trade-register-filters label { flex: 1; }
  .trade-register-filters input { width: 100%; }
  .trade-register-summary { display: grid; grid-template-columns: repeat(3, 1fr); }
  .trade-register-summary > div { min-width: 0; }
  .trade-section { padding: 21px 16px 16px; overflow: hidden; }
  .trade-row-labels { display: none; }
  .trade-row { padding: 15px 15px 0; }
  .trade-fields-line { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
  .trade-field { display: grid; gap: 6px; }
  .mobile-trade-label { display: block; color: #07111f; font: 800 11px var(--font-display); letter-spacing: .4px; text-transform: uppercase; }
  .trade-amount-line { grid-template-columns: 1fr auto; min-height: 47px; margin-top: 13px; padding: 0; }
  .trade-amount-line strong { color: #050b12; font-size: 18px; font-weight: 800; }
  .trade-amount-line small { grid-column: 1 / -1; grid-row: 2; margin-top: -10px; color: #2a3542; font-size: 11px; font-weight: 600; }
  .remove-trade-row { position: absolute; top: 10px; right: 9px; }
  .trade-summary { padding: 21px 16px 22px; }
  .trade-summary-heading { align-items: start; flex-direction: column; gap: 8px; }
  .trade-summary-grid { grid-template-columns: 1fr; }
  .trade-total-card, .trade-result-card { min-height: 70px; }
  .trade-post-actions { align-items: stretch; flex-direction: column; margin: -4px 0 20px; }
  .trade-post-actions .primary-button { width: 100%; }
  .freight-section { padding: 21px 16px 22px; }
  .freight-heading { align-items: start; flex-direction: column; gap: 8px; }
  .freight-note { text-align: left; }
  .freight-form { grid-template-columns: 1fr; }
  .freight-total, .freight-form .inline-message, .freight-form-actions { grid-column: 1; }
  .ledger-entries-card { padding: 20px 17px 12px; overflow: visible; }
  .ledger-entries-heading { min-width: 0; }
  .ledger-party-selector { min-width: 0; }
  .ledger-entries-heading { grid-template-columns: 1fr; align-items: stretch; }
  .ledger-date-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .ledger-date-filters label, .ledger-date-filters input, #print-ledger { width: 100%; }
  .ledger-balance-summary { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-entry-list { min-width: 0; }
  .ledger-entry-head { display: none; }
  .ledger-entry-row,
  .ledger-entry-row.entry-management {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-width: 0;
    min-height: 0;
    margin-bottom: 10px;
    padding: 14px 13px;
    border: 1px solid rgba(30,74,113,.14);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(30,74,113,.06);
  }
  .ledger-entry-row:last-child { margin-bottom: 0; }
  .ledger-entry-row > * {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .ledger-entry-row > [data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: #71869d;
    font: 600 8px var(--font-display);
    letter-spacing: .55px;
    text-transform: uppercase;
  }
  .ledger-entry-row > [data-label="Details"] { grid-column: 1 / -1; }
  .ledger-entry-row > [data-label="Details"]::before { align-self: flex-start; }
  .ledger-entry-row > [data-label="Amount"] {
    grid-column: 1 / -1;
    margin-top: 3px;
    padding-top: 10px;
    border-top: 1px solid rgba(30,74,113,.1);
    color: #10263e;
    font-size: 15px;
  }
  .ledger-entry-row > [data-label="Actions"] {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 3px;
  }
  .ledger-entry-row > [data-label="Actions"]::before { margin-right: auto; }
  .ledger-entry-row .source-text-left { text-align: right; }
  .ledger-entry-row .source-text-right { text-align: right; }
  .ledger-entry-row .ledger-entry-description { white-space: normal; overflow: visible; text-overflow: clip; }
  .ledger-entry-row .ledger-entry-actions { display: flex; }
  .balance-forward-row > [data-label="Details"] { grid-column: 1 / -1; }
  .profit-loss-content { padding: 45px 18px 60px; }
  .profit-loss-heading { align-items: stretch; flex-direction: column; }
  .profit-loss-dates { display: grid; grid-template-columns: 1fr 1fr; }
  .profit-loss-dates input { width: 100%; }
  .profit-loss-section { padding: 20px 14px; overflow: hidden; }
  .profit-loss-table { min-width: 0; }
  .profit-loss-net { align-items: flex-start; gap: 15px; }
  .source-voucher-modal { padding: 10px; }
  .source-voucher-card { max-height: calc(100vh - 20px); padding: 18px 15px; border-radius: 14px; }
  .source-voucher-heading { align-items: stretch; flex-direction: column; }
  .source-voucher-actions { grid-template-columns: 1fr; }
  .source-voucher-heading .outline-button { width: 100%; }
  .source-voucher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-voucher-description { grid-column: 1 / -1; }
  .source-voucher-amount { text-align: left; }
  .entry-edit-form { grid-template-columns: 1fr; }
  .entry-edit-wide { grid-column: 1; }
  .entry-edit-actions { flex-direction: column-reverse; }
  .entry-edit-actions button { width: 100%; }
}
@media (max-height: 750px) and (min-width: 701px) {
  .hero-copy { margin-top: 11vh; }
  .location-line { margin-top: 9vh; }
  .main-content { padding-top: 55px; }
  .circle-options { margin-top: 38px; }
}

/* High-contrast workspace theme */
body {
  background: #e8f0f8;
  color: #10263e;
}
.app-bg {
  background: radial-gradient(ellipse at 18% 5%, #ffffff 0, transparent 35%), linear-gradient(135deg, #f6f9fc 0%, #e0ebf6 52%, #d3e2f1 100%);
}
.grid-glow {
  opacity: .32;
  background-image: linear-gradient(rgba(30, 72, 112, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(30, 72, 112, .09) 1px, transparent 1px);
}
.orb-one { background: #79c5ec; opacity: .12; }
.orb-two { background: #a786e4; opacity: .1; }
.orb-three { background: #52c9dd; opacity: .1; }
.brand-name { color: #153352; }
.eyebrow { color: #48617b; }
.accent-eyebrow { color: #007b9f; }
.hero-copy h1 { color: #0a2038; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
h1 em, .main-title-wrap em { -webkit-text-stroke-color: #41607d; }
.hero-description, .location-line { color: #3f5872; }
.location-pin svg { stroke: #007b9f; }
.access-panel {
  border-color: rgba(24, 65, 104, .24);
  background: rgba(255,255,255,.93);
  box-shadow: 0 24px 60px rgba(50, 87, 120, .18), inset 0 1px rgba(255,255,255,.95);
}
.panel-shine { background: #4ec4e5; opacity: .12; }
.panel-topline { color: #47617b; }
.access-panel h2 { color: #10263e; }
.panel-intro { color: #486079; }
.access-card {
  color: #112a45;
  background: rgba(231, 241, 250, .85);
  border-color: rgba(30, 74, 113, .2);
}
.access-card:hover { background: #f4f9fd; border-color: rgba(0, 126, 165, .6); }
.access-card-copy small, .arrow-icon { color: #4a637d; }
.panel-footnote { color: #4c647d; }
.auth-backdrop-glow { background: #6bbbdc; opacity: .13; }
.back-button, .text-button { color: #3f5a75; }
.back-button:hover, .text-button:hover { color: #007b9f; }
.auth-heading h2 { color: #10263e; }
.auth-description { color: #486079; }
.field { color: #334e6a; }
.field input, .field select {
  border-color: rgba(30, 74, 113, .26);
  background: rgba(255,255,255,.92);
  color: #10263e;
}
.field input::placeholder { color: #60758b; }
.field-icon { color: #42617d; }
.password-toggle { color: #3e5d79; }
.password-toggle:hover { color: #007b9f; }
.admin-hint { color: #4d657e; }
.auth-side-note { color: #3f5a75; }
.auth-side-note small { color: #536d87; }
.workspace-header, .main-header { border-bottom-color: rgba(30, 74, 113, .18); }
.outline-button {
  border-color: rgba(30, 74, 113, .28);
  background: rgba(255,255,255,.7);
  color: #294863;
}
.outline-button:hover { border-color: #007b9f; color: #006b8a; background: #f4fbff; }
.page-intro h1, .ledger-heading h1 { color: #10263e; }
.page-intro p { color: #486079; }
.surface-card {
  border-color: rgba(30, 74, 113, .2);
  background: rgba(255,255,255,.9);
  box-shadow: 0 18px 42px rgba(50, 87, 120, .12), inset 0 1px rgba(255,255,255,.95);
}
.card-heading h2 { color: #10263e; }
.card-heading p { color: #4e6780; }
.user-list { border-top-color: rgba(30, 74, 113, .16); }
.user-info strong, .party-name-cell strong { color: #193653; }
.user-info small, .user-username, .party-address, .party-phones { color: #4d667f; }
.user-status.inactive { color: #53677b; }
.row-actions button { color: #3b5b77; }
.row-actions button:hover { color: #007b9f; }
.business-details strong { color: #10263e; }
.business-details span, .signed-in-as { color: #4a637d; }
.main-title-wrap h1 { color: #10263e; }
.main-title-wrap p:last-child { color: #486079; }
.circle-number { color: #496580; }
.placeholder-toast {
  color: #12304d;
  border-color: rgba(0, 112, 151, .32);
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 25px rgba(50, 87, 120, .16);
}
.main-footer {
  color: #49647e;
  border-top-color: rgba(30, 74, 113, .18);
  background: rgba(255,255,255,.78);
}
.ledger-select-label { color: #294863; }
.ledger-filter {
  border-color: rgba(30, 74, 113, .28);
  background-color: #ffffff;
  color: #10263e;
}
.party-list-head { color: #4c6680; border-bottom-color: rgba(30, 74, 113, .16); }
.party-row { border-bottom-color: rgba(30, 74, 113, .12); color: #36536e; }
.party-kind.customer { color: #16764d; }
.party-kind.supplier { color: #7040a8; }

.trade-purchase-section {
  border-color: rgba(176, 48, 67, .34);
  background: #fff4f5;
}
.trade-purchase-section .trade-section-heading h2,
.trade-purchase-section .purchase-eyebrow { color: #9b2f42; font-weight: 700; }
.trade-purchase-section .trade-row {
  border-color: rgba(176, 48, 67, .2);
  background: #fffafb;
}
.trade-purchase-section .trade-row-labels { color: #8f4351; }
.trade-sale-section {
  border-color: rgba(15, 107, 67, .34);
  background: #effaf4;
}
.trade-sale-section .trade-section-heading h2,
.trade-sale-section .sale-eyebrow { color: #0b6840; font-weight: 700; }
.trade-sale-section .trade-row {
  border-color: rgba(15, 107, 67, .2);
  background: #f8fffb;
}
.trade-sale-section .trade-row-labels { color: #2e7658; }
.trade-purchase-section .trade-field > .mobile-trade-label { color: #8f2e42; }
.trade-sale-section .trade-field > .mobile-trade-label { color: #0b6840; }

.cash-voucher-content { max-width: 1000px; margin: auto; padding: 62px 34px 80px; }
.cash-voucher-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.cash-voucher-heading h1 { margin: 12px 0 9px; color: #10263e; font: 500 clamp(34px, 4vw, 48px) var(--font-display); letter-spacing: -2.5px; }
.cash-voucher-heading p:not(.eyebrow) { margin: 0; color: #486079; font-size: 13px; }
.cash-voucher-form { padding: 30px; }
.cash-voucher-fields, .cash-voucher-extra-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.expense-voucher-fields { grid-template-columns: 1fr; }
.cash-voucher-options-row { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.cash-voucher-party-field { grid-column: 1 / -1; }
.expense-voucher-details-field { grid-column: 1 / -1; }
.cash-voucher-extra-fields > .field:first-child { grid-column: 1 / -1; }
.cash-voucher-extra-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(30, 74, 113, .13); }
.cash-voucher-form .field { min-width: 0; }
.cash-voucher-form .field input, .cash-voucher-form .field select { min-height: 46px; border-color: rgba(30, 74, 113, .26); background: #fff; color: #10263e; }
.cash-voucher-form .field input:focus, .cash-voucher-form .field select:focus { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.cash-voucher-form .field textarea { box-sizing: border-box; width: 100%; min-height: 104px; padding: 12px 14px; border: 1px solid rgba(30, 74, 113, .26); border-radius: 11px; outline: 0; color: #10263e; background: #fff; font: 400 13px var(--font-body); resize: vertical; }
.cash-voucher-form .field textarea:focus { border-color: #007b9f; box-shadow: 0 0 0 3px rgba(0,123,159,.09); }
.cash-voucher-form .field textarea::placeholder { color: #71869d; }
.cash-voucher-form .field select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, #7790ae 50%), linear-gradient(135deg, #7790ae 50%, transparent 50%); background-position: calc(100% - 17px) 21px, calc(100% - 12px) 21px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.cash-voucher-amount-field { grid-column: 1 / -1; }
.cash-voucher-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 25px; padding-top: 21px; border-top: 1px solid rgba(30, 74, 113, .13); }
.cash-voucher-account-note { display: flex; align-items: center; gap: 9px; color: #536b84; font-size: 11px; line-height: 1.5; }
.cash-voucher-account-note strong { color: #16764d; }
.account-note-icon { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; color: #16764d; background: rgba(22,118,77,.11); font-weight: 700; }
.cash-voucher-form-actions .primary-button { min-width: 190px; }
.cash-voucher-form-actions .primary-button:disabled { cursor: not-allowed; opacity: .62; transform: none; box-shadow: none; }
.party-kind.cash { color: #007b9f; }
.party-form-card .inline-message { color: #b42318; background: #fff1f0; border-color: #e6aaa5; font-weight: 700; }
.party-form-card .inline-message.success { color: #137333; background: #eaf8ee; border-color: #9bd5ad; font-weight: 700; }

@media (max-width: 700px) {
  .cash-voucher-content { padding: 45px 18px 55px; }
  .cash-voucher-heading { align-items: start; flex-direction: column; gap: 18px; }
  .cash-voucher-heading h1 { font-size: 36px; }
  .cash-voucher-heading .trade-date-field { width: 100%; }
  .cash-voucher-form { padding: 22px 18px; }
  .cash-voucher-fields, .cash-voucher-extra-fields { grid-template-columns: 1fr; gap: 15px; }
  .cash-voucher-options-row { grid-template-columns: 1fr; gap: 15px; }
  .cash-voucher-extra-fields { margin-top: 16px; padding-top: 16px; }
  .cash-voucher-amount-field { grid-column: auto; }
  .cash-voucher-form-actions { align-items: stretch; flex-direction: column; margin-top: 21px; }
  .cash-voucher-form-actions .primary-button { width: 100%; }
}

/* 3D login access circles */
.access-actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.access-card {
  position: relative;
  flex: 0 0 clamp(112px, 15vw, 155px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 50%;
  color: #fff;
  text-align: center;
  transition: transform .28s ease, box-shadow .28s ease, filter .28s ease;
}
.access-card::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(255,255,255,.16);
  pointer-events: none;
}
.access-card::after {
  content: "";
  position: absolute;
  width: 72%;
  height: 34%;
  top: 3%;
  left: 10%;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255,255,255,.62), rgba(255,255,255,0));
  transform: rotate(-24deg);
  filter: blur(1px);
  opacity: .72;
  pointer-events: none;
}
.access-card-admin {
  background: radial-gradient(circle at 30% 22%, #b9f5ff 0, #36c5ed 28%, #087eaf 62%, #034066 100%) !important;
  box-shadow: inset -12px -16px 25px rgba(0,30,64,.38), inset 10px 10px 19px rgba(255,255,255,.27), 0 18px 28px rgba(5,104,153,.28);
}
.access-card-user {
  background: radial-gradient(circle at 30% 22%, #c6ffdf 0, #55d796 28%, #15835d 62%, #074534 100%) !important;
  box-shadow: inset -12px -16px 25px rgba(0,49,35,.38), inset 10px 10px 19px rgba(255,255,255,.27), 0 18px 28px rgba(11,119,79,.25);
}
.access-card:hover { transform: translateY(-8px) scale(1.04); filter: saturate(1.08); }
.access-card-admin:hover { box-shadow: inset -12px -16px 25px rgba(0,30,64,.38), inset 10px 10px 19px rgba(255,255,255,.27), 0 25px 38px rgba(5,104,153,.4); }
.access-card-user:hover { box-shadow: inset -12px -16px 25px rgba(0,49,35,.38), inset 10px 10px 19px rgba(255,255,255,.27), 0 25px 38px rgba(11,119,79,.38); }
.access-card:active { transform: translateY(-2px) scale(.98); }
.access-icon { position: relative; z-index: 1; width: 45px; height: 45px; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; color: #fff !important; background: rgba(255,255,255,.16) !important; box-shadow: inset 2px 3px 7px rgba(255,255,255,.3), 0 5px 10px rgba(0,0,0,.18); }
.access-icon svg { width: 23px; height: 23px; }
.access-card-copy { position: relative; z-index: 1; display: block; }
.access-card-copy strong { display: block; color: #fff; font: 700 clamp(13px, 1.4vw, 16px) var(--font-display); text-align: center; text-shadow: 0 2px 4px rgba(0,0,0,.3); white-space: nowrap; }
.arrow-icon { display: none; }

@media (max-width: 700px) {
  .access-actions { gap: 10px; }
  .access-card { flex-basis: clamp(112px, 31vw, 145px); padding: 14px; }
}

/* Landing screen: vertical 3D access controls */
.hero-copy h1 {
  color: #f8fcff;
  -webkit-text-stroke: 1px rgba(31, 83, 125, .45);
  text-shadow:
    1px 1px 0 #d1e5f2,
    2px 2px 0 #b0cbe0,
    3px 3px 0 #8eafca,
    4px 4px 0 #6e91b0,
    10px 14px 24px rgba(31, 75, 111, .28);
}
.access-actions { flex-direction: column; gap: 18px; }
.access-card { flex-basis: clamp(145px, 17vw, 175px); }

@media (max-width: 700px) {
  .access-actions { gap: 15px; }
  .access-card { flex-basis: clamp(135px, 42vw, 165px); }
}

.print-business-header,
.print-business-footer { display: none; }
.print-button { white-space: nowrap; align-self: end; }
.profit-loss-dates .print-button { min-height: 40px; }

@media (max-width: 700px) {
  .ledger-entries-heading { grid-template-columns: 1fr; }
  .ledger-date-filters { width: 100%; }
  .ledger-date-filters label { flex: 1; }
  .ledger-date-filters input { width: 100%; }
  .ledger-entries-heading .print-button,
  .trade-heading .print-button,
  .cash-voucher-heading .print-button { width: 100%; }
  .profit-loss-dates .print-button { grid-column: 1 / -1; width: 100%; }
}

/* Final mobile-first reflow: forms and navigation stay readable on phones. */
@media (max-width: 1400px) {
  html, body { overflow-x: hidden; }
  .app-shell, .view { width: 100%; min-width: 0; }
  button, input, select, textarea { font-size: 16px; }
  .outline-button, .danger-button { min-height: 46px; font-size: 14px; }
  .text-button { min-height: 42px; font-size: 14px; }
  .primary-button { min-height: 52px; font-size: 14px; }
  .workspace-header, .main-header { min-height: 72px; padding: 14px 18px; gap: 12px; }
  .workspace-header .header-actions, .main-header .main-header-actions {
    min-width: 0;
    gap: 8px 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .landing-view { grid-template-columns: 1fr; gap: 48px; min-height: auto; padding: 30px 18px 44px; }
  .landing-copy { padding-top: 0; }
  .hero-copy { margin-top: 34px; }
  .hero-copy h1 { font-size: clamp(42px, 13vw, 70px); letter-spacing: -4px; }
  .hero-description { max-width: none; font-size: 16px; }
  .location-line { margin-top: 48px; font-size: 14px; }
  .access-panel { justify-self: stretch; max-width: none; padding: 28px 20px; }
  .access-panel h2 { font-size: 30px; }
  .panel-intro { font-size: 15px; }
  .access-actions { gap: 14px; }
  .access-card {
    flex: 0 0 auto;
    width: min(180px, 48vw);
    aspect-ratio: 1;
    align-self: center;
    padding: 14px;
  }
  .access-card-copy strong { font-size: 15px; }

  .auth-view { align-items: start; padding: 25px 18px 45px; }
  .auth-card { width: min(100%, 520px); padding: 8px 0 30px; }
  .auth-heading { margin-top: 30px; }
  .auth-heading h2 { font-size: 30px; }
  .auth-description { margin: 15px 0 26px; font-size: 15px; }
  .auth-side-note { display: none; }
  .field { gap: 8px; font-size: 14px; }
  .field input, .field select { min-height: 52px; font-size: 16px; }
  .form-stack { gap: 18px; }
  .form-actions { flex-direction: column; gap: 10px; }
  .form-actions button { width: 100%; }

  .admin-content { max-width: none; padding: 42px 18px 55px; }
  .page-intro {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 26px;
  }
  .page-intro h1 { font-size: 34px; }
  .page-intro p { font-size: 15px; line-height: 1.5; }
  .user-count-badge { align-self: flex-start; text-align: left; }
  .admin-data-tools { width: 100%; justify-items: stretch; }
  .admin-data-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .admin-data-actions button { width: 100%; }
  .admin-data-actions .outline-button { white-space: normal; }
  .admin-grid { grid-template-columns: 1fr; gap: 18px; }
  .surface-card { padding: 22px 18px; border-radius: 17px; }
  .card-heading { align-items: flex-start; margin-bottom: 22px; }
  .card-heading h2 { font-size: 20px; }
  .card-heading p { font-size: 14px; line-height: 1.45; }
  .business-profile-form, .opening-balance-form, .party-form { grid-template-columns: 1fr; }
  .business-profile-actions, .opening-balance-actions, .party-form-actions { grid-column: auto; }
  .business-profile-actions .primary-button,
  .opening-balance-actions .primary-button,
  .party-form-actions button { width: 100%; }
  .opening-balance-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .opening-balance-heading .outline-button { width: 100%; }
  .user-row { grid-template-columns: 1fr auto; gap: 8px 12px; min-height: 0; padding: 15px 0; }
  .user-row > .user-username { display: none; }
  .user-row > .user-status { grid-column: 1; }
  .row-actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .user-info strong { font-size: 14px; }
  .user-info small, .user-status { font-size: 12px; }
  .row-actions button { font-size: 13px; }

  .main-content { max-width: none; padding: 54px 18px 130px; }
  .main-title-wrap h1 { font-size: clamp(36px, 10vw, 52px); letter-spacing: -2px; }
  .main-title-wrap p:last-child { font-size: 15px; }
  .circle-options { width: 100%; flex-direction: column; gap: 28px; margin-top: 42px; }
  .circle-option { width: min(390px, 94vw); }
  .circle-label { font-size: clamp(20px, 5.8vw, 26px); font-weight: 700; }

  .cash-voucher-content, .trade-content, .ledger-content, .profit-loss-content {
    max-width: none;
    padding: 40px 18px 60px;
  }
  .cash-voucher-heading, .trade-heading, .ledger-heading, .profit-loss-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
  }
  .cash-voucher-heading h1, .trade-heading h1,
  .ledger-heading h1, .profit-loss-heading h1 { font-size: 36px; }
  .cash-voucher-heading p:not(.eyebrow), .trade-summary-note,
  .freight-note, .profit-loss-note { font-size: 14px; line-height: 1.5; }
  .cash-voucher-heading .trade-date-field, .trade-heading .trade-date-field,
  .cash-voucher-heading .print-button, .trade-heading .register-button,
  .trade-heading .print-button, .ledger-heading .primary-button { width: 100%; }

  .cash-voucher-form { padding: 20px 16px; }
  .cash-voucher-fields, .cash-voucher-extra-fields,
  .cash-voucher-options-row { grid-template-columns: 1fr; gap: 16px; }
  .cash-voucher-extra-fields { margin-top: 16px; padding-top: 16px; }
  .cash-voucher-form .field > span,
  .freight-field > span { color: #111827; font-size: 14px; font-weight: 700; }
  .cash-voucher-form .field input, .cash-voucher-form .field select,
  .freight-field input, .freight-field select {
    min-height: 52px;
    color: #050b12;
    font-size: 16px;
    font-weight: 600;
  }
  .cash-voucher-form-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
  }
  .cash-voucher-account-note { align-items: flex-start; font-size: 14px; }
  .cash-voucher-form-actions .primary-button { width: 100%; }

  .trade-section, .trade-summary, .freight-section { padding: 20px 15px; }
  .trade-section-heading, .trade-summary-heading, .freight-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .trade-section-heading h2, .trade-summary-heading h2,
  .freight-heading h2 { font-size: 23px; }
  .add-row-button { width: 100%; }
  .trade-fields-line { grid-template-columns: 1fr; gap: 16px; }
  .trade-field { gap: 7px; }
  .trade-field > .mobile-trade-label {
    color: #07111f;
    font: 800 14px var(--font-display);
    letter-spacing: .25px;
  }
  .trade-field input, .trade-field select {
    min-height: 52px;
    color: #050b12;
    font-size: 16px;
    font-weight: 700;
  }
  .trade-field input::placeholder { color: #364152; opacity: 1; }
  .trade-amount-line { grid-template-columns: 1fr auto; min-height: 58px; margin-top: 15px; }
  .trade-amount-line strong { color: #050b12; font-size: 20px; font-weight: 800; }
  .trade-amount-line small { color: #2a3542; font-size: 12px; }
  .trade-post-actions { align-items: stretch; flex-direction: column; }
  .trade-post-actions .primary-button { width: 100%; }
  .freight-form { grid-template-columns: 1fr; gap: 16px; }
  .freight-total, .freight-form .inline-message, .freight-form-actions { grid-column: 1; }
  .freight-total { min-height: 62px; }
  .freight-total span { font-size: 13px; }
  .freight-total strong { font-size: 22px; }
}

/* Final mobile-first reflow: lists and reports become readable cards. */
@media (max-width: 1400px) {
  .trade-register-panel { padding: 20px 15px; }
  .trade-register-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .trade-register-filters label { font-size: 12px; }
  .trade-register-filters input { width: 100%; min-height: 48px; font-size: 15px; }
  .trade-register-summary { grid-template-columns: 1fr 1fr; }
  .trade-register-summary > div { min-width: 0; padding: 11px 10px; }
  .trade-register-summary span { font-size: 10px; }
  .trade-register-summary strong { font-size: 15px; }
  .trade-register-row { font-size: 14px; font-weight: 600; }
  .trade-register-row > *::before { font-size: 10px; font-weight: 800; }

  .party-form { gap: 16px; }
  .party-form-actions { flex-direction: column-reverse; gap: 10px; }
  .party-list-card { padding: 0 18px; overflow: hidden; }
  .party-list { min-width: 0; }
  .party-list-head { display: none; }
  .party-row {
    grid-template-columns: 1fr auto;
    gap: 9px 12px;
    min-height: 0;
    padding: 15px 0;
  }
  .party-row > :nth-child(2) { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .party-row > :nth-child(3) { grid-column: 1 / -1; }
  .party-address, .party-phones { white-space: normal; font-size: 13px; }

  .ledger-entries-card { padding: 20px 16px 12px; overflow: visible; }
  .ledger-entries-heading { grid-template-columns: 1fr; align-items: stretch; }
  .ledger-date-filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .ledger-date-filters label { font-size: 12px; }
  .ledger-date-filters input, #print-ledger { width: 100%; min-height: 48px; font-size: 15px; }
  .ledger-party-filter-label { font-size: 12px; }
  .ledger-party-trigger, .ledger-party-search { min-height: 50px; font-size: 16px; }
  .ledger-balance-summary { grid-template-columns: 1fr 1fr; }
  .ledger-balance-card span { font-size: 10px; }
  .ledger-balance-card strong { font-size: 19px; }
  .ledger-entry-head { display: none; }
  .ledger-entry-list { min-width: 0; }
  .ledger-entry-row,
  .ledger-entry-row.entry-management {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    min-width: 0;
    min-height: 0;
    margin-bottom: 10px;
    padding: 15px 13px;
    border: 1px solid rgba(30,74,113,.14);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(30,74,113,.06);
    font-size: 14px;
    font-weight: 600;
  }
  .ledger-entry-row > * {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .ledger-entry-row > [data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: #536b84;
    font: 800 10px var(--font-display);
    letter-spacing: .4px;
    text-transform: uppercase;
  }
  .ledger-entry-row > [data-label="Details"],
  .ledger-entry-row > [data-label="Amount"],
  .ledger-entry-row > [data-label="Actions"] { grid-column: 1 / -1; }
  .ledger-entry-row > [data-label="Details"]::before { align-self: flex-start; }
  .ledger-entry-row > [data-label="Amount"] {
    margin-top: 3px;
    padding-top: 11px;
    border-top: 1px solid rgba(30,74,113,.1);
    color: #10263e;
    font-size: 18px;
  }
  .ledger-entry-row > [data-label="Actions"] { justify-content: flex-end; padding-top: 4px; }
  .ledger-entry-row > [data-label="Actions"]::before { margin-right: auto; }
  .ledger-entry-row .source-text-left,
  .ledger-entry-row .source-text-right,
  .ledger-entry-row .ledger-entry-description {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }
  .ledger-entry-actions { display: flex; }
  .ledger-entry-actions button { min-height: 42px; font-size: 13px; }

  .profit-loss-dates { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .profit-loss-dates label { font-size: 12px; }
  .profit-loss-dates input { width: 100%; min-height: 48px; font-size: 15px; }
  .profit-loss-dates .print-button { grid-column: 1 / -1; width: 100%; }
  .profit-loss-section { padding: 20px 14px; overflow: hidden; }
  .profit-loss-table { min-width: 0; }
  .profit-loss-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 11px 0;
    font-size: 14px;
    font-weight: 600;
  }
  .profit-loss-head { display: none; }
  .profit-loss-row > * {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    overflow-wrap: anywhere;
  }
  .profit-loss-row > *::before {
    flex: 0 0 auto;
    color: #536b84;
    font: 800 10px var(--font-display);
    letter-spacing: .4px;
    text-transform: uppercase;
  }
  .profit-loss-row > :nth-child(1)::before { content: "Type"; }
  .profit-loss-row > :nth-child(2)::before { content: "Qty"; }
  .profit-loss-row > :nth-child(3)::before { content: "Average Rate"; }
  .profit-loss-row > :nth-child(4)::before { content: "Amount"; }
  .profit-loss-row .source-text-left,
  .profit-loss-row .source-text-right {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }
  .profit-loss-row > :nth-child(4) { color: #10263e; font-weight: 800; }
  .profit-loss-note { font-size: 13px; }
  .expense-list > div { min-height: 52px; font-size: 14px; font-weight: 600; }
  .expense-list strong { font-weight: 800; }
  .profit-loss-total-source:first-child { font-size: 13px; font-weight: 800; }
  .profit-loss-total-source:last-child { font-size: 24px; }
  .profit-loss-net { align-items: flex-start; gap: 15px; }

  .source-voucher-modal { padding: 10px; }
  .source-voucher-card { max-height: calc(100vh - 20px); padding: 18px 15px; border-radius: 14px; }
  .source-voucher-heading { align-items: stretch; flex-direction: column; }
  .source-voucher-heading .outline-button { width: 100%; }
  .source-voucher-grid { grid-template-columns: 1fr 1fr; }
  .source-voucher-description { grid-column: 1 / -1; }
  .source-voucher-amount { text-align: left; }
  .entry-edit-form { grid-template-columns: 1fr; }
  .entry-edit-wide { grid-column: 1; }
  .entry-edit-actions { flex-direction: column-reverse; }
  .entry-edit-actions button { width: 100%; }
}

/* Compact entry controls with larger text: readability wins over forced squeezing. */
@media (max-width: 1400px) {
  .source-voucher-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-voucher-filters .source-voucher-search,
  .source-voucher-filters .outline-button { grid-column: 1 / -1; }
  .source-voucher-filters .outline-button { width: 100%; }
  .field input,
  .field select,
  .trade-date-field input,
  .trade-field input,
  .trade-field select,
  .freight-field input,
  .freight-field select,
  .entry-edit-form input,
  .entry-edit-form select,
  .entry-edit-form textarea,
  .ledger-party-search,
  .ledger-party-trigger {
    box-sizing: border-box;
    width: 65%;
    min-width: min(200px, 100%);
    max-width: 100%;
    font-size: 18px;
    font-weight: 700;
  }
  .field > span,
  .trade-date-field > span,
  .trade-field > .mobile-trade-label,
  .freight-field > span,
  .entry-edit-form label > span,
  .ledger-party-filter-label {
    font-size: 16px;
    font-weight: 800;
  }
  .field input,
  .field select,
  .trade-date-field input,
  .trade-field input,
  .trade-field select,
  .freight-field input,
  .freight-field select,
  .ledger-party-search,
  .ledger-party-trigger {
    min-height: 56px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .field input::placeholder,
  .trade-field input::placeholder,
  .freight-field input::placeholder,
  .ledger-party-search::placeholder {
    font-size: 16px;
    font-weight: 600;
  }
  .field select,
  .trade-field select,
  .freight-field select,
  .entry-edit-form select {
    white-space: nowrap;
  }
  .entry-edit-form textarea {
    min-height: 116px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .trade-date-field input,
  .ledger-date-filters input,
  .profit-loss-dates input,
  .trade-register-filters input {
    font-size: 17px;
    font-weight: 700;
  }
  .cash-voucher-form .field input,
  .cash-voucher-form .field select {
    box-sizing: border-box;
    width: 65%;
    min-width: min(200px, 100%);
    max-width: 100%;
    min-height: 56px;
    font-size: 18px;
    font-weight: 700;
  }
  .cash-voucher-form .field textarea {
    width: 100%;
    min-height: 116px;
    font-size: 18px;
    font-weight: 700;
  }
  .cash-voucher-form .field > span { font-size: 16px; font-weight: 800; }
  .trade-amount-line strong,
  .freight-total strong,
  .trade-total-card strong,
  .trade-result-card strong {
    font-size: 22px;
    font-weight: 800;
  }
  .trade-amount-line small { font-size: 13px; font-weight: 700; }
  .ledger-date-filters input,
  .profit-loss-dates input,
  .trade-register-filters input {
    width: 100%;
    min-width: 0;
  }
  .ledger-date-filters label,
  .profit-loss-dates label,
  .trade-register-filters label {
    font-size: 14px;
    font-weight: 800;
  }
}

/* One consistent mobile sizing system for every visible entry control. */
@media (max-width: 1400px) {
  .field-row,
  .ledger-date-filters,
  .profit-loss-dates,
  .trade-register-filters {
    grid-template-columns: 1fr;
  }
  .view input:not([type="hidden"]):not([type="checkbox"]):not([type="file"]),
  .view select,
  .view textarea,
  .view .ledger-party-trigger {
    box-sizing: border-box;
    width: 65%;
    min-width: min(200px, 100%);
    max-width: 100%;
    min-height: 56px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
  }
  .view input:not([type="hidden"]):not([type="checkbox"]):not([type="file"])::placeholder,
  .view textarea::placeholder {
    font-size: 16px;
    font-weight: 600;
  }
  .view select {
    white-space: nowrap;
  }
  .view textarea {
    min-height: 116px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .view .field,
  .view .trade-date-field,
  .view .trade-field,
  .view .freight-field,
  .view .entry-edit-form label,
  .view .ledger-party-selector > label {
    gap: 10px;
  }
  .view .field > span,
  .view .trade-date-field > span,
  .view .trade-field > .mobile-trade-label,
  .view .freight-field > span,
  .view .entry-edit-form label > span,
  .view .ledger-party-filter-label,
  .view .ledger-date-filters label,
  .view .profit-loss-dates label,
  .view .trade-register-filters label {
    font-size: 16px;
    font-weight: 800;
  }
  .view .trade-amount-line strong,
  .view .freight-total strong,
  .view .trade-total-card strong,
  .view .trade-result-card strong {
    font-size: 22px;
    font-weight: 800;
  }
  .view .trade-amount-line small { font-size: 13px; font-weight: 700; }
}

/* Trade register readability: date gets room, register values stay prominent. */
.trade-register-row {
  grid-template-columns: 132px 1.15fr 1.35fr 2fr 100px 130px;
  font-size: 13px;
  font-weight: 650;
}
.trade-register-head {
  font-size: 11px;
  font-weight: 800;
}
.trade-register-summary span { font-size: 10px; font-weight: 700; }
.trade-register-summary strong { font-size: 17px; font-weight: 800; }
.trade-register-row > :first-child {
  min-width: 0;
  white-space: nowrap;
}
.add-row-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 150px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .1px;
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .trade-register-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    font-size: 16px;
    font-weight: 700;
  }
  .trade-register-row > :first-child {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 18px;
    white-space: nowrap;
  }
  .trade-register-row > :first-child::before {
    flex: 0 0 auto;
    color: #536b84;
    font: 800 12px var(--font-display);
    letter-spacing: .4px;
    text-transform: uppercase;
  }
  .trade-register-row > :first-child::before { content: "Date"; }
  .trade-register-row > *::before { font-size: 12px; }
  .trade-register-summary strong { font-size: 18px; }
  .add-row-button {
    align-self: flex-start;
    width: max-content;
    min-width: 150px;
    min-height: 54px;
    font-size: 18px;
    font-weight: 800;
  }
}

/* Deep, high-contrast colors for the mobile New Trade Voucher entry screen only. */
@media (max-width: 1400px) {
  #trade-view .trade-purchase-section {
    border: 2px solid #5f1324;
    background: #741b2d;
    color: #fff;
  }
  #trade-view .trade-purchase-section .trade-section-heading h2,
  #trade-view .trade-purchase-section .purchase-eyebrow,
  #trade-view .trade-purchase-section .trade-row-labels,
  #trade-view .trade-purchase-section .mobile-trade-label,
  #trade-view .trade-purchase-section .trade-amount-line strong,
  #trade-view .trade-purchase-section .trade-amount-line small {
    color: #fff;
    font-weight: 800;
  }
  #trade-view .trade-purchase-section .trade-row {
    border-color: #b84d61;
    background: #8f2940;
  }
  #trade-view .trade-purchase-section .trade-amount-line {
    border-top-color: rgba(255, 255, 255, .42);
  }
  #trade-view .trade-purchase-section .trade-field input,
  #trade-view .trade-purchase-section .trade-field select {
    border-color: #efb2bd;
    color: #07111f;
    background: #fff;
    font-weight: 800;
  }
  #trade-view .trade-purchase-section .trade-field input::placeholder {
    color: #39404a;
    opacity: 1;
  }

  #trade-view .trade-sale-section {
    border: 2px solid #043b25;
    background: #075a37;
    color: #fff;
  }
  #trade-view .trade-sale-section .trade-section-heading h2,
  #trade-view .trade-sale-section .sale-eyebrow,
  #trade-view .trade-sale-section .trade-row-labels,
  #trade-view .trade-sale-section .mobile-trade-label,
  #trade-view .trade-sale-section .trade-amount-line strong,
  #trade-view .trade-sale-section .trade-amount-line small {
    color: #fff;
    font-weight: 800;
  }
  #trade-view .trade-sale-section .trade-row {
    border-color: #4bb17c;
    background: #087346;
  }
  #trade-view .trade-sale-section .trade-amount-line {
    border-top-color: rgba(255, 255, 255, .42);
  }
  #trade-view .trade-sale-section .trade-field input,
  #trade-view .trade-sale-section .trade-field select {
    border-color: #9ad9b9;
    color: #07111f;
    background: #fff;
    font-weight: 800;
  }
  #trade-view .trade-sale-section .trade-field input::placeholder {
    color: #39404a;
    opacity: 1;
  }

  #trade-view .trade-summary,
  #trade-view .freight-section {
    border: 2px solid #124b70;
    background: #155777;
    color: #fff;
  }
  #trade-view .trade-summary-heading h2,
  #trade-view .trade-summary-note,
  #trade-view .freight-heading h2,
  #trade-view .freight-note,
  #trade-view .freight-field > span {
    color: #fff;
    font-weight: 800;
  }
  #trade-view .trade-total-card,
  #trade-view .trade-result-card {
    border-color: #62b8cf;
    background: #1b6b8c;
  }
  #trade-view .trade-total-card span,
  #trade-view .trade-result-card span,
  #trade-view .trade-total-card strong,
  #trade-view .trade-result-card strong,
  #trade-view .trade-result-card small {
    color: #fff;
    font-weight: 800;
  }
  #trade-view .freight-field input,
  #trade-view .freight-field select {
    border-color: #9bd4e4;
    color: #07111f;
    background: #fff;
    font-weight: 800;
  }
  #trade-view .freight-total {
    border-color: #83d4aa;
    background: #08613c;
  }
  #trade-view .freight-total span,
  #trade-view .freight-total strong {
    color: #fff;
    font-weight: 800;
  }
}

/* P&L readability only: preserve the existing report structure and order. */
#profit-loss-view .profit-loss-row {
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
}
#profit-loss-view .profit-loss-row > :first-child,
#profit-loss-view .profit-loss-row > :first-child.source-text-left {
  min-width: 0;
  text-align: left;
}
#profit-loss-view .profit-loss-row > :nth-child(2),
#profit-loss-view .profit-loss-row > :nth-child(3),
#profit-loss-view .profit-loss-row > :nth-child(4),
#profit-loss-view .profit-loss-row > .source-text-right {
  min-width: 0;
  text-align: right;
}
#profit-loss-view .profit-loss-head {
  font-size: 11px;
  font-weight: 800;
}
#profit-loss-view .profit-loss-head > :first-child { text-align: left; }
#profit-loss-view .profit-loss-head > :nth-child(n + 2) { text-align: right; }
#profit-loss-view .profit-loss-note {
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}
#profit-loss-view .expense-list > div {
  gap: 12px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
}
#profit-loss-view .expense-list .source-text-left {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}
#profit-loss-view .expense-list .source-text-right {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
}
#profit-loss-view .profit-loss-total,
#profit-loss-view .profit-loss-net {
  gap: 12px;
}
#profit-loss-view .profit-loss-total-source:first-child,
#profit-loss-view .profit-loss-net > div {
  min-width: 0;
  text-align: left;
}
#profit-loss-view .profit-loss-total-source:last-child,
#profit-loss-view .profit-loss-net > .profit-loss-net-source {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
}

@media (max-width: 1400px) {
  #profit-loss-view .profit-loss-section { padding: 18px 12px; }
  #profit-loss-view .profit-loss-row {
    gap: 5px;
    font-size: 14px;
    font-weight: 700;
  }
  #profit-loss-view .profit-loss-head {
    font-size: 10px;
    font-weight: 800;
  }
  #profit-loss-view .expense-list > div {
    min-height: 46px;
    font-size: 14px;
    font-weight: 700;
  }
  #profit-loss-view .profit-loss-total,
  #profit-loss-view .profit-loss-net {
    padding: 14px 15px;
    gap: 10px;
  }
}

@media (max-width: 700px) {
  #profit-loss-view .profit-loss-row {
    gap: 3px;
    padding: 7px 0;
    font-size: 15px;
    font-weight: 700;
  }
  #profit-loss-view .profit-loss-row > * {
    justify-content: space-between;
    gap: 8px;
    line-height: 1.3;
    text-align: right;
  }
  #profit-loss-view .profit-loss-row > :first-child {
    text-align: left;
  }
  #profit-loss-view .profit-loss-row > *::before {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 800;
  }
  #profit-loss-view .expense-list > div {
    min-height: 45px;
    font-size: 15px;
    font-weight: 700;
  }
  #profit-loss-view .profit-loss-note {
    margin-top: 10px;
    font-size: 13px;
  }
  #profit-loss-view .profit-loss-total,
  #profit-loss-view .profit-loss-net {
    margin-top: 12px;
    padding: 14px 15px;
  }
  #profit-loss-view .profit-loss-total-source:first-child {
    font-size: 14px;
    font-weight: 800;
  }
  #profit-loss-view .profit-loss-total-source:last-child {
    font-size: 23px;
    font-weight: 800;
  }
  #profit-loss-view .profit-loss-net {
    min-height: 88px;
  }
}

/* Use the available mobile column for New Trade Voucher fields only. */
@media (max-width: 1400px) {
  #trade-view .trade-date-field input,
  #trade-view .trade-field input,
  #trade-view .trade-field select,
  #trade-view .freight-field input,
  #trade-view .freight-field select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 20px;
    font-weight: 800;
  }
  #trade-view .trade-date-field > span,
  #trade-view .trade-field > .mobile-trade-label,
  #trade-view .freight-field > span {
    font-size: 18px;
    font-weight: 800;
  }
  #trade-view .trade-heading h1 { font-size: 41px; }
  #trade-view .trade-section-heading h2,
  #trade-view .freight-heading h2 { font-size: 26px; }
  #trade-view .trade-amount-line strong {
    font-size: 25px;
    font-weight: 800;
  }
  #trade-view .trade-amount-line small {
    font-size: 15px;
    font-weight: 800;
  }
}

/* Keep the existing P&L rows readable on narrow screens: label left, value right. */
@media (max-width: 700px) {
  #profit-loss-view .profit-loss-row > * {
    display: grid;
    grid-template-columns: minmax(86px, .7fr) minmax(0, 1.5fr);
    align-items: baseline;
    justify-content: initial;
    gap: 3px 8px;
    text-align: right;
  }
  #profit-loss-view .profit-loss-row > *::before {
    grid-column: 1;
    align-self: start;
    margin: 0;
    text-align: left;
  }
  #profit-loss-view .profit-loss-row > :first-child {
    text-align: right;
  }
  #profit-loss-view .profit-loss-row .source-text-left,
  #profit-loss-view .profit-loss-row .source-text-right {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Never render a surrounding login panel, including with cached older markup. */
.access-panel {
  display: contents !important;
}
.panel-shine {
  display: none !important;
}

/* Show only the two access circles in mobile-style layouts. */
@media (max-width: 1400px) {
  .landing-view {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .landing-view .access-actions {
    width: 100%;
    margin: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: clamp(6px, 2vw, 18px);
  }
  .landing-view .access-card {
    flex: 0 0 auto;
    width: min(460px, 44vw, 46vh) !important;
    min-width: 0;
    max-width: 460px;
    height: min(460px, 44vw, 46vh) !important;
    aspect-ratio: 1;
    border-radius: 50%;
    padding: clamp(12px, 2.2vw, 24px);
  }
  .landing-view .access-icon {
    width: clamp(52px, 10vw, 100px);
    height: clamp(52px, 10vw, 100px);
  }
  .landing-view .access-icon svg {
    width: clamp(27px, 5vw, 50px);
    height: clamp(27px, 5vw, 50px);
  }
  .landing-view .access-card-copy strong {
    font-size: clamp(14px, 3vw, 28px);
    font-weight: 800;
  }
}

/* Arrange six workspace circles in two centered rows on wide screens. */
.main-view .circle-options {
  max-width: 850px;
  margin-right: auto;
  margin-left: auto;
  flex-wrap: wrap;
  gap: 24px 26px;
}
.main-view .circle-option {
  flex: 0 0 clamp(190px, 15vw, 220px);
  width: clamp(190px, 15vw, 220px);
}
.main-view .circle-option .circle-shell {
  inset: 3%;
}
.main-view .circle-icon svg {
  width: 78px;
  height: 78px;
}
.main-view .circle-label {
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 800;
}

@media (max-width: 1400px) {
  .main-view .circle-options {
    gap: 20px;
  }
  .main-view .circle-option {
    width: min(460px, 94vw) !important;
  }
  .main-view .circle-icon svg {
    width: 96px;
    height: 96px;
  }
  .main-view .circle-label {
    font-size: clamp(26px, 7vw, 34px);
  }
}

/* Narrower, more readable New Trade Voucher entry columns on mobile. */
@media (max-width: 1400px) {
  #trade-view .trade-date-field {
    width: 86%;
    min-width: 0;
    margin-right: auto;
    margin-left: auto;
  }
  #trade-view .trade-row {
    box-sizing: border-box;
    width: 86%;
    margin-right: auto;
    margin-left: auto;
  }
  #trade-view .trade-fields-line {
    width: 100%;
  }
  #trade-view .trade-date-field input,
  #trade-view .trade-field input,
  #trade-view .trade-field select {
    width: 100%;
    min-width: 0;
    min-height: 64px;
    font-size: 23px;
    font-weight: 800;
  }
  #trade-view .trade-field input::placeholder {
    font-size: 21px;
    font-weight: 700;
  }
  #trade-view .trade-date-field > span,
  #trade-view .trade-field > .mobile-trade-label {
    font-size: 21px;
    font-weight: 800;
  }
}

/* Compact, readable Trial Balance summary and Ledger cards on mobile only. */
@media (max-width: 1400px) {
  #ledger-view .ledger-entries-heading,
  #ledger-view .ledger-party-selector,
  #ledger-view .ledger-balance-summary,
  #ledger-view .ledger-entry-list {
    box-sizing: border-box;
    width: 86%;
    min-width: 0;
    margin-right: auto;
    margin-left: auto;
  }
  #ledger-view .ledger-entries-heading {
    gap: 16px;
  }
  #ledger-view .ledger-entries-heading h2 {
    font-size: 26px;
    font-weight: 800;
  }
  #ledger-view .ledger-date-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  #ledger-view .ledger-date-filters label,
  #ledger-view .ledger-party-filter-label {
    font-size: 16px;
    font-weight: 800;
  }
  #ledger-view .ledger-date-filters input,
  #ledger-view .ledger-party-trigger,
  #ledger-view .ledger-party-search,
  #ledger-view #print-ledger {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    font-size: 18px;
    font-weight: 700;
  }
  #ledger-view .ledger-balance-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  #ledger-view .ledger-balance-card {
    min-width: 0;
    min-height: 92px;
    padding: 14px 12px;
  }
  #ledger-view .ledger-balance-card span {
    font-size: 13px;
    font-weight: 800;
  }
  #ledger-view .ledger-balance-card strong {
    overflow-wrap: anywhere;
    text-align: right;
    font-size: 22px;
    font-weight: 800;
  }
  #ledger-view .ledger-entry-row,
  #ledger-view .ledger-entry-row.entry-management {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    gap: 11px 14px;
    width: 100%;
    min-width: 0;
    padding: 17px 15px;
    font-size: 17px;
    font-weight: 700;
  }
  #ledger-view .ledger-entry-row > * {
    min-width: 0;
    text-align: right;
  }
  #ledger-view .ledger-entry-row > [data-label]::before {
    font-size: 12px;
    font-weight: 800;
    text-align: left;
  }
  #ledger-view .ledger-entry-row > [data-label="Details"],
  #ledger-view .ledger-entry-row > [data-label="Amount"],
  #ledger-view .ledger-entry-row > [data-label="Actions"] {
    grid-column: 1 / -1;
  }
  #ledger-view .ledger-entry-row > [data-label="Amount"] {
    font-size: 22px;
    font-weight: 800;
  }
  #ledger-view .ledger-entry-description {
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
}

/* Simple party ledger; expense accounts include a Details column. */
#ledger-view .ledger-entry-list {
  overflow-x: auto;
}
#ledger-view .simple-ledger-grid,
#ledger-view .simple-ledger-grid.entry-management {
  grid-template-columns: minmax(105px, 1fr) minmax(80px, .8fr) minmax(100px, .9fr) minmax(130px, 1.1fr) minmax(145px, 1.15fr);
  min-width: 620px;
  gap: 12px;
}
#ledger-view .simple-ledger-grid.expense-ledger-grid {
  grid-template-columns: minmax(95px, .85fr) minmax(60px, .55fr) minmax(75px, .65fr) minmax(180px, 1.5fr) minmax(105px, .9fr) minmax(120px, 1fr);
  min-width: 820px;
}
#ledger-view .simple-ledger-grid > * {
  min-width: 0;
}
#ledger-view .simple-ledger-grid > :nth-child(n+2) {
  text-align: right;
}
#ledger-view .simple-ledger-grid.expense-ledger-grid > :nth-child(4),
#ledger-view .simple-ledger-grid.expense-ledger-grid > [data-label="Details"] {
  text-align: left;
}
#ledger-view .simple-ledger-grid.expense-ledger-grid > [data-label="Details"] {
  overflow-wrap: anywhere;
  white-space: normal;
}
#ledger-view .simple-ledger-grid.expense-ledger-grid.balance-forward-row > :nth-child(4) {
  color: inherit;
  font-weight: 400;
}
#ledger-view .simple-ledger-grid.expense-ledger-grid.balance-forward-row > [data-label="Amount"] {
  color: #536b84;
  font-weight: 700;
}
#ledger-view .ledger-running-balance {
  color: #10263e;
  text-align: right;
}
#ledger-view .simple-ledger-grid.balance-forward-row > :nth-child(4) {
  color: #536b84;
  font-weight: 700;
}

@media (max-width: 1400px) {
  #ledger-view .ledger-entry-list {
    width: 100%;
    border: 1px solid rgba(30,74,113,.16);
    border-radius: 10px;
    background: #fff;
  }
  #ledger-view .ledger-entry-head.simple-ledger-grid {
    display: grid;
    min-height: 48px;
    padding: 0 12px;
    font-size: 12px;
  }
  #ledger-view .ledger-entry-head.simple-ledger-grid.expense-ledger-grid {
    min-width: 820px;
  }
  #ledger-view .ledger-entry-row.simple-ledger-grid,
  #ledger-view .ledger-entry-row.simple-ledger-grid.entry-management {
    display: grid;
    width: auto;
    min-width: 620px;
    min-height: 58px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 700;
  }
  #ledger-view .ledger-entry-row.simple-ledger-grid.expense-ledger-grid {
    min-width: 820px;
  }
  #ledger-view .ledger-entry-row.simple-ledger-grid > * {
    grid-column: auto;
    padding: 0;
    text-align: right;
  }
  #ledger-view .ledger-entry-row.simple-ledger-grid > :first-child {
    text-align: left;
  }
  #ledger-view .ledger-entry-row.simple-ledger-grid > [data-label]::before {
    content: none;
    display: none;
  }
  #ledger-view .ledger-entry-row.simple-ledger-grid > [data-label="Amount"] {
    grid-column: auto;
    font-size: 15px;
  }
}

/* One continuous four-column Profit & Loss statement. */
#profit-loss-view .profit-loss-statement {
  overflow: hidden;
}
#profit-loss-view .statement-table {
  overflow-x: auto;
  border-top: 2px solid #173a5e;
}
#profit-loss-view .statement-table .profit-loss-row,
#profit-loss-view .profit-loss-subhead {
  grid-template-columns: minmax(190px, 1.35fr) minmax(115px, .8fr) minmax(150px, 1fr) minmax(150px, 1fr);
  min-width: 680px;
  padding: 0 12px;
}
#profit-loss-view .profit-loss-subhead {
  display: grid;
  align-items: center;
  gap: 15px;
  min-height: 45px;
  color: #173a5e;
  background: #edf5fa;
  font: 700 10px var(--font-display);
  letter-spacing: .6px;
  text-transform: uppercase;
}
#profit-loss-view .profit-loss-subhead > :not(:first-child) {
  text-align: right;
}
#profit-loss-view .statement-total-row {
  color: #10263e;
  background: #f1f6fa;
  font-weight: 800;
}
#profit-loss-view .statement-separator {
  border-top: 2px solid #173a5e;
}
#profit-loss-view .statement-purchase-row {
  margin-top: 3px;
}
#profit-loss-view .statement-result-row {
  border-top: 2px solid #173a5e;
  font-weight: 800;
}
#profit-loss-view .statement-result-row.profit {
  color: #126943;
  background: #e9f8ef;
}
#profit-loss-view .statement-result-row.loss {
  color: #a92f45;
  background: #fff0f2;
}
#profit-loss-view .statement-net-row {
  min-height: 66px;
  border-top-width: 3px;
  border-bottom: 3px double #173a5e;
  font-size: 14px;
}
#profit-loss-view .expense-statement-row {
  min-height: 46px;
}

@media (max-width: 1400px) {
  #profit-loss-view .statement-table .profit-loss-head {
    display: grid;
  }
  #profit-loss-view .statement-table .profit-loss-row,
  #profit-loss-view .profit-loss-subhead {
    display: grid;
    grid-template-columns: minmax(190px, 1.35fr) minmax(115px, .8fr) minmax(150px, 1fr) minmax(150px, 1fr);
    min-width: 680px;
    gap: 10px;
  }
  #profit-loss-view .statement-table .profit-loss-row > * {
    display: block;
    min-width: 0;
    text-align: right;
  }
  #profit-loss-view .statement-table .profit-loss-row > :first-child {
    text-align: left;
  }
  #profit-loss-view .statement-table .profit-loss-row > *::before {
    content: none;
    display: none;
  }
}

.trial-balance-content { max-width: 1050px; margin: auto; padding: 62px 34px 80px; }
.trial-balance-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.trial-balance-heading h1 { margin: 10px 0 5px; color: #10263e; font: 600 clamp(32px, 4vw, 44px) var(--font-display); letter-spacing: -1.8px; }
.trial-balance-heading p:last-child { margin: 0; color: #60758d; font-size: 12px; }
.trial-balance-controls { display: flex; align-items: end; gap: 10px; }
.trial-balance-controls label { display: grid; gap: 6px; color: #536b84; font: 700 10px var(--font-display); text-transform: uppercase; }
.trial-balance-controls input { min-height: 42px; padding: 0 10px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; color: #10263e; background: #fff; }
.trial-balance-report { display: grid; gap: 16px; }
.trial-balance-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.trial-balance-total { display: grid; gap: 8px; min-height: 82px; align-content: center; padding: 15px 18px; border: 1px solid rgba(30,74,113,.16); border-radius: 12px; background: #f5f9fc; }
.trial-balance-total span { color: #536b84; font: 700 10px var(--font-display); letter-spacing: .6px; text-transform: uppercase; }
.trial-balance-total strong { color: #10263e; font: 700 20px var(--font-display); overflow-wrap: anywhere; }
.trial-balance-total.debit { background: #fff4f3; border-color: rgba(179,57,77,.2); }
.trial-balance-total.debit strong { color: #a92f45; }
.trial-balance-total.credit { background: #effaf3; border-color: rgba(22,118,77,.2); }
.trial-balance-total.credit strong { color: #126943; }
.trial-balance-table-wrap { overflow-x: auto; border: 1px solid rgba(30,74,113,.16); border-radius: 12px; background: #fff; }
.trial-balance-table { min-width: 580px; }
.trial-balance-row { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 1fr) minmax(150px, 1fr); align-items: center; gap: 14px; min-height: 56px; padding: 8px 17px; border-bottom: 1px solid rgba(30,74,113,.11); color: #334f69; font-size: 13px; }
.trial-balance-row > :not(:first-child) { text-align: right; }
.trial-balance-head { min-height: 48px; color: #173a5e; background: #edf5fa; font: 800 11px var(--font-display); letter-spacing: .7px; text-transform: uppercase; }
.trial-balance-account { display: grid; gap: 3px; }
.trial-balance-account strong { color: #173a5e; }
.trial-balance-account small { color: #73869a; font-size: 10px; text-transform: capitalize; }
.trial-balance-trace-account { justify-self: start; color: #007b9f; font-size: 10px; }
.trial-balance-trace-difference { justify-self: start; color: #007b9f; font-size: 11px; }
.trial-balance-total.difference small { color: #536b84; font-size: 10px; line-height: 1.4; }
.trial-balance-grand-total { border-top: 2px solid #173a5e; border-bottom: 3px double #173a5e; color: #10263e; background: #f1f6fa; font-weight: 800; }
.trial-balance-empty { display: grid; min-height: 100px; place-items: center; color: #60758d; }
.trial-balance-unbalanced { display: grid; gap: 14px; padding: 18px; border: 1px solid rgba(169,47,69,.25); border-radius: 12px; background: #fff7f5; }
.trial-balance-unbalanced-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.trial-balance-unbalanced-heading .eyebrow { margin: 0 0 5px; }
.trial-balance-unbalanced-heading h2 { margin: 0; color: #7e2637; font: 700 18px var(--font-display); }
.trial-balance-unbalanced-heading h2 span { color: #a92f45; }
.trial-balance-unbalanced-heading > p { max-width: 430px; margin: 0; color: #72535a; font-size: 11px; line-height: 1.5; }
.trial-balance-unbalanced-list { display: grid; gap: 9px; }
.trial-balance-unbalanced-row { display: grid; grid-template-columns: minmax(165px,1.35fr) minmax(130px,1.1fr) repeat(3,minmax(110px,.85fr)) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid rgba(169,47,69,.17); border-radius: 9px; background: #fff; }
.trial-balance-unbalanced-row > div { display: grid; min-width: 0; gap: 4px; }
.trial-balance-unbalanced-row > div > span { color: #72535a; font: 700 9px var(--font-display); letter-spacing: .45px; text-transform: uppercase; }
.trial-balance-unbalanced-row > div > strong { color: #263a4f; font-size: 11px; overflow-wrap: anywhere; }
.trial-balance-unbalanced-identity small { color: #718092; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.trial-balance-unbalanced-difference > strong { color: #a92f45 !important; }
.trial-balance-unbalanced-open { min-height: 38px; padding: 7px 10px; color: #8e2b40; border-color: rgba(169,47,69,.34); font-size: 10px; white-space: nowrap; }

.balance-sheet-content { max-width: 1150px; margin: auto; padding: 62px 34px 80px; }
.balance-sheet-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.balance-sheet-heading h1 { margin: 10px 0 5px; color: #10263e; font: 600 clamp(32px, 4vw, 44px) var(--font-display); letter-spacing: -1.8px; }
.balance-sheet-heading p:last-child { margin: 0; color: #60758d; font-size: 12px; }
.balance-sheet-controls { display: flex; align-items: end; gap: 10px; }
.balance-sheet-controls label { display: grid; gap: 6px; color: #536b84; font: 700 10px var(--font-display); text-transform: uppercase; }
.balance-sheet-controls input { min-height: 42px; padding: 0 10px; border: 1px solid rgba(30,74,113,.25); border-radius: 8px; color: #10263e; background: #fff; }
.balance-sheet-report { display: grid; gap: 16px; }
.balance-sheet-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.balance-sheet-total { display: grid; gap: 8px; min-height: 82px; align-content: center; padding: 15px 18px; border: 1px solid rgba(30,74,113,.16); border-radius: 12px; background: #f5f9fc; }
.balance-sheet-total span { color: #536b84; font: 700 10px var(--font-display); letter-spacing: .6px; text-transform: uppercase; }
.balance-sheet-total strong { color: #10263e; font: 700 20px var(--font-display); overflow-wrap: anywhere; }
.balance-sheet-total.assets { background: #eff7fc; }
.balance-sheet-total.capital { background: #effaf3; border-color: rgba(22,118,77,.2); }
.balance-sheet-total.capital strong { color: #126943; }
.balance-sheet-total.status.balanced { background: #e7f9ef; border-color: rgba(22,118,77,.2); }
.balance-sheet-total.status.balanced strong { color: #16764d; }
.balance-sheet-total.status.unbalanced { background: #fff0f2; border-color: rgba(179,57,77,.2); }
.balance-sheet-total.status.unbalanced strong { color: #b3394d; }
.balance-sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.balance-sheet-panel { padding: 24px; }
.balance-sheet-capital-panel { grid-column: 1 / -1; }
.balance-sheet-panel h2 { margin: 0 0 16px; color: #10263e; font: 600 19px var(--font-display); }
.balance-sheet-lines { border-top: 1px solid rgba(30,74,113,.15); }
.balance-sheet-line { display: flex; justify-content: space-between; gap: 14px; align-items: center; min-height: 49px; padding: 9px 4px; border-bottom: 1px solid rgba(30,74,113,.11); color: #486079; font-size: 12px; }
.balance-sheet-line > :last-child { flex: 0 0 auto; color: #153352; text-align: right; font-weight: 700; }
.balance-sheet-line.adjustment { color: #14735f; font-weight: 700; }
.balance-sheet-line.adjustment.profit > :last-child { color: #16764d; }
.balance-sheet-line.adjustment.loss,
.balance-sheet-line.adjustment.loss > :last-child { color: #b3394d; }
.balance-sheet-line.grand-total { margin-top: 12px; padding: 14px 4px 2px; border-top: 2px solid #173a5e; border-bottom: 3px double #173a5e; color: #10263e; font-size: 13px; }
.balance-sheet-line.grand-total > :last-child { font-size: 16px; }
.balance-sheet-empty { display: grid; min-height: 88px; place-items: center; color: #60758d; font-size: 12px; text-align: center; }
.balance-sheet-note { margin: 0; color: #60758d; font-size: 11px; line-height: 1.55; }

@media (max-width: 1400px) {
  .trial-balance-content { padding: 45px 24px 60px; }
  .trial-balance-heading { align-items: stretch; flex-direction: column; }
  .trial-balance-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .trial-balance-controls label { font-size: 13px; }
  .trial-balance-controls input,
  .trial-balance-controls .print-button { box-sizing: border-box; width: 100%; min-height: 54px; font-size: 16px; }
  .trial-balance-summary { grid-template-columns: 1fr 1fr; }
  .trial-balance-total strong { font-size: 19px; }
  .trial-balance-total.difference { grid-column: 1 / -1; }
  .trial-balance-unbalanced { padding: 16px 12px; }
  .trial-balance-unbalanced-heading { flex-direction: column; gap: 8px; }
  .trial-balance-unbalanced-heading > p { max-width: none; }
  .trial-balance-unbalanced-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .trial-balance-unbalanced-identity,
  .trial-balance-unbalanced-parties,
  .trial-balance-unbalanced-open { grid-column: 1 / -1; }
  .trial-balance-unbalanced-open { width: 100%; min-height: 48px; font-size: 14px; }
  .balance-sheet-content { padding: 45px 24px 60px; }
  .balance-sheet-heading { align-items: stretch; flex-direction: column; }
  .balance-sheet-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .balance-sheet-controls label { font-size: 13px; }
  .balance-sheet-controls input,
  .balance-sheet-controls .print-button { box-sizing: border-box; width: 100%; min-height: 54px; font-size: 16px; }
  .balance-sheet-controls .print-button { grid-column: 1 / -1; }
  .balance-sheet-controls .print-button { grid-column: 1 / -1; }
  .balance-sheet-summary { grid-template-columns: 1fr 1fr; }
  .balance-sheet-total strong { font-size: 19px; }
  .balance-sheet-total.status { grid-column: 1 / -1; }
  .balance-sheet-grid { grid-template-columns: 1fr; }
  .balance-sheet-panel { padding: 20px 18px; }
}

@media print {
  @page { margin: 13mm; }
  body { color: #111; background: #fff; }
  .app-bg,
  .workspace-header,
  .main-footer,
  .print-button,
  .trade-post-actions,
  .freight-form-actions,
  .cash-voucher-form-actions,
  .add-row-button,
  .remove-trade-row,
  .source-voucher-modal,
  .voucher-register-section,
  .ledger-entry-actions,
  .ledger-actions-head,
  .ledger-action-placeholder,
  .trial-balance-unbalanced-open { display: none !important; }
  .ledger-entry-head.entry-management,
  .ledger-entry-row.entry-management { grid-template-columns: 100px 1.05fr 70px 1.5fr 85px 105px .75fr 110px; min-width: 0; }
  #ledger-view .simple-ledger-grid,
  #ledger-view .simple-ledger-grid.entry-management {
    grid-template-columns: 1fr .8fr .9fr 1.1fr 1.15fr;
    min-width: 0;
  }
  .view:not(.hidden) { min-height: auto; animation: none; }
  .print-business-header {
    display: block;
    margin: 0 0 24px;
    padding: 10px 14px 18px;
    border-top: 4px solid #183b59;
    border-bottom: 2px solid #183b59;
    color: #183b59;
    text-align: center;
  }
  .print-business-name {
    font: 800 38px/1.08 var(--font-display);
    letter-spacing: .5px;
    text-transform: uppercase;
  }
  .print-report-name {
    margin-top: 8px;
    color: #007b9f;
    font: 750 23px/1.15 var(--font-display);
    letter-spacing: 1.8px;
    text-transform: uppercase;
  }
  .print-business-meta {
    margin-top: 9px;
    color: #425d76;
    font: 600 12px/1.35 var(--font-body);
    letter-spacing: .35px;
  }
  .print-business-footer {
    display: block;
    position: fixed;
    right: 0;
    bottom: 5mm;
    left: 0;
    color: #607284;
    font-size: 9px;
    text-align: center;
  }
  .trade-content,
  .cash-voucher-content,
  .ledger-content,
  .profit-loss-content,
  .trial-balance-content,
  .balance-sheet-content { max-width: none; padding: 0; }
  .trial-balance-heading { margin-bottom: 16px; }
  .balance-sheet-heading { margin-bottom: 16px; }
  .balance-sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .balance-sheet-panel { padding: 14px; }
  .balance-sheet-capital-panel { grid-column: 1 / -1; }
  .balance-sheet-controls { display: none; }
  .balance-sheet-line { min-height: 38px; padding: 6px 2px; font-size: 10px; }
  .balance-sheet-total { min-height: 65px; padding: 10px; }
  .balance-sheet-total strong { font-size: 15px; }
  .balance-sheet-note { margin-top: 10px; }
  .trial-balance-table-wrap { overflow: visible; }
  .trial-balance-table { min-width: 0; }
  .surface-card { border: 1px solid #c8d2dc; background: #fff; box-shadow: none; break-inside: avoid; }
  .trade-heading,
  .cash-voucher-heading,
  .ledger-heading,
  .profit-loss-heading { margin-bottom: 16px; }
  .trade-register-row {
    grid-template-columns: 132px 1.15fr 1.35fr 2fr 100px 130px;
    min-width: 0;
    min-height: 58px;
    font-size: 13px;
    font-weight: 700;
  }
  .trade-register-head {
    min-height: 46px;
    font-size: 11px;
    font-weight: 800;
  }
  .trade-register-row > :first-child { white-space: nowrap; }
  .trade-register-summary strong { font-size: 17px; font-weight: 800; }
  input,
  select { color: #111 !important; background: #fff !important; box-shadow: none !important; }
  .source-voucher-entry { break-inside: avoid; border-color: #aebbc7; }
  body.source-voucher-print-mode > :not(#source-voucher-modal) { display: none !important; }
  body.source-voucher-print-mode #source-voucher-modal {
    position: static !important;
    display: block !important;
    inset: auto;
    padding: 0;
    background: #fff;
  }
  body.source-voucher-print-mode .source-voucher-backdrop,
  body.source-voucher-print-mode #close-source-voucher,
  body.source-voucher-print-mode #print-source-voucher,
  body.source-voucher-print-mode .source-voucher-open,
  body.source-voucher-print-mode .source-voucher-filters { display: none !important; }
  body.source-voucher-print-mode .source-voucher-card {
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }
  body.source-voucher-print-mode .source-voucher-heading { margin-bottom: 12px; }
  body.source-voucher-print-mode .source-voucher-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media screen and (max-width: 1400px) {
  .opening-balance-list-heading { align-items: flex-start; flex-direction: column; }
  .opening-balance-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .opening-balance-reference,
  .opening-balance-row-status,
  .opening-balance-edit { grid-column: 1 / -1; }
  .opening-balance-edit { width: 100%; min-height: 46px; }
}

#trade-view .trade-step-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 0;
  list-style: none;
}
#trade-view .trade-step-progress li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 13px;
  border: 1px solid rgba(30,74,113,.16);
  border-radius: 12px;
  color: #71849a;
  background: rgba(255,255,255,.7);
  font: 600 11px var(--font-display);
}
#trade-view .trade-step-progress li > span {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 50%;
  color: #647a8e;
  background: #edf3f7;
}
#trade-view .trade-step-progress li.current {
  border-color: rgba(0,123,159,.35);
  color: #006d8e;
  background: #eff9fc;
}
#trade-view .trade-step-progress li.current > span,
#trade-view .trade-step-progress li.complete > span {
  color: #fff;
  background: #0785a8;
}
#trade-view .trade-step-progress li.complete { color: #16764d; }
#trade-view .trade-step-panel {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px;
}
#trade-view .trade-step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 23px;
}
#trade-view .trade-step-heading h2 {
  margin: 6px 0 0;
  color: #10263e;
  font: 600 25px var(--font-display);
  letter-spacing: -.8px;
}
#trade-view .trade-step-heading > strong {
  color: #60758d;
  font: 600 12px var(--font-display);
}
#trade-view .trade-date-input {
  max-width: 370px;
  margin-bottom: 18px;
}
#trade-view .trade-step-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
#trade-view .trade-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}
#trade-view .trade-field > span {
  color: #536b84;
  font: 600 10px var(--font-display);
  letter-spacing: .45px;
}
#trade-view .trade-field input,
#trade-view .trade-field select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(30,74,113,.24);
  border-radius: 9px;
  outline: 0;
  color: #10263e;
  background: #fff;
  font: 500 13px var(--font-body);
}
#trade-view .trade-field input:focus,
#trade-view .trade-field select:focus {
  border-color: #0785a8;
  box-shadow: 0 0 0 3px rgba(7,133,168,.1);
}
#trade-view .trade-field input[readonly] {
  color: #476078;
  background: #f0f5f8;
}
#trade-view .trade-party-field,
#trade-view .trade-item-field {
  align-content: start;
}
#trade-view .trade-party-search,
#trade-view .trade-item-search {
  margin-bottom: -2px;
}
#trade-view .trade-derived-rate {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 71px;
  padding: 12px 14px;
  border: 1px solid rgba(0,123,159,.19);
  border-radius: 10px;
  background: #f1f9fc;
}
#trade-view .trade-derived-rate span {
  color: #60758d;
  font: 600 9px var(--font-display);
  letter-spacing: .6px;
  text-transform: uppercase;
}
#trade-view .trade-derived-rate strong {
  color: #006d8e;
  font: 700 16px var(--font-display);
}
#trade-view .trade-amount-line {
  grid-template-columns: 1fr auto;
  min-height: 60px;
  margin-top: 18px;
  padding: 0 4px;
}
#trade-view .trade-amount-line > span {
  color: #536b84;
  font: 600 10px var(--font-display);
  letter-spacing: .5px;
  text-transform: uppercase;
}
#trade-view .trade-amount-line strong {
  color: #10263e;
  font: 700 19px var(--font-display);
}
#trade-view .trade-loading-field {
  max-width: 480px;
  margin-top: 22px;
}
#trade-view .trade-step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 25px;
}
#trade-view .trade-step-actions > button { min-height: 46px; }
#trade-view .trade-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
#trade-view .trade-review-grid > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(30,74,113,.13);
  border-radius: 10px;
  background: #f8fbfd;
}
#trade-view .trade-review-grid > div > span {
  color: #60758d;
  font: 600 9px var(--font-display);
  letter-spacing: .4px;
  text-transform: uppercase;
}
#trade-view .trade-review-grid > div > strong {
  overflow-wrap: anywhere;
  color: #173650;
  font: 700 14px var(--font-display);
}
#trade-view .trade-review-grid > .trade-review-total {
  border-color: rgba(0,123,159,.25);
  background: #eff9fc;
}
#trade-view .trade-review-grid > .trade-review-total strong { color: #006d8e; }
#trade-view .trade-summary-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}
#trade-view .trade-post-actions { margin-top: 22px; }
#trade-view #trade-step-message { max-width: 920px; margin: 14px auto 0; }

@media screen and (max-width: 1400px) {
  #trade-view .trade-content { max-width: 760px; padding: 18px 12px 42px; }
  #trade-view .trade-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  #trade-view .trade-step-progress { gap: 6px; }
  #trade-view .trade-step-progress li { justify-content: center; gap: 7px; padding: 7px 5px; font-size: 10px; }
  #trade-view .trade-step-progress li > span { width: 23px; height: 23px; flex-basis: 23px; }
  #trade-view .trade-step-panel { padding: 18px 14px; }
  #trade-view .trade-step-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  #trade-view .trade-step-heading h2 { font-size: 22px; }
  #trade-view .trade-step-fields,
  #trade-view .trade-review-grid { grid-template-columns: minmax(0, 1fr); }
  #trade-view .trade-date-input,
  #trade-view .trade-loading-field { max-width: none; }
  #trade-view .trade-field input,
  #trade-view .trade-field select { min-height: 49px; font-size: 15px; }
  #trade-view .trade-step-actions { align-items: stretch; flex-direction: column-reverse; }
  #trade-view .trade-step-actions > button { width: 100%; min-height: 49px; }
}

@media print {
  #trade-view .trade-step-progress,
  #trade-view .trade-step-actions { display: none !important; }
}

#trade-view .trade-wizard-progress {
  display: grid;
  gap: 9px;
  max-width: 920px;
  margin: 0 auto 16px;
}
#trade-view .trade-wizard-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #60758d;
  font: 600 10px var(--font-display);
  letter-spacing: .5px;
}
#trade-view .trade-wizard-progress-label strong { color: #173650; font-size: 12px; }
#trade-view .trade-wizard-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eff4;
}
#trade-view .trade-wizard-progress-track > span {
  display: block;
  width: 11%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #55c8d5, #0785a8);
  transition: width .2s ease;
}
#trade-view #trade-wizard-field { min-height: 120px; }
#trade-view #trade-wizard-field .trade-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 15px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#trade-view #trade-wizard-field .trade-single-field { width: 100%; max-width: 560px; }
#trade-view #trade-wizard-field .trade-field input {
  min-height: 52px;
  font-size: 15px;
}
#trade-view .trade-combobox {
  position: relative;
  width: 100%;
  max-width: 560px;
}
#trade-view .trade-combobox-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(30,74,113,.24);
  border-radius: 9px;
  color: #10263e;
  background: #fff;
  text-align: left;
  font: 500 15px var(--font-body);
  cursor: pointer;
}
#trade-view .trade-combobox-toggle:focus-visible {
  outline: 3px solid rgba(7,133,168,.2);
  border-color: #0785a8;
}
#trade-view .trade-combobox-toggle > span:last-child { color: #60758d; font-size: 18px; }
#trade-view .trade-combobox-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(30,74,113,.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(18,43,67,.18);
}
#trade-view .trade-combobox-search {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid rgba(30,74,113,.2);
  border-radius: 8px;
  color: #10263e;
  background: #f8fbfd;
  font: 14px var(--font-body);
}
#trade-view .trade-combobox-options {
  display: grid;
  gap: 3px;
  max-height: 250px;
  margin-top: 7px;
  overflow-y: auto;
}
#trade-view .trade-combobox-group {
  display: grid;
  gap: 3px;
}
#trade-view .trade-combobox-group-label {
  padding: 8px 10px 2px;
  color: #60758d;
  font: 700 10px var(--font-display);
  letter-spacing: .7px;
  text-transform: uppercase;
}
#trade-view .trade-combobox-option {
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  color: #173650;
  background: transparent;
  text-align: left;
  font: 500 13px var(--font-body);
  cursor: pointer;
}
#trade-view .trade-combobox-option:hover,
#trade-view .trade-combobox-option[aria-selected="true"] {
  color: #006d8e;
  background: #edf8fb;
}
#trade-view .trade-combobox-empty {
  padding: 14px 10px;
  color: #71849a;
  font: 13px var(--font-body);
}
#trade-view .trade-quantity-summary {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 560px;
  padding: 13px 15px;
  border: 1px solid rgba(30,74,113,.13);
  border-radius: 10px;
  background: #f8fbfd;
}
#trade-view .trade-quantity-summary span {
  color: #60758d;
  font: 600 9px var(--font-display);
  letter-spacing: .5px;
  text-transform: uppercase;
}
#trade-view .trade-quantity-summary strong {
  color: #173650;
  font: 700 15px var(--font-display);
}

@media screen and (max-width: 1400px) {
  #trade-view .trade-wizard-progress { margin-bottom: 12px; }
  #trade-view .trade-wizard-progress-label { font-size: 10px; }
  #trade-view .trade-combobox-menu { max-height: min(62vh, 390px); }
  #trade-view .trade-combobox-options { max-height: min(48vh, 280px); }
  #trade-view #trade-wizard-field .trade-field input,
  #trade-view .trade-combobox-toggle { min-height: 52px; font-size: 16px; }
}

.trade-register-heading { margin-bottom: 12px; }
.voucher-register-section { margin-top: 30px; }
.trade-register-heading h2 {
  margin: 0;
  color: #10263e;
  font: 600 20px var(--font-display);
}
.trade-register-list { overflow: auto; border-top: 1px solid rgba(30,74,113,.15); }
.trade-register-table {
  width: 100%;
  min-width: 810px;
  border-collapse: collapse;
  color: #173650;
  text-align: left;
  font: 500 13px var(--font-body);
}
.simple-voucher-register-table { min-width: 720px; }
.trade-register-table th {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(30,74,113,.18);
  color: #60758d;
  background: #f5f8fa;
  font: 700 10px var(--font-display);
  letter-spacing: .45px;
  text-transform: uppercase;
}
.trade-register-table th:first-child { width: 130px; }
.trade-register-table th:nth-child(2) { width: 145px; }
.trade-register-table th:last-child { width: 110px; text-align: right; }
.trade-register-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(30,74,113,.1);
  vertical-align: middle;
}
.trade-register-entry {
  cursor: pointer;
  transition: background-color .14s ease;
}
.trade-register-entry:hover { background: #f2f9fb; }
.trade-register-entry:focus-visible {
  outline: 2px solid #0785a8;
  outline-offset: -2px;
  background: #f2f9fb;
}
.trade-register-entry td:nth-child(2) {
  color: #007b9f;
  font: 700 12px var(--font-display);
  white-space: nowrap;
}
.trade-register-entry td:nth-child(3),
.trade-register-entry td:nth-child(4) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trade-register-entry td:last-child {
  color: #10263e;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

@media screen and (max-width: 1400px) {
  .trade-register-list { overflow: visible; border-top: 0; }
  .trade-register-table { min-width: 0; }
  .trade-register-table thead { display: none; }
  .trade-register-table tbody { display: grid; gap: 9px; }
  .trade-register-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px 13px;
    padding: 10px 12px;
    border: 1px solid rgba(30,74,113,.14);
    border-radius: 9px;
    background: #fff;
  }
  .trade-register-entry:hover,
  .trade-register-entry:focus-visible { background: #f2f9fb; }
  .trade-register-entry td,
  .trade-register-entry td:nth-child(3),
  .trade-register-entry td:nth-child(4) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    max-width: none;
    padding: 4px 0;
    overflow: visible;
    border: 0;
    text-align: right;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .trade-register-entry td::before {
    flex: 0 0 auto;
    color: #71869d;
    content: attr(data-label);
    font: 700 9px var(--font-display);
    letter-spacing: .3px;
    text-align: left;
    text-transform: uppercase;
  }
  .trade-register-entry td:last-child { grid-column: 1 / -1; }
  .simple-voucher-register-entry td:last-child { grid-column: auto; }
  .trade-register-table th:first-child,
  .trade-register-table th:nth-child(2),
  .trade-register-table th:last-child { width: auto; }
}

.opening-balance-mobile-header { display: none; }

@media screen and (max-width: 1400px) {
  body.opening-balance-form-open { overflow: hidden; }
  body.opening-balance-form-open #admin-view {
    position: fixed;
    z-index: 1999;
    inset: 0;
    overflow: hidden;
    animation: none;
    transform: none;
  }

  .cash-voucher-content,
  #trade-view .trade-content {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 72px);
    min-height: calc(100dvh - 72px);
    margin: 0;
    padding: 16px 14px 24px;
  }

  .cash-voucher-heading,
  #trade-view .trade-heading { margin-bottom: 14px; }

  .cash-voucher-view .cash-voucher-form {
    width: 100%;
    min-height: calc(100vh - 250px);
    min-height: calc(100dvh - 250px);
    display: flex;
    flex-direction: column;
  }

  .cash-voucher-view .cash-voucher-form-actions { margin-top: auto; }

  #trade-view #trade-wizard {
    width: 100%;
    min-height: calc(100vh - 170px);
    min-height: calc(100dvh - 170px);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #trade-view .trade-step-panel {
    width: 100%;
    min-height: calc(100vh - 250px);
    min-height: calc(100dvh - 250px);
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
  }

  #trade-view #trade-wizard-field {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    justify-content: center;
  }

  #trade-view .trade-step-actions { margin-top: auto; }

  .opening-balance-mobile-header { display: flex; }
  .opening-balance-mobile-header h2 {
    margin: 6px 0 0;
    color: #eef5ff;
    font: 600 22px var(--font-display);
  }

  #opening-balance-form:not(.hidden) {
    position: fixed;
    z-index: 2000;
    inset: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 20px;
    overflow-y: auto;
    margin: 0;
    padding: max(22px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: var(--navy-900);
    box-shadow: none;
  }

  #opening-balance-form:not(.hidden) .opening-balance-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  #opening-balance-form:not(.hidden) .opening-balance-mobile-header .outline-button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 12px;
    font-size: 12px;
  }

  #opening-balance-form:not(.hidden) .opening-balance-actions .primary-button { width: 100%; }

  #opening-balance-message:not(.hidden) {
    position: fixed;
    z-index: 2001;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    left: 16px;
    margin: 0;
  }
}