/* One all-fields Sales Record form v1.3.3 */
.csr-modal{z-index:1200}.csr-card{width:min(1480px,calc(100vw - 28px));max-height:94vh;padding:0;overflow:hidden}.csr-header{padding:18px 22px 14px;border-bottom:1px solid #e7ebf2}.csr-title-row{display:flex;align-items:center;gap:10px}.csr-title-row h2{margin:0;font-size:20px}.csr-record-badge{display:inline-flex;align-items:center;border-radius:999px;background:#eef3ff;color:#3558b7;font-size:11px;font-weight:700;padding:5px 9px;text-transform:uppercase;letter-spacing:.03em}.csr-scroll{overflow:auto;padding:14px 18px 22px;background:#f7f9fc;max-height:calc(94vh - 132px)}.csr-basic-banner{background:#fff;border:1px solid #dce3ee;border-radius:10px;margin-bottom:12px;box-shadow:0 1px 2px rgba(15,23,42,.03)}.csr-advanced-toggle{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 14px;cursor:pointer}.csr-advanced-toggle>span{display:flex;flex-direction:column;gap:2px}.csr-advanced-toggle strong{font-size:13px;color:#192235}.csr-advanced-toggle small{font-size:11px;color:#68758a}.csr-advanced-toggle input{position:absolute;opacity:0;pointer-events:none}.csr-advanced-toggle i{width:40px;height:22px;border-radius:999px;background:#cbd3df;position:relative;flex:0 0 auto;transition:.18s}.csr-advanced-toggle i:after{content:"";position:absolute;width:16px;height:16px;background:#fff;border-radius:50%;left:3px;top:3px;box-shadow:0 1px 3px rgba(0,0,0,.22);transition:.18s}.csr-advanced-toggle input:checked+i{background:#3563e9}.csr-advanced-toggle input:checked+i:after{transform:translateX(18px)}.csr-advanced-toggle input:disabled+i{opacity:.58}.csr-section{background:#fff;border:1px solid #dce3ee;border-radius:10px;margin:0 0 10px;overflow:hidden}.csr-section>summary{display:flex;align-items:center;gap:10px;padding:11px 14px;cursor:pointer;list-style:none;background:#fff}.csr-section>summary::-webkit-details-marker{display:none}.csr-section>summary>span{display:grid;place-items:center;width:24px;height:24px;border-radius:7px;background:#eef3ff;color:#3558b7;font-size:11px;font-weight:800}.csr-section>summary>div{display:flex;flex-direction:column;gap:1px}.csr-section>summary strong{font-size:13px;color:#1f2937}.csr-section>summary small{font-size:10.5px;color:#78859a}.csr-section[open]>summary{border-bottom:1px solid #edf0f5}.csr-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 12px;padding:13px 14px 15px}.csr-grid label,.csr-followup-form label{display:flex;flex-direction:column;gap:5px;min-width:0}.csr-grid label>span,.csr-followup-form label>span{font-size:11px;font-weight:650;color:#49566a}.csr-grid input,.csr-grid select,.csr-grid textarea,.csr-followup-form input,.csr-followup-form select,.csr-followup-form textarea,.csr-item-table input,.csr-item-table select{font:inherit;font-size:12px;border:1px solid #cfd7e3;border-radius:7px;background:#fff;color:#1f2937;min-height:34px;padding:7px 9px;outline:none}.csr-grid textarea,.csr-followup-form textarea{resize:vertical}.csr-grid input:focus,.csr-grid select:focus,.csr-grid textarea:focus,.csr-item-table input:focus,.csr-item-table select:focus{border-color:#6d8cf5;box-shadow:0 0 0 2px rgba(53,99,233,.1)}.csr-grid input[readonly],.csr-grid input:disabled{background:#f2f4f8;color:#68758a}.csr-span-2{grid-column:span 2}.csr-offer-grid{grid-template-columns:repeat(4,minmax(0,1fr));padding-bottom:10px}.csr-item-toolbar{display:flex;justify-content:space-between;align-items:center;padding:0 14px 10px}.csr-item-toolbar>div{display:flex;flex-direction:column}.csr-item-toolbar strong{font-size:12px}.csr-item-toolbar small{font-size:10.5px;color:#7a879a}.csr-item-scroll{overflow:auto;border-top:1px solid #edf0f5;border-bottom:1px solid #edf0f5}.csr-item-table{width:100%;border-collapse:collapse;min-width:1320px}.csr-item-table th{position:sticky;top:0;background:#f7f9fc;color:#5b687c;font-size:10px;text-transform:uppercase;letter-spacing:.03em;text-align:left;padding:7px;border-bottom:1px solid #e2e7ef}.csr-item-table td{padding:5px 6px;border-bottom:1px solid #edf0f5;vertical-align:top}.csr-item-table input,.csr-item-table select{width:100%;min-height:30px;padding:5px 6px}.csr-sr{font-size:11px;color:#667085;text-align:center;width:32px}.csr-requirement-stack{display:grid;gap:4px;min-width:180px}.csr-remove-item{border:0;background:#fff0f0;color:#c73737;width:28px;height:28px;border-radius:7px;font-size:18px;cursor:pointer}.csr-commercial-summary{display:flex;justify-content:flex-end;gap:18px;flex-wrap:wrap;padding:9px 14px 11px;font-size:10.5px;color:#657187}.csr-commercial-summary span{display:flex;gap:5px}.csr-commercial-summary b{color:#263143}.csr-followup-history{padding:12px 14px 0}.csr-followup-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.csr-followup-list article{border:1px solid #e2e7ef;border-radius:8px;padding:9px;background:#fafbfc}.csr-followup-list strong{font-size:11px}.csr-followup-list span,.csr-followup-list small{font-size:10px;color:#758196;float:right}.csr-followup-list p{font-size:11px;margin:6px 0 0;color:#475467}.csr-followup-form{display:grid;grid-template-columns:1.1fr .7fr .8fr 1.1fr;gap:9px 10px;padding:12px 14px 15px}.csr-followup-action{display:flex;align-items:center;gap:10px;grid-column:span 2}.csr-followup-action small{font-size:10px;color:#7a879a}.csr-empty{font-size:11px;color:#7a879a;background:#f8fafc;border:1px dashed #dbe2ec;border-radius:8px;padding:10px}.csr-actions{padding:11px 18px;border-top:1px solid #e4e8ef;background:#fff}.csr-save-note{margin-right:auto;font-size:10.5px;color:#c0392b;max-width:55%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.csr-modal-open{overflow:hidden}@media(max-width:1100px){.csr-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.csr-followup-form{grid-template-columns:repeat(2,minmax(0,1fr))}.csr-followup-list{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:680px){.csr-card{width:100vw;max-height:100vh;border-radius:0}.csr-scroll{max-height:calc(100vh - 132px);padding:10px}.csr-grid,.csr-followup-form{grid-template-columns:1fr}.csr-span-2,.csr-followup-action{grid-column:span 1}.csr-followup-list{grid-template-columns:1fr}.csr-advanced-toggle{align-items:flex-start}.csr-header{padding:14px}.csr-title-row{align-items:flex-start;flex-direction:column;gap:5px}}
.csr-field-inline{display:flex;align-items:stretch;gap:5px}.csr-field-inline input{flex:1;min-width:0}.csr-field-inline button{width:34px;flex:0 0 34px;border:1px solid #cfd7e3;border-radius:7px;background:#eef3ff;color:#3558b7;font-size:18px;font-weight:700;cursor:pointer}.csr-field-inline button:hover{background:#e1e9ff}.csr-field-inline button:disabled{opacity:.5;cursor:not-allowed}

/* v1.3.3: one all-fields Sales Record form */
.csr-all-fields-card{width:min(1520px,calc(100vw - 24px))}.csr-record-state{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border:1px solid #dce3ee;border-radius:10px;padding:11px 14px;margin-bottom:10px}.csr-record-state>div{display:flex;flex-direction:column;gap:2px}.csr-record-state strong{font-size:12.5px;color:#1f2937}.csr-record-state small{font-size:10.5px;color:#6f7c90}.csr-record-state>span{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;background:#eef3ff;color:#3558b7;font-size:10.5px;font-weight:700;white-space:nowrap}.csr-help{font-size:9.5px;color:#7b8798;font-weight:400;line-height:1.3}.csr-attachment-panel{padding:0 14px 14px}.csr-attachment-head{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #edf0f5;padding-top:12px}.csr-attachment-head>div:first-child{display:flex;flex-direction:column;gap:2px}.csr-attachment-head strong{font-size:11.5px}.csr-attachment-head small,.csr-file-name{font-size:10px;color:#78859a}.csr-attachment-head>div:last-child{display:flex;gap:7px}.csr-file-name{margin:7px 0}.csr-attachment-list{display:grid;gap:6px}.csr-attachment-item{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #e2e7ef;border-radius:8px;padding:8px 10px;background:#fafbfc}.csr-attachment-item>div:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}.csr-attachment-item strong{font-size:10.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.csr-attachment-item small{font-size:9.5px;color:#7a879a}.csr-attachment-item>div:last-child{display:flex;gap:8px;align-items:center}.csr-attachment-item a,.csr-attachment-item button{font:inherit;font-size:10px;color:#3558b7;background:none;border:0;padding:2px;cursor:pointer;text-decoration:none}.csr-attachment-item button{color:#c73737}.csr-audit-list{display:grid;gap:6px;padding:12px 14px 15px}.csr-audit-list article{display:grid;grid-template-columns:minmax(180px,1fr) auto auto;gap:12px;align-items:center;border-bottom:1px solid #edf0f5;padding:7px 0}.csr-audit-list strong{font-size:10.5px}.csr-audit-list span,.csr-audit-list small{font-size:9.5px;color:#7a879a}.csr-section.csr-advanced{border-left:3px solid #dfe7ff}@media(max-width:680px){.csr-record-state,.csr-attachment-head,.csr-attachment-item{align-items:flex-start;flex-direction:column}.csr-audit-list article{grid-template-columns:1fr;gap:2px}}

/* v1.3.4: mobile usability certification patch. Desktop >=721px is intentionally unchanged. */
@media (max-width: 720px) {
  html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    width: 100%;
    min-width: 0;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior-x: none;
  }

  body,
  .app-shell,
  .content,
  .view,
  .dashboard-grid,
  .lead-table-card,
  .lead-filter-panel,
  .member-table-card,
  .performance-card,
  .settings-card,
  .adv-card,
  .adv-table-card,
  .adv-report-card {
    max-width: 100%;
    min-width: 0;
  }

  .content {
    padding: 0 10px 14px;
  }

  .mobile-topbar {
    position: sticky;
    z-index: 90;
    top: 0;
    min-height: 52px;
    margin: 0 -10px 10px;
    padding: calc(7px + env(safe-area-inset-top, 0px)) 10px 7px;
    border-bottom: 1px solid var(--line, #d7e2f2);
    background: rgba(255,255,255,.97);
    box-shadow: 0 2px 10px rgba(20,32,51,.06);
    backdrop-filter: blur(12px);
  }

  .mobile-topbar > strong {
    min-width: 0;
    overflow: hidden;
    font-size: .95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    z-index: 220;
    width: min(86vw, 320px);
    max-width: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar .nav-list {
    gap: 14px;
  }

  .sidebar .nav-item {
    min-height: 46px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: .88rem;
  }

  .sidebar-account {
    margin-top: 8px;
  }

  .mobile-nav {
    z-index: 180;
    grid-template-columns: repeat(5, minmax(0,1fr));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav a {
    min-width: 0 !important;
    min-height: 58px;
    gap: 3px;
    padding: 8px 2px 7px;
    font-size: clamp(.56rem, 2.5vw, .68rem);
    line-height: 1.05;
    white-space: nowrap;
  }

  .mobile-nav a [data-icon] {
    width: 19px;
    height: 19px;
  }

  .page-header,
  .dashboard-header,
  .leads-page-header,
  .user-page-header {
    gap: 10px;
    margin-bottom: 10px;
  }

  .page-header h1,
  .dashboard-header h1,
  .leads-page-header h1 {
    font-size: 1.35rem;
    line-height: 1.15;
  }

  .page-header p,
  .dashboard-header p,
  .leads-page-header p {
    font-size: .78rem;
    line-height: 1.35;
  }

  .lead-page-actions,
  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 7px;
    width: 100%;
  }

  .lead-page-actions > *,
  .lead-page-actions button,
  .header-actions > *,
  .header-actions button {
    width: 100%;
    min-width: 0;
  }

  .lead-page-actions > .primary-action:last-of-type {
    grid-column: 1 / -1;
  }

  .sales-header-menu-panel {
    max-width: calc(100vw - 28px);
  }

  .lead-stats-grid,
  .sales-record-stats,
  .metrics-grid,
  .user-stats-grid,
  .performance-stats-grid,
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
  }

  .lead-stat-card,
  .sales-record-stat-card,
  .metric-card,
  .performance-stat-card,
  .dashboard-kpi {
    min-height: 82px;
    padding: 11px;
  }

  .lead-stat-card span,
  .sales-record-stat-card span,
  .dashboard-kpi span {
    font-size: .67rem;
  }

  .lead-stat-card strong,
  .sales-record-stat-card strong,
  .dashboard-kpi strong {
    font-size: 1.45rem;
  }

  .lead-stat-card small,
  .sales-record-stat-card small,
  .dashboard-kpi small {
    font-size: .64rem;
    line-height: 1.2;
  }

  .lead-filter-panel,
  .adv-filter-card {
    padding: 9px;
  }

  .filter-title-row,
  .adv-filter-title {
    gap: 7px;
  }

  .filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .filter-controls,
  .sales-record-filter-controls,
  .member-filter-controls,
  .performance-filter-controls,
  .adv-filter-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .filter-input,
  .filter-select,
  .filter-input input,
  .filter-select select,
  .adv-filter-grid input,
  .adv-filter-grid select,
  .lead-form-grid input,
  .lead-form-grid select,
  .lead-form-grid textarea,
  .settings-grid input,
  .settings-grid select,
  .settings-grid textarea,
  .adv-form-grid input,
  .adv-form-grid select,
  .adv-form-grid textarea,
  .csr-grid input,
  .csr-grid select,
  .csr-grid textarea,
  .csr-followup-form input,
  .csr-followup-form select,
  .csr-followup-form textarea,
  .csr-item-table input,
  .csr-item-table select {
    font-size: 16px !important;
  }

  .filter-input,
  .filter-select,
  .filter-controls .secondary-action,
  .primary-action,
  .secondary-action,
  .period-button,
  .adv-filter-grid input,
  .adv-filter-grid select {
    min-height: 42px;
  }

  /* Sales Records: mobile cards replace the 10-column desktop grid. */
  .lead-table-wrap {
    max-height: none;
    overflow: visible;
  }

  .sales-record-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border-collapse: separate;
  }

  .sales-record-table thead {
    display: none;
  }

  .sales-record-table tbody {
    display: grid;
    gap: 9px;
    width: 100%;
    padding: 8px;
  }

  .sales-record-table tr.sales-record-row {
    display: block;
    width: 100%;
    overflow: visible;
    border: 1px solid var(--line, #d7e2f2);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(20,32,51,.04);
  }

  .sales-record-table tr.sales-record-row td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .sales-record-table tr.sales-record-row td:last-child {
    min-height: 44px;
    border-bottom: 0;
  }

  .sales-record-table tr.sales-record-row td::before {
    align-self: start;
    color: #718096;
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .sales-record-table tr.sales-record-row td:nth-child(1)::before { content: "Type"; }
  .sales-record-table tr.sales-record-row td:nth-child(2)::before { content: "Date"; }
  .sales-record-table tr.sales-record-row td:nth-child(3)::before { content: "Company / Client"; }
  .sales-record-table tr.sales-record-row td:nth-child(4)::before { content: "Contact"; }
  .sales-record-table tr.sales-record-row td:nth-child(5)::before { content: "Enquiry No."; }
  .sales-record-table tr.sales-record-row td:nth-child(6)::before { content: "Status / Stage"; }
  .sales-record-table tr.sales-record-row td:nth-child(7)::before { content: "Pipeline Value"; }
  .sales-record-table tr.sales-record-row td:nth-child(8)::before { content: "Salesperson"; }
  .sales-record-table tr.sales-record-row td:nth-child(9)::before { content: "Source"; }
  .sales-record-table tr.sales-record-row td:nth-child(10)::before { content: "Actions"; }

  .sales-record-table tr.sales-record-row td strong,
  .sales-record-table tr.sales-record-row td b {
    font-size: .82rem;
  }

  .sales-record-table tr.sales-record-row td span {
    font-size: .70rem;
  }

  .sales-record-table .row-actions {
    justify-self: end;
  }

  .sales-record-table .row-menu-button,
  .sales-record-table .table-text-button {
    min-width: 44px;
    min-height: 38px;
  }

  .sales-record-table tbody > tr:not(.sales-record-row) {
    display: block;
  }

  .sales-record-table tbody > tr:not(.sales-record-row) > td {
    display: block;
    width: 100%;
  }

  .table-footer {
    gap: 8px;
    padding: 9px;
  }

  .sales-record-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 7px;
    width: 100%;
    align-items: center;
  }

  .sales-record-pagination button {
    min-height: 40px;
  }

  /* Unified Add Sales Record form: full-screen, touch-friendly, no sideways page scroll. */
  .csr-modal {
    align-items: stretch;
    padding: 0;
  }

  .csr-modal .modal-backdrop {
    display: none;
  }

  .csr-card,
  .csr-all-fields-card {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .csr-header {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    gap: 8px;
    padding: calc(11px + env(safe-area-inset-top, 0px)) 12px 10px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(20,32,51,.06);
  }

  .csr-header > div:first-child {
    min-width: 0;
  }

  .csr-title-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .csr-title-row h2 {
    font-size: 1.05rem;
  }

  #csrSubtitle {
    margin: 5px 0 0;
    font-size: .70rem;
    line-height: 1.3;
  }

  .csr-header .icon-button {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
  }

  .csr-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 9px 8px 14px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .csr-record-state {
    gap: 8px;
    padding: 10px;
  }

  .csr-record-state > span {
    white-space: normal;
  }

  .csr-section {
    margin-bottom: 8px;
    border-radius: 9px;
  }

  .csr-section > summary {
    min-height: 52px;
    padding: 10px;
    touch-action: manipulation;
  }

  .csr-section > summary > span {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .csr-section > summary strong {
    font-size: .84rem;
  }

  .csr-section > summary small {
    font-size: .67rem;
    line-height: 1.25;
  }

  .csr-grid,
  .csr-offer-grid,
  .csr-followup-form {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 11px 10px 13px;
  }

  .csr-span-2,
  .csr-followup-action {
    grid-column: auto;
  }

  .csr-grid label > span,
  .csr-followup-form label > span {
    font-size: .73rem;
  }

  .csr-grid input,
  .csr-grid select,
  .csr-grid textarea,
  .csr-followup-form input,
  .csr-followup-form select,
  .csr-followup-form textarea,
  .csr-field-inline button {
    min-height: 44px;
  }

  .csr-grid textarea,
  .csr-followup-form textarea {
    min-height: 84px;
  }

  .csr-field-inline button {
    width: 44px;
    flex-basis: 44px;
  }

  .csr-item-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 10px;
  }

  .csr-item-toolbar button {
    width: 100%;
    min-height: 44px;
  }

  .csr-item-scroll {
    overflow: visible;
    border-top: 1px solid #edf0f5;
    border-bottom: 1px solid #edf0f5;
  }

  .csr-item-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .csr-item-table thead {
    display: none;
  }

  .csr-item-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .csr-item-table tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 9px;
    padding: 10px;
    border: 1px solid #dce3ee;
    border-radius: 10px;
    background: #fbfdff;
  }

  .csr-item-table td {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .csr-item-table td::before {
    color: #65738a;
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .csr-item-table td:nth-child(1) {
    grid-column: 1 / -1;
    display: block;
    width: auto;
    padding-right: 46px;
    color: #27456f;
    text-align: left;
    font-size: .75rem;
    font-weight: 750;
  }
  .csr-item-table td:nth-child(1)::before { content: "Product line "; }
  .csr-item-table td:nth-child(2),
  .csr-item-table td:nth-child(3),
  .csr-item-table td:nth-child(10),
  .csr-item-table td:nth-child(11) { grid-column: 1 / -1; }
  .csr-item-table td:nth-child(2)::before { content: "Product / Machine"; }
  .csr-item-table td:nth-child(3)::before { content: "Requirement / Model"; }
  .csr-item-table td:nth-child(4)::before { content: "Quantity"; }
  .csr-item-table td:nth-child(5)::before { content: "Offer Price"; }
  .csr-item-table td:nth-child(6)::before { content: "Revised Price"; }
  .csr-item-table td:nth-child(7)::before { content: "Final Price"; }
  .csr-item-table td:nth-child(8)::before { content: "Ordered Qty"; }
  .csr-item-table td:nth-child(9)::before { content: "Order Price"; }
  .csr-item-table td:nth-child(10)::before { content: "Item Status"; }

  .csr-item-table td:nth-child(11) {
    position: absolute;
    top: 7px;
    right: 7px;
    width: auto;
  }

  .csr-item-table td:nth-child(11)::before {
    display: none;
  }

  .csr-requirement-stack {
    min-width: 0;
  }

  .csr-item-table input,
  .csr-item-table select {
    width: 100%;
    min-height: 44px;
    padding: 8px;
  }

  .csr-remove-item {
    width: 40px;
    height: 40px;
  }

  .csr-commercial-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 6px;
    padding: 10px;
  }

  .csr-commercial-summary span {
    justify-content: space-between;
    padding: 7px 8px;
    border-radius: 7px;
    background: #f7f9fc;
  }

  .csr-followup-list {
    grid-template-columns: 1fr;
  }

  .csr-followup-action {
    display: grid;
    gap: 6px;
  }

  .csr-followup-action button {
    min-height: 44px;
  }

  .csr-attachment-panel {
    padding: 0 10px 12px;
  }

  .csr-attachment-head,
  .csr-attachment-item {
    align-items: stretch;
    flex-direction: column;
  }

  .csr-attachment-head > div:last-child,
  .csr-attachment-item > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    width: 100%;
    gap: 7px;
  }

  .csr-attachment-head button,
  .csr-attachment-item a,
  .csr-attachment-item button {
    min-height: 42px;
    text-align: center;
  }

  .csr-audit-list article {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .csr-actions {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    flex: 0 0 auto;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: 0 -2px 10px rgba(20,32,51,.07);
  }

  .csr-actions .csr-save-note {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    margin: 0;
    white-space: normal;
  }

  .csr-actions button {
    width: 100%;
    min-height: 44px;
  }

  /* Advanced import / reports / IAM / backup pages. */
  .adv-import-modal-card,
  .adv-enquiry-modal-card {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    overflow: auto;
  }

  .adv-import-steps {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .adv-preview-summary,
  .adv-kpi-grid,
  .adv-report-kpis {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .adv-import-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .adv-import-actions button {
    min-height: 44px;
  }

  .adv-preview-table,
  .adv-table-scroll,
  .adv-subtable,
  .performance-table-wrap,
  .user-table-wrap,
  .audit-table-wrap,
  .backup-table-wrap,
  .adv-report-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .adv-report-tabs,
  .iam-tabs,
  .performance-tabs,
  .segmented {
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .adv-report-tabs button,
  .iam-tabs button,
  .performance-tabs button {
    min-height: 40px;
  }

  .adv-report-header,
  .panel-heading-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .adv-report-header .header-actions,
  .panel-heading-row > button {
    width: 100%;
  }

  .backup-schedule-form {
    grid-template-columns: 1fr;
  }

  .auth-form-panel {
    padding: 16px 12px;
  }

  .auth-card {
    width: 100%;
    max-width: 480px;
    padding: 20px 16px;
  }

  .auth-card input,
  .auth-card select,
  .auth-card textarea {
    min-height: 44px;
    font-size: 16px !important;
  }

  .modal-card:not(.csr-card):not(.adv-import-modal-card):not(.adv-enquiry-modal-card) {
    width: min(calc(100% - 16px), 560px);
    max-height: calc(100dvh - 20px);
  }

  .row-menu {
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 420px) {
  .lead-stats-grid,
  .sales-record-stats,
  .metrics-grid,
  .user-stats-grid,
  .performance-stats-grid,
  .dashboard-kpis,
  .adv-kpi-grid,
  .adv-preview-summary,
  .adv-report-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .lead-page-actions,
  .header-actions {
    grid-template-columns: 1fr;
  }

  .lead-page-actions > .primary-action:last-of-type {
    grid-column: auto;
  }

  .csr-item-table tr {
    grid-template-columns: 1fr;
  }

  .csr-item-table td:nth-child(n) {
    grid-column: 1 / -1;
  }

  .csr-item-table td:nth-child(11) {
    position: absolute;
  }

  .csr-commercial-summary {
    grid-template-columns: 1fr;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 920px) {
  .mobile-nav {
    min-height: 48px;
  }
  .mobile-nav a {
    min-height: 48px;
    padding-block: 5px;
  }
  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  .csr-header {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

/* v1.3.6 TRUE mobile navigation: desktop sidebar disappears; app launcher replaces it. */
.mobile-app-launcher{display:none}
@media (max-width:720px){
  /* Never show/squeeze the desktop sidebar on a phone. */
  .sidebar,
  .sidebar.open{
    display:none!important;
    visibility:hidden!important;
    transform:none!important;
    pointer-events:none!important;
  }

  /* Avoid two different mobile navigation systems. The launcher is the mobile menu. */
  .mobile-nav{display:none!important}
  body{padding-bottom:0!important}

  .mobile-app-launcher{
    position:fixed;
    z-index:3000;
    inset:0;
    display:none;
    background:#eef3f8;
    color:#172033;
    overflow:hidden;
  }
  .mobile-app-launcher.open{display:block}
  body.mobile-launcher-open{overflow:hidden!important}

  .mobile-launcher-shell{
    width:100%;
    height:100%;
    max-width:100%;
    display:flex;
    flex-direction:column;
    background:#f7f9fc;
  }
  .mobile-launcher-header{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    gap:10px;
    min-height:60px;
    padding:calc(9px + env(safe-area-inset-top,0px)) 12px 9px;
    background:#1f4f83;
    color:#fff;
  }
  .mobile-launcher-brandmark{
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    flex:0 0 34px;
    border-radius:10px;
    background:#fff;
    color:#1f4f83;
    font-size:13px;
    font-weight:800;
  }
  .mobile-launcher-title{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:1px;
  }
  .mobile-launcher-title strong{
    overflow:hidden;
    font-size:13px;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .mobile-launcher-title small{
    overflow:hidden;
    color:rgba(255,255,255,.78);
    font-size:10px;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .mobile-launcher-close{
    margin-left:auto;
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    border:0;
    border-radius:50%;
    background:rgba(255,255,255,.16);
    color:#fff;
    font-size:24px;
    line-height:1;
    cursor:pointer;
  }

  .mobile-launcher-search-wrap{
    flex:0 0 auto;
    padding:9px 10px 5px;
  }
  .mobile-launcher-search{
    width:100%;
    min-height:43px;
    box-sizing:border-box;
    border:1px solid #dce5f0;
    border-radius:11px;
    background:#fff;
    padding:8px 12px;
    color:#172033;
    font:inherit;
    font-size:16px;
    outline:none;
    box-shadow:0 1px 4px rgba(20,42,68,.05);
  }
  .mobile-launcher-search:focus{border-color:#78a9dd;box-shadow:0 0 0 3px rgba(44,114,184,.12)}

  .mobile-launcher-scroll{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:4px 10px 12px;
  }
  .mobile-launcher-group{margin:8px 0 13px}
  .mobile-launcher-heading{
    display:block;
    margin:0 2px 7px;
    color:#6f8093;
    font-size:10px;
    font-weight:800;
    letter-spacing:.06em;
    text-transform:uppercase;
  }
  .mobile-launcher-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
  }
  .mobile-launcher-tile{
    min-width:0;
    min-height:76px;
    padding:8px 4px 7px;
    border:1px solid #dce5ef;
    border-radius:12px;
    background:#fff;
    color:#23364d;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    text-align:center;
    font:inherit;
    font-size:10px;
    font-weight:700;
    line-height:1.12;
    cursor:pointer;
    box-shadow:0 1px 3px rgba(20,42,68,.05);
  }
  .mobile-launcher-tile:active{transform:translateY(1px)}
  .mobile-launcher-tile.active{
    border-color:#7ba8d7;
    background:#eef6ff;
    color:#164e7d;
  }
  .mobile-launcher-icon{
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    border-radius:9px;
    background:#eef5fb;
    color:#245f95;
  }
  .mobile-launcher-icon [data-icon]{width:20px;height:20px}
  .mobile-launcher-label{
    width:100%;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }
  .mobile-launcher-empty{
    padding:30px 10px;
    color:#718096;
    font-size:12px;
    text-align:center;
  }

  .mobile-launcher-footer{
    flex:0 0 auto;
    padding:8px 10px calc(9px + env(safe-area-inset-bottom,0px));
    border-top:1px solid #dbe4ee;
    background:#fff;
  }
  .mobile-launcher-user{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:7px;
  }
  .mobile-launcher-avatar{
    display:grid;
    place-items:center;
    width:32px;
    height:32px;
    flex:0 0 32px;
    border-radius:50%;
    background:#dceeff;
    color:#1f5e93;
    font-size:10px;
    font-weight:800;
  }
  .mobile-launcher-user>div{min-width:0;display:flex;flex-direction:column}
  .mobile-launcher-user strong{overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
  .mobile-launcher-user small{overflow:hidden;color:#718096;font-size:9.5px;text-overflow:ellipsis;white-space:nowrap}
  .mobile-launcher-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
  .mobile-launcher-actions button{
    min-height:40px;
    border:1px solid #d6e0eb;
    border-radius:9px;
    background:#fff;
    color:#31455d;
    font:inherit;
    font-size:11px;
    font-weight:700;
  }
  .mobile-launcher-actions button:last-child{color:#c52f2f}

  /* Closed mobile app uses the whole phone width. */
  .app-shell{width:100%!important;max-width:100%!important;margin:0!important}
  .content{width:100%!important;max-width:100%!important;margin:0!important;box-sizing:border-box}
}

@media (max-width:380px){
  .mobile-launcher-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* v1.3.7: consistent sales-stage color system */
:root {
  --stage-blue-bg:#eef4ff; --stage-blue-border:#b7cdfd; --stage-blue-text:#2457c5;
  --stage-cyan-bg:#ecfeff; --stage-cyan-border:#a5f3fc; --stage-cyan-text:#0e7490;
  --stage-hot-bg:#fff4e8; --stage-hot-border:#fdba74; --stage-hot-text:#c2410c;
  --stage-amber-bg:#fffbeb; --stage-amber-border:#fcd34d; --stage-amber-text:#a16207;
  --stage-purple-bg:#f5f3ff; --stage-purple-border:#c4b5fd; --stage-purple-text:#6d28d9;
  --stage-indigo-bg:#eef2ff; --stage-indigo-border:#a5b4fc; --stage-indigo-text:#4338ca;
  --stage-green-bg:#ecfdf3; --stage-green-border:#86efac; --stage-green-text:#15803d;
  --stage-red-bg:#fff1f2; --stage-red-border:#fda4af; --stage-red-text:#be123c;
  --stage-gray-bg:#f8fafc; --stage-gray-border:#cbd5e1; --stage-gray-text:#64748b;
  --stage-teal-bg:#f0fdfa; --stage-teal-border:#99f6e4; --stage-teal-text:#0f766e;
}

/* Sales Records status/stage badges */
.status-pill.new,
.status-pill.open,
.status-pill.inquirystage,
.status-pill.newenquiry { background:var(--stage-blue-bg); border-color:var(--stage-blue-border); color:var(--stage-blue-text)!important; }
.status-pill.qualified { background:var(--stage-cyan-bg); border-color:var(--stage-cyan-border); color:var(--stage-cyan-text)!important; }
.status-pill.follow-up,
.status-pill.followup { background:var(--stage-teal-bg); border-color:var(--stage-teal-border); color:var(--stage-teal-text)!important; }
.status-pill.hot,
.status-pill.hotlist { background:var(--stage-hot-bg); border-color:var(--stage-hot-border); color:var(--stage-hot-text)!important; }
.status-pill.demostage { background:var(--stage-cyan-bg); border-color:var(--stage-cyan-border); color:var(--stage-cyan-text)!important; }
.status-pill.proposalstage,
.status-pill.offersubmitted,
.status-pill.offersent { background:var(--stage-amber-bg); border-color:var(--stage-amber-border); color:var(--stage-amber-text)!important; }
.status-pill.negotiation { background:var(--stage-purple-bg); border-color:var(--stage-purple-border); color:var(--stage-purple-text)!important; }
.status-pill.finalstage { background:var(--stage-indigo-bg); border-color:var(--stage-indigo-border); color:var(--stage-indigo-text)!important; }
.status-pill.won,
.status-pill.closedwon,
.status-pill.converted,
.status-pill.ordered { background:var(--stage-green-bg); border-color:var(--stage-green-border); color:var(--stage-green-text)!important; }
.status-pill.lost { background:var(--stage-red-bg); border-color:var(--stage-red-border); color:var(--stage-red-text)!important; }
.status-pill.dropped,
.status-pill.cancelled,
.status-pill.closed { background:var(--stage-gray-bg); border-color:var(--stage-gray-border); color:var(--stage-gray-text)!important; }

/* Advanced enquiry + report stage badges */
.adv-badge.stage-newenquiry,
.adv-badge.stage-inquirystage,
.adv-badge.stage-open { background:var(--stage-blue-bg); border-color:var(--stage-blue-border); color:var(--stage-blue-text); }
.adv-badge.stage-qualified,
.adv-badge.stage-demostage { background:var(--stage-cyan-bg); border-color:var(--stage-cyan-border); color:var(--stage-cyan-text); }
.adv-badge.stage-hotlist,
.adv-badge.stage-hot { background:var(--stage-hot-bg); border-color:var(--stage-hot-border); color:var(--stage-hot-text); }
.adv-badge.stage-offersubmitted,
.adv-badge.stage-proposalstage,
.adv-badge.stage-offersent { background:var(--stage-amber-bg); border-color:var(--stage-amber-border); color:var(--stage-amber-text); }
.adv-badge.stage-negotiation { background:var(--stage-purple-bg); border-color:var(--stage-purple-border); color:var(--stage-purple-text); }
.adv-badge.stage-finalstage { background:var(--stage-indigo-bg); border-color:var(--stage-indigo-border); color:var(--stage-indigo-text); }
.adv-badge.stage-won,
.adv-badge.stage-closedwon,
.adv-badge.stage-converted,
.adv-badge.stage-ordered { background:var(--stage-green-bg); border-color:var(--stage-green-border); color:var(--stage-green-text); }
.adv-badge.stage-lost { background:var(--stage-red-bg); border-color:var(--stage-red-border); color:var(--stage-red-text); }
.adv-badge.stage-dropped,
.adv-badge.stage-cancelled,
.adv-badge.stage-closed { background:var(--stage-gray-bg); border-color:var(--stage-gray-border); color:var(--stage-gray-text); }

/* Sales Funnel cards: same stage = same color */
.funnel-stage-card.stage-inquirystage { border-top:4px solid #3b82f6; background:linear-gradient(180deg,var(--stage-blue-bg),#fff 36%); }
.funnel-stage-card.stage-demostage { border-top:4px solid #06b6d4; background:linear-gradient(180deg,var(--stage-cyan-bg),#fff 36%); }
.funnel-stage-card.stage-proposalstage { border-top:4px solid #f59e0b; background:linear-gradient(180deg,var(--stage-amber-bg),#fff 36%); }
.funnel-stage-card.stage-negotiation { border-top:4px solid #8b5cf6; background:linear-gradient(180deg,var(--stage-purple-bg),#fff 36%); }
.funnel-stage-card.stage-closedwon { border-top:4px solid #22c55e; background:linear-gradient(180deg,var(--stage-green-bg),#fff 36%); }
.funnel-stage-card.stage-inquirystage .funnel-stage-number { background:var(--stage-blue-bg); color:var(--stage-blue-text); }
.funnel-stage-card.stage-demostage .funnel-stage-number { background:var(--stage-cyan-bg); color:var(--stage-cyan-text); }
.funnel-stage-card.stage-proposalstage .funnel-stage-number { background:var(--stage-amber-bg); color:var(--stage-amber-text); }
.funnel-stage-card.stage-negotiation .funnel-stage-number { background:var(--stage-purple-bg); color:var(--stage-purple-text); }
.funnel-stage-card.stage-closedwon .funnel-stage-number { background:var(--stage-green-bg); color:var(--stage-green-text); }
.funnel-stage-card.stage-inquirystage small { color:var(--stage-blue-text); }
.funnel-stage-card.stage-demostage small { color:var(--stage-cyan-text); }
.funnel-stage-card.stage-proposalstage small { color:var(--stage-amber-text); }
.funnel-stage-card.stage-negotiation small { color:var(--stage-purple-text); }
.funnel-stage-card.stage-closedwon small { color:var(--stage-green-text); }

@media (prefers-contrast: more) {
  .status-pill,
  .adv-badge { border-width:2px; }
}

/* v1.4.0 approved Sales Record workflow */
.csr-master-add{width:34px;min-width:34px;min-height:34px;border:1px solid #cfd7e3;border-radius:7px;background:#eef3ff;color:#3558b7;font-size:18px;font-weight:800;line-height:1;cursor:pointer}
.csr-master-add:hover{background:#e1e9ff}.csr-master-add:focus-visible{outline:2px solid #6d8cf5;outline-offset:1px}
.csr-duplicate-warning{margin-top:5px;padding:7px 8px;border:1px solid #f0d48d;border-radius:8px;background:#fff8e6;color:#745822;font-size:9.5px;line-height:1.35}
.csr-duplicate-warning strong{display:block;margin-bottom:4px}.csr-duplicate-warning button{display:block;width:100%;border:0;background:transparent;text-align:left;color:#2f57b5;padding:3px 0;font-size:9.5px;font-weight:700}.csr-duplicate-warning button small{color:#7c8798;font-weight:500}
.csr-item-table-v140{min-width:1320px}.csr-item-table-v140 [data-item-field="finalAmount"]{background:#f2f7ff;color:#2b4f9f;font-weight:800}
.csr-update-item{min-height:29px!important;padding:4px 8px!important;font-size:10px!important;white-space:nowrap}
.csr-closure-list{display:grid;gap:9px;padding:12px 14px 15px}.csr-closure-card{border:1px solid #e0e7f0;border-radius:10px;background:#fff;overflow:hidden}.csr-closure-card.won{border-left:4px solid #16875c}.csr-closure-card.lost{border-left:4px solid #c33b3b}.csr-closure-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px;border-bottom:1px solid #edf1f5;background:#fafcff}.csr-closure-head strong{font-size:11.5px}.csr-closure-head span{font-size:10px;color:#6e7a8d}.csr-closure-grid{padding:10px 11px 12px}
.csr-followup-form-v140 textarea{min-height:70px}.csr-followup-list article p{float:none;margin:4px 0 0;line-height:1.35}.csr-followup-list article span{float:right}
.csr-audit-grouped{gap:10px}.csr-audit-day{border:1px solid #e1e7ef;border-radius:10px;overflow:hidden;background:#fff}.csr-audit-day>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;background:#f5f8fc;border-bottom:1px solid #e4e9f1}.csr-audit-day>header strong{font-size:11px;color:#314159}.csr-audit-day>header span{font-size:9.5px;color:#748196}.csr-audit-entry{display:grid!important;grid-template-columns:minmax(180px,.55fr) minmax(0,1.45fr)!important;gap:10px!important;align-items:start!important;padding:9px 10px!important;border-bottom:1px solid #edf1f5!important}.csr-audit-entry:last-child{border-bottom:0!important}.csr-audit-meta{display:grid;grid-template-columns:1fr;gap:2px}.csr-audit-meta strong{font-size:10.5px}.csr-audit-meta span,.csr-audit-meta time{font-size:9px;color:#7a8698}.csr-audit-action>b{display:block;font-size:10.5px}.csr-audit-action>small{display:block;margin-top:2px;font-size:9px;color:#7a8698}.csr-audit-changes{display:grid;gap:4px;margin-top:6px}.csr-audit-changes>div{display:grid;grid-template-columns:minmax(110px,.7fr) minmax(0,1fr) auto minmax(0,1fr);gap:5px;align-items:start;padding:4px 6px;border-radius:6px;background:#fafbfc;font-size:9px;line-height:1.3}.csr-audit-changes strong{font-size:9px}.csr-audit-changes .old{color:#a04444;word-break:break-word}.csr-audit-changes .new{color:#16724d;word-break:break-word}.csr-audit-changes i{font-style:normal;color:#8a95a5}
@media(max-width:720px){.csr-master-add{min-height:42px;width:42px;min-width:42px}.csr-closure-head{align-items:flex-start;flex-direction:column}.csr-audit-entry{grid-template-columns:1fr!important}.csr-audit-changes>div{grid-template-columns:1fr}.csr-audit-changes i{display:none}.csr-item-table-v140{min-width:0}.csr-item-table-v140,.csr-item-table-v140 tbody,.csr-item-table-v140 tr,.csr-item-table-v140 td{display:block}.csr-item-table-v140 thead{display:none}.csr-item-table-v140 tr{border:1px solid #e1e7ef;border-radius:10px;margin:8px;background:#fff;padding:8px}.csr-item-table-v140 td{border:0;padding:4px}.csr-item-table-v140 td::before{display:block;font-size:9px;font-weight:700;color:#6b7789;margin-bottom:3px}.csr-item-table-v140 td:nth-child(1)::before{content:"Sr."}.csr-item-table-v140 td:nth-child(2)::before{content:"Product / Machine"}.csr-item-table-v140 td:nth-child(3)::before{content:"Requirement / Model"}.csr-item-table-v140 td:nth-child(4)::before{content:"Qty"}.csr-item-table-v140 td:nth-child(5)::before{content:"Offer Price"}.csr-item-table-v140 td:nth-child(6)::before{content:"Revised Price"}.csr-item-table-v140 td:nth-child(7)::before{content:"Final Amount"}.csr-item-table-v140 td:nth-child(8)::before{content:"Ordered Qty"}.csr-item-table-v140 td:nth-child(9)::before{content:"Status"}.csr-item-table-v140 td:nth-child(10)::before{content:"Update"}.csr-item-table-v140 td:nth-child(11)::before{content:"Remove"}}

/* v1.4.9 resilient Sales Record draft protection */
.csr-draft-recovery{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#fff8e8;border:1px solid #efd79d;border-radius:10px;padding:10px 12px;margin-bottom:10px}.csr-draft-recovery[hidden]{display:none}.csr-draft-recovery>div:first-child{display:flex;flex-direction:column;gap:2px}.csr-draft-recovery strong{font-size:11.5px;color:#6f551a}.csr-draft-recovery small{font-size:10px;color:#856b32}.csr-draft-recovery>div:last-child{display:flex;gap:7px;flex:0 0 auto}.csr-draft-status-wrap{display:flex;flex-direction:column;gap:2px;margin-right:auto;min-width:0}.csr-draft-save-status{font-size:10px;color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:520px}.csr-draft-save-status[data-mode="server"]{color:#16865b}.csr-draft-save-status[data-mode="local"]{color:#355fb8}.csr-draft-save-status[data-mode="offline"]{color:#a16b14}.csr-draft-save-status[data-mode="saving"]{color:#6b4db5}.csr-draft-save-status[data-mode="dirty"]{color:#a15f14}.csr-actions{display:flex;align-items:center;gap:8px}.csr-actions #csrSaveDraft{white-space:nowrap}
@media(max-width:720px){.csr-draft-recovery{align-items:flex-start;flex-direction:column}.csr-draft-recovery>div:last-child{width:100%}.csr-draft-recovery>div:last-child button{flex:1}.csr-actions{flex-wrap:wrap}.csr-draft-status-wrap{width:100%;order:-1}.csr-draft-save-status{max-width:100%;white-space:normal}.csr-actions #csrSaveDraft,.csr-actions [data-csr-close],.csr-actions #csrSave{flex:1;min-width:0}}


/* MSALES v1.5.4 - quick Master Value dialog containment + permission-safe closed state */
.csr-quick-master-modal[hidden]{display:none!important}
.csr-quick-master-modal{position:fixed;inset:0;z-index:1325;display:none;align-items:center;justify-content:center;padding:18px;box-sizing:border-box}
.csr-quick-master-modal.open:not([hidden]){display:flex}
.csr-quick-master-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(1.5px)}
.csr-quick-master-card{position:relative;z-index:1;width:min(470px,calc(100vw - 30px));max-height:min(640px,calc(100vh - 30px));overflow:auto;margin:0;background:#fff;border:1px solid #dce3ee;border-radius:14px;box-shadow:0 24px 70px rgba(15,23,42,.26);color:#1f2937}
.csr-quick-master-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:18px 18px 14px;border-bottom:1px solid #e8edf4}
.csr-quick-master-header>div{min-width:0}.csr-quick-master-header h3{margin:7px 0 2px;font-size:18px;line-height:1.2}.csr-quick-master-header p{margin:0;color:#718096;font-size:11px;line-height:1.45}
.csr-quick-master-body{display:grid;gap:10px;padding:16px 18px}.csr-quick-master-body label{display:grid;gap:6px}.csr-quick-master-body label>span{font-size:11px;font-weight:700;color:#49566a}.csr-quick-master-body input{width:100%;min-height:38px;box-sizing:border-box;border:1px solid #cfd7e3;border-radius:8px;background:#fff;color:#1f2937;padding:8px 10px;font:inherit;font-size:12px;outline:none}.csr-quick-master-body input:focus{border-color:#6d8cf5;box-shadow:0 0 0 2px rgba(53,99,233,.1)}.csr-quick-master-body>small{font-size:10px;line-height:1.45;color:#7a879a}
.csr-quick-master-duplicate{display:grid;gap:5px;padding:10px;border:1px solid #f3d09b;border-radius:8px;background:#fff9ed}.csr-quick-master-duplicate[hidden]{display:none!important}.csr-quick-master-duplicate strong{font-size:10.5px;color:#8a5a13}.csr-quick-master-duplicate span{font-size:10px;color:#795b31}.csr-quick-master-duplicate button{justify-self:start}
.csr-quick-master-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 18px 16px;border-top:1px solid #edf0f5}
.csr-master-add[hidden]{display:none!important}
@media(max-width:680px){.csr-quick-master-modal{padding:10px;align-items:flex-end}.csr-quick-master-card{width:100%;max-height:88vh;border-radius:14px 14px 8px 8px}.csr-quick-master-header,.csr-quick-master-body{padding-left:14px;padding-right:14px}.csr-quick-master-actions{padding:11px 14px 14px}.csr-quick-master-actions>button{min-height:42px}}

/* MSALES_EXEC_CITY_ADMIN_TEST_LOGIN_v1.5.5 cumulative UI marker */


/* MSALES v1.5.7 - readable Sales Record save error */
.csr-draft-status-wrap{flex:1 1 520px}
.csr-save-note[data-state="error"]{display:block;width:100%;max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;margin:0 0 3px;padding:7px 9px;border:1px solid #efb7b1;border-radius:7px;background:#fff1f0;color:#a62f25;font-size:10.5px;line-height:1.4;font-weight:650}
.csr-save-note[data-state="saving"]{white-space:normal;overflow:visible;text-overflow:clip;color:#55657a}
@media(max-width:720px){.csr-save-note[data-state="error"]{font-size:11px;padding:8px 9px}.csr-draft-status-wrap{flex-basis:100%}}
/* MSALES v1.5.7 END */
