.workspace > .module-host:has(.create-challan-v2) { padding: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 1081px) {
  body:has(.create-challan-v2) { overflow: hidden; }
  .workspace:has(.create-challan-v2) { height: 100dvh; grid-template-rows: auto minmax(0,1fr); }
}
.create-challan-v2 { display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 10px 18px 0; color: var(--text); font-size: 14px; }
.create-challan-v2 *, .cc-dialog * { box-sizing: border-box; letter-spacing: 0; }
.cc-topline, .cc-identity, .cc-toolbar, .cc-section-title, .cc-bottom, .cc-pagination, .cc-auto-values, .cc-print-settings { display: flex; align-items: center; gap: 10px; }
.cc-topline, .cc-section-title, .cc-bottom, .cc-pagination, .cc-auto-values { justify-content: space-between; }
.cc-topline { flex-shrink: 0; min-height: 48px; padding: 4px 0; }
.cc-identity { flex-wrap: wrap; font-size: 17px; min-width: 0; }
.cc-identity > img { width: 22px; height: 22px; }.cc-identity strong { font-size: 20px; }
.cc-identity .cc-state { color: #17643d; font-size: 14px; background: #eaf8f0; padding: 8px 10px; border-radius: 4px; }
.cc-topline[data-old="true"] { background: #fff2cd; border-left: 5px solid #b97512; padding: 8px 12px; }
.cc-topline[data-old="true"] .cc-state { color: #734400; background: transparent; font-size: 17px; padding: 0; }
.cc-toolbar .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.cc-icon.btn { width: 40px; height: 40px; min-height: 40px; padding: 9px; flex: 0 0 40px; }
.cc-print-settings { flex-shrink: 0; gap: 16px; }
.cc-orientation { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.cc-orientation select { height: 40px; font: inherit; font-size: 14px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 5px; background: white; padding: 6px 8px; }
.cc-option-check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; white-space: nowrap; }
.cc-option-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.cc-content { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; min-width: 0; }
.cc-route { flex-shrink: 0; display: grid; grid-template-columns: minmax(130px,.8fr) minmax(130px,.8fr) minmax(190px,1.2fr) minmax(130px,.8fr) minmax(240px,1.2fr) 40px; gap: 10px; padding: 10px 0; background: var(--surface); border-block: 1px solid var(--line); }
.cc-route-actions { align-self: end; }
.cc-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.cc-field input, .cc-field select, .cc-dialog input, .cc-dialog select { width: 100%; min-width: 0; height: 40px; border: 1px solid var(--line-strong); border-radius: 5px; background: white; padding: 6px 9px; font: inherit; font-size: 15px; color: var(--text); font-weight: 500; }
.cc-field input:focus, .cc-field select:focus, .cc-search input:focus, .cc-rows input:focus { outline: 2px solid #bfd1ff; outline-offset: 1px; border-color: var(--blue); }
.cc-lookup { display: grid; grid-template-columns: minmax(100px,1fr) auto; align-items: end; gap: 6px; }
.cc-lookup .btn { height: 40px; min-height: 40px; padding: 6px 10px; white-space: nowrap; }
.cc-message { flex-shrink: 0; font-size: 13px; line-height: 1.4; margin: 0; color: var(--muted); }
.cc-message:empty { display: none; }.cc-message[data-tone="error"] { color: var(--red); }
.cc-workspace { display: grid; grid-template-columns: minmax(230px,.76fr) minmax(0,2.25fr) minmax(290px,.95fr); gap: 12px; min-height: 0; flex: 1; }
.cc-pending, .cc-manifest, .cc-settlement { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.cc-pending { border-right: 1px solid var(--line); padding-right: 12px; }
.cc-settlement { border-left: 1px solid var(--line); padding-left: 12px; overflow-y: auto; }.cc-settlement > * { flex-shrink: 0; }
.cc-section-title { min-height: 30px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cc-section-title h2 { font-size: 15px; line-height: 22px; margin: 0; }.cc-section-title > span { font-size: 13px; color: var(--muted); }
.cc-search { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; }
.cc-search input { border: 0; outline: 0; height: 40px; min-width: 0; width: 100%; background: transparent; font: inherit; font-size: 14px; }
.cc-pending-list { flex: 1; overflow: auto; min-height: 0; }
.cc-pending-row { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: white; padding: 12px 5px; font: inherit; color: var(--text); cursor: pointer; }
.cc-pending-row > span { display: flex; justify-content: space-between; gap: 6px; min-width: 0; font-size: 14px; }
.cc-pending-row .cc-pending-party { display: block; overflow-wrap: anywhere; font-size: 15px; }.cc-pending-row small { font-size: 12px; color: var(--muted); }
.cc-pending-row:hover { background: var(--surface-soft); }.cc-pending-row.is-selected { background: #ecf7f1; border-left: 3px solid var(--green); opacity: 1; cursor: default; }
.cc-pagination { padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; white-space: nowrap; }.cc-pagination .btn { padding: 6px 9px; min-height: 36px; }
.cc-rows { flex: 1; overflow: auto; min-height: 0; }.cc-rows table, .cc-history table { border-collapse: collapse; width: 100%; font-size: 14px; }.cc-rows table { min-width: 820px; }
.cc-rows th, .cc-history th { text-align: left; position: sticky; top: 0; background: var(--surface-soft); z-index: 1; color: var(--muted); padding: 10px 8px; font-size: 13px; }
.cc-rows td, .cc-history td { border-bottom: 1px solid var(--line); padding: 12px 8px; vertical-align: top; overflow-wrap: anywhere; }
.cc-rows td:nth-child(1) { width: 110px; }.cc-rows td:nth-child(2) { min-width: 160px; max-width: 220px; }.cc-rows td:nth-child(3) { min-width: 85px; max-width: 160px; }
.cc-rows small, .cc-history small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.cc-rows input { width: 76px; height: 38px; border: 1px solid var(--line); border-radius: 4px; font: inherit; padding: 6px; color: var(--text); background: white; }
.cc-empty { min-height: 120px; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }.cc-empty img { width: 32px; height: 32px; opacity: .45; }
.cc-totals { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; border-top: 1px solid var(--line); padding: 12px 8px; background: var(--surface-soft); }
.cc-totals div { min-width: 0; }.cc-totals span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }.cc-totals strong { font-size: 15px; overflow-wrap: anywhere; }
.cc-vehicle-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 0 12px; }
.cc-money-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 0; border-block: 1px solid var(--line); }.cc-money-fields input { text-align: right; font-variant-numeric: tabular-nums; }
.cc-auto-values { padding: 12px 0; color: var(--muted); font-size: 13px; }.cc-auto-values strong { display: block; color: var(--text); margin-top: 5px; font-size: 15px; }
.cc-net { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 2px solid var(--line); font-size: 14px; margin-top: auto; background: white; }
.cc-net strong { font-size: 24px; color: var(--blue-dark); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cc-bottom { flex-shrink: 0; border-top: 1px solid var(--line); background: white; padding: 10px 18px max(10px,var(--app-safe-bottom,0px)); margin-inline: -18px; }
.cc-bottom > span { color: var(--muted); font-size: 13px; }.cc-bottom .btn-primary { min-width: 148px; }.cc-list-empty { padding: 24px 8px; color: var(--muted); font-size: 14px; }
.cc-dialog { width: min(560px,calc(100% - 24px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 8px; padding: 0; color: var(--text); box-shadow: 0 16px 48px #0b173033; }
.cc-dialog::backdrop { background: #0b17306b; }.cc-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.cc-dialog h2 { font-size: 19px; margin: 0; }.cc-dialog p { font-size: 14px; line-height: 1.5; }.cc-dialog-body { padding: 16px; overflow: auto; max-height: calc(100dvh - 210px); }
.cc-dialog footer { padding: 12px 16px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.cc-choices { display: grid; gap: 8px; }.cc-choices button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; gap: 7px; }
.cc-history { width: min(1100px,calc(100% - 24px)); }.cc-history[open] { display: flex; flex-direction: column; }
.cc-history header p { margin: 4px 0 0; color: var(--muted); }.cc-history [data-selection] { font-weight: 600; color: var(--text); }
.cc-history-filters { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr auto; gap: 10px; padding: 14px 16px; align-items: end; }.cc-history-filters label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.cc-history-results { overflow: auto; min-height: 0; height: min(490px,55dvh); padding: 0 16px; }.cc-history table { min-width: 760px; }
.cc-history tr[data-record] { cursor: pointer; }.cc-history tr.is-selected { background: #e8f0ff; outline: 2px solid #a4bfff; outline-offset: -2px; }
.cc-history input[type="radio"] { width: 22px; height: 22px; accent-color: var(--blue); cursor: pointer; }
.cc-history header,.cc-history-filters,.cc-history footer { flex-shrink: 0; }.cc-history footer { justify-content: space-between; font-size: 14px; }
.cc-transaction-list article { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }.cc-transaction-list small { display: block; margin-top: 8px; }
.create-challan-v2 [aria-busy="true"], .cc-dialog [aria-busy="true"] { cursor: progress; }
@media (max-width: 1500px) and (min-width: 1081px) {
  .cc-route { grid-template-columns: repeat(4,minmax(0,1fr)) 40px; }.cc-route-actions { grid-column: 5; grid-row: 1; }
  .cc-lookup { grid-column: 1 / -1; grid-template-columns: minmax(140px,360px) 90px; }.cc-lookup .cc-field { flex-direction: row; align-items: center; white-space: nowrap; }
  .cc-workspace { grid-template-columns: 230px minmax(0,1fr) 290px; }.cc-toolbar { gap: 6px; }
}
@media (max-width: 1080px) {
  .create-challan-v2 { padding: 0 max(12px,var(--app-safe-right)) 0 max(12px,var(--app-safe-left)); gap: 8px; }
  .create-challan-v2 > .mobile-phase-tabs { flex-shrink: 0; position: static; margin: 0; }
  .cc-topline { flex-wrap: wrap; min-height: 36px; padding: 0; gap: 8px; }.cc-identity { font-size: 16px; gap: 8px; }.cc-identity strong { font-size: 18px; }
  .cc-identity .cc-state { padding: 5px 8px; font-size: 14px; }.cc-topline[data-old="true"] .cc-state { font-size: 16px; }
  .cc-print-settings { width: 100%; justify-content: space-between; gap: 10px; }.cc-orientation { flex: 1; min-width: 0; flex-direction: column; align-items: stretch; gap: 4px; }
  .cc-orientation select { font-size: 16px; height: 44px; width: 100%; }.cc-option-check { align-self: end; min-height: 44px; }
  .cc-content { display: block; overflow: auto; overscroll-behavior: contain; }
  .cc-route { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 44px; padding: 10px 0; }.cc-route-actions { grid-column: 3; grid-row: 1; }.cc-lookup { grid-column: 1 / -1; }
  .cc-workspace { display: block; }.cc-pending,.cc-manifest,.cc-settlement { padding: 0; border: 0; overflow: visible; }
  .cc-field input,.cc-field select,.cc-dialog input,.cc-dialog select,.cc-search input,.cc-rows input { font-size: 16px; height: 44px; }
  .cc-toolbar .btn,.cc-icon.btn,.cc-lookup .btn { min-height: 44px; height: 44px; }.cc-icon.btn { width: 44px; flex-basis: 44px; }
  .cc-pending-list { overflow: visible; }.cc-pending-row { min-height: 92px; }
  .cc-rows { overflow: visible; }.cc-rows table { min-width: 0; display: block; }.cc-rows thead { display: none; }.cc-rows tbody { display: grid; gap: 10px; }
  .cc-rows tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); position: relative; }
  .cc-rows td { border: 0; padding: 0; min-width: 0 !important; width: auto !important; max-width: none !important; font-size: 14px; }
  .cc-rows td:before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
  .cc-rows input { width: 100%; }.cc-rows .cc-row-remove { position: absolute; top: 8px; right: 0; }.cc-rows td:nth-child(2) { padding-right: 44px; }
  .cc-rows td:nth-child(5) { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }.cc-rows td:nth-child(5):before,.cc-rows td:nth-child(5) small { margin: 0; }
  .cc-rows td:nth-child(6) { grid-column: 1; grid-row: 4; }.cc-rows td:nth-child(7) { grid-column: 2; grid-row: 4; }
  .cc-totals { margin-top: 12px; grid-template-columns: repeat(3,1fr); gap: 12px; }.cc-vehicle-fields,.cc-money-fields { gap: 14px; }.cc-net { margin-top: 12px; }
  .cc-bottom { flex-direction: column; align-items: stretch; padding: 8px max(12px,var(--app-safe-right)) max(8px,var(--app-safe-bottom)) max(12px,var(--app-safe-left)); margin-left: calc(-1 * max(12px,var(--app-safe-left))); margin-right: calc(-1 * max(12px,var(--app-safe-right))); gap: 8px; }
  .cc-bottom > span { display: none; }.cc-bottom .cc-toolbar { display: flex; flex-wrap: wrap; gap: 5px; }.cc-bottom #cc-clear { flex: 1; padding-inline: 8px; }.cc-bottom #cc-save { flex: 0 0 100%; }
  .cc-history-filters { grid-template-columns: 1fr 1fr; padding: 12px; }.cc-history-filters label:first-child { grid-column: 1 / -1; }.cc-history-filters [data-clear] { min-height: 44px; }
  .cc-history-results { padding: 0 12px; }.cc-dialog header { padding: 12px; }.cc-dialog h2 { font-size: 18px; }
  .cc-history { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }.cc-history-results { height: 42dvh; }
  .cc-history table { min-width: 0; display: block; }.cc-history thead { display: none; }.cc-history tbody { display: block; }
  .cc-history tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
  .cc-history td { padding: 0; border: 0; font-size: 14px; }.cc-history td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .cc-history td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }.cc-history td:nth-child(3) { display: none; }
  .cc-history td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }.cc-history td:nth-child(4):before { content: 'Net balance'; display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-bottom: 4px; }
  .cc-history td:nth-child(5) { grid-column: 1; grid-row: 3; font-size: 12px; color: var(--muted); align-self: center; }.cc-history td:nth-child(6) { grid-column: 2; grid-row: 3; text-align: right; }
  html[data-compact-viewport] .cc-history[open] { display: block; overflow: auto; }
  html[data-compact-viewport] .cc-history header { position: sticky; top: 0; z-index: 2; background: var(--surface); }
}
