/* Paper layout adapted from the supplied IDEASA estimate builder. */
.estimate-scope { --paper:#fff;--ink:#111827;--brand:#111827;--line:#d1d5db;--soft:#f9fafb;color:var(--ink);font:13px Arial,"Apple SD Gothic Neo","Malgun Gothic",sans-serif; }
.estimate-scope *, .estimate-scope *::before, .estimate-scope *::after {box-sizing:border-box;}
.estimate-scope .paper {
      width: 210mm;
      height: 297mm;
      margin: 0 auto 22px;
      padding: 19mm 18mm 16mm;
      background: var(--paper);
      box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      page-break-after: always;
    }.estimate-scope .paper:last-child { page-break-after: auto; }.estimate-scope input,
.estimate-scope textarea,
.estimate-scope select {
      width: 100%;
      border: 1px solid transparent;
      border-radius: 5px;
      padding: 5px 6px;
      font: inherit;
      color: var(--ink);
      background: transparent;
      outline: none;
    }.estimate-scope input:hover,
.estimate-scope textarea:hover,
.estimate-scope input:focus,
.estimate-scope textarea:focus,
.estimate-scope select:hover,
.estimate-scope select:focus {
      border-color: #93c5fd;
      background: #eff6ff;
    }.estimate-scope textarea { resize: vertical; min-height: 74px; line-height: 1.5; }.estimate-scope .doc-header {
      position: relative;
      display: block;
      height: 74px;
      margin-bottom: 10px;
      flex: 0 0 auto;
    }.estimate-scope .title {
      margin: 0;
      font-size: 42px;
      line-height: 1;
      font-weight: 800;
      letter-spacing: 6px;
    }.estimate-scope .logo-box {
      position: absolute;
      right: 0;
      top: -10px;
      width: 230px;
      height: 70px;
      display: flex;
      align-items: flex-start;
      justify-content: flex-end;
      text-align: right;
      pointer-events: none;
      overflow: hidden;
    }.estimate-scope .logo-preview {
      max-width: 220px;
      max-height: 62px;
      object-fit: contain;
      object-position: right top;
      display: none;
    }.estimate-scope .logo-placeholder {
      font-size: 20px;
      font-weight: 700;
      color: #3b2cc9;
      text-align: right;
    }.estimate-scope .logo-control {
      margin-top: 14px;
      border-top: 1px solid #e5e7eb;
      padding-top: 14px;
    }.estimate-scope .stamp-control {
      margin-top: 14px;
      border-top: 1px solid #e5e7eb;
      padding-top: 14px;
    }.estimate-scope .logo-control label,
.estimate-scope .stamp-control label {
      display: block;
      margin-bottom: 6px;
      font-weight: 700;
      font-size: 13px;
    }.estimate-scope .file-action-row {
      display: grid;
      grid-template-columns: 1fr 54px;
      gap: 6px;
      align-items: center;
    }.estimate-scope .logo-control input[type="file"],
.estimate-scope .stamp-control input[type="file"] {
      border: 1px solid #d1d5db;
      background: #f9fafb;
      padding: 8px;
      font-size: 12px;
      min-width: 0;
    }.estimate-scope .file-delete-btn {
      height: 33px;
      border: 1px solid #d1d5db;
      border-radius: 8px;
      background: #fff;
      color: #991b1b;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
    }.estimate-scope .file-delete-btn:hover {
      background: #fee2e2;
    }.estimate-scope .top-info {
      display: block;
      margin-bottom: 7px;
      flex: 0 0 auto;
    }.estimate-scope .client-block {
      max-width: 540px;
    }.estimate-scope .simple-row {
      display: grid;
      grid-template-columns: 86px 1fr;
      align-items: center;
      min-height: 24px;
      margin-bottom: 1px;
    }.estimate-scope .simple-label {
      color: #111827;
      font-weight: 700;
      font-size: 12px;
    }.estimate-scope .simple-row input {
      font-size: 13px;
      font-weight: 600;
      padding-top: 2px;
      padding-bottom: 2px;
    }.estimate-scope .intro-text {
      margin-top: 12px;
      color: #374151;
      font-size: 13px;
    }.estimate-scope .meta-card {
      border: 1px solid var(--line);
      border-radius: 9px;
      overflow: hidden;
    }.estimate-scope .meta-row {
      display: grid;
      grid-template-columns: 78px 1fr;
      min-height: 34px;
      border-bottom: 1px solid var(--line);
    }.estimate-scope .meta-row:last-child { border-bottom: 0; }.estimate-scope .meta-label {
      display: flex;
      align-items: center;
      justify-content: center;
      border-right: 1px solid var(--line);
      background: var(--soft);
      font-size: 12px;
      font-weight: 700;
    }.estimate-scope .meta-row input { font-weight: 600; }.estimate-scope .continued-header {
      display: block;
      border-bottom: 3px solid var(--brand);
      padding-bottom: 14px;
      margin-bottom: 20px;
      flex: 0 0 auto;
    }.estimate-scope .continued-title {
      margin: 0;
      font-size: 42px;
      line-height: 1;
      font-weight: 800;
      letter-spacing: 6px;
    }.estimate-scope .page-badge {
      display: inline-flex;
      margin-top: 9px;
      padding: 4px 9px;
      border-radius: 999px;
      background: #f0f1f3;
      color: #4b5563;
      font-size: 12px;
      font-weight: 700;
    }.estimate-scope .items-wrap {
      flex: 0 0 auto;
      margin-top: 0;
    }.estimate-scope .items {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
    }.estimate-scope .items th,
.estimate-scope .items td {
      border-bottom: 1px solid var(--line);
      padding: 0 6px;
      text-align: center;
      vertical-align: middle;
    }.estimate-scope .items th {
      border-top: 3px solid var(--brand);
      border-bottom: 1px solid var(--brand);
      color: #111827;
      font-weight: 700;
      font-size: 12px;
      height: 34px;
      line-height: 34px;
      padding-top: 0;
      padding-bottom: 0;
    }.estimate-scope .items th.name,
.estimate-scope .items th.spec {
      text-align: left;
      padding-left: 18px;
    }.estimate-scope .items th.name {
      padding-left: 10px;
    }.estimate-scope .items td {
      height: 37px;
      position: relative;
    }.estimate-scope .items .name { width: 37%; text-align: left; }.estimate-scope .items .spec { width: 26%; text-align: left; }.estimate-scope .items .qty { width: 9%; text-align: center; }.estimate-scope .items .price { width: 14%; }.estimate-scope .items .amount { width: 14%; position: relative; }.estimate-scope .items input {
      position: absolute;
      top: 50%;
      left: 6px;
      right: 6px;
      transform: translateY(-50%);
      width: calc(100% - 12px);
      text-align: center;
      padding: 0 5px;
      height: 24px;
      line-height: 24px;
      display: block;
    }.estimate-scope .items th.qty {
      text-align: center;
      padding-left: 6px;
      padding-right: 6px;
    }.estimate-scope .items .qty input {
      text-align: center;
      padding-left: 12px;
      padding-right: 0;
      height: 24px;
      line-height: 24px;
    }.estimate-scope .items input.text-left { text-align: left; }.estimate-scope .items .name input.text-left,
.estimate-scope .items .spec input.text-left {
      padding-left: 12px;
      height: 24px;
      line-height: 24px;
    }.estimate-scope .items .name input.text-left {
      padding-left: 3.5px;
      height: 24px;
      line-height: 24px;
    }.estimate-scope .row-remove-btn {
      position: absolute;
      right: -34px;
      top: 50%;
      transform: translateY(-50%);
      width: 24px;
      height: 24px;
      border: 0;
      background: #fee2e2;
      color: var(--danger);
      border-radius: 50%;
      cursor: pointer;
      font-weight: 700;
      line-height: 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }.estimate-scope .row-remove-btn:hover { background: #fecaca; }.estimate-scope .export-capture {
      position: fixed;
      left: -99999px;
      top: 0;
      background: #fff;
      box-shadow: none !important;
      margin: 0 !important;
    }.estimate-scope .export-capture input,
.estimate-scope .export-capture textarea {
      border-color: transparent !important;
      background: transparent !important;
      box-shadow: none !important;
    }.estimate-scope .export-text {
      display: block;
      width: 100%;
      min-height: 1em;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      color: inherit;
      font: inherit;
      font-weight: inherit;
      line-height: inherit;
    }.estimate-scope .export-text.input-like {
      padding: 0;
    }.estimate-scope .export-text.note-like {
      min-height: 58px;
      border: 1px solid var(--line);
      padding: 7px 9px 8px 9px;
      line-height: 1.45;
    }.estimate-scope .export-capture .row-remove-btn,
.estimate-scope .export-capture button {
      display: none !important;
    }.estimate-scope .bottom-section {
      flex: 0 0 auto;
      margin-top: 26px;
    }.estimate-scope .paper.last-page .bottom-section {
      position: absolute;
      left: 18mm;
      right: 18mm;
      bottom: 17mm;
      margin-top: 0;
      padding-top: 0;
    }.estimate-scope .totals {
      width: 330px;
      margin-left: auto;
      border-collapse: collapse;
      border-top: 4px solid var(--brand);
    }.estimate-scope .totals th,
.estimate-scope .totals td {
      padding: 8px 2px;
      text-align: right;
      border-bottom: 1px solid #e5e7eb;
      font-size: 13px;
    }.estimate-scope .simple-label,
.estimate-scope .meta-label,
.estimate-scope .items th,
.estimate-scope .totals th,
.estimate-scope .totals .grand th,
.estimate-scope .totals .grand td,
.estimate-scope .note-title,
.estimate-scope .seller-name input {
      font-weight: 700;
    }.estimate-scope .totals th {
      width: 125px;
      text-align: left;
      font-weight: 700;
    }.estimate-scope .totals .grand th,
.estimate-scope .totals .grand td {
      background: #e5e7eb;
      padding: 10px 4px;
      font-size: 15px;
      font-weight: 700;
    }.estimate-scope .vat-included-label {
      font-weight: 400;
      font-size: 12px;
      margin-left: 4px;
    }.estimate-scope .totals .grand input {
      width: 100%;
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      font-weight: 700;
      text-align: right;
      padding: 0;
      outline: none;
    }.estimate-scope .totals .grand input:hover,
.estimate-scope .totals .grand input:focus {
      border: 0;
      background: transparent;
    }.estimate-scope .note-box {
      margin-top: 14px;
      margin-bottom: 5px;
    }.estimate-scope .note-title {
      margin-bottom: 5px;
      font-size: 13px;
      font-weight: 700;
    }.estimate-scope .note-box textarea {
      height: 58px;
      min-height: 58px;
      border: 1px solid var(--line);
      border-radius: 0;
      padding: 7px 9px 8px 9px;
      resize: none;
      line-height: 1.45;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      overflow: hidden;
    }.estimate-scope .seller-footer {
      margin-top: 12px;
      display: grid;
      grid-template-columns: 1fr 220px;
      gap: 24px;
      align-items: end;
    }.estimate-scope .seller-name input {
      font-size: 20px;
      font-weight: 700;
      padding-left: 0;
    }.estimate-scope .seller-lines {
      margin-top: 4px;
      display: grid;
      grid-template-columns: 58px 1fr;
      gap: 1px 8px;
      color: #374151;
      font-size: 11px;
      line-height: 1.4;
    }.estimate-scope .seller-lines span:nth-child(odd) {
      color: #6b7280;
      font-weight: 700;
    }.estimate-scope .seller-lines input {
      font-size: 11px;
      padding: 1px 3px;
    }.estimate-scope .sign-area {
      display: grid;
      grid-template-columns: 148px 62px;
      align-items: center;
      gap: 10px;
      color: #4b5563;
      font-size: 10px;
      text-align: right;
    }.estimate-scope .sign-area > div:first-child {
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-height: 62px;
    }.estimate-scope .sign-area > div:first-child > div {
      white-space: nowrap;
    }.estimate-scope .sign-area input {
      font-size: 18.6px;
      text-align: right;
      padding: 1px 0 1px 3px;
      font-weight: 700;
    }.estimate-scope .stamp {
      width: 62px;
      height: 62px;
      border: 2px solid #ef4444;
      border-radius: 50%;
      color: #ef4444;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 700;
      transform: rotate(-12deg);
    }.estimate-scope .stamp-image {
      width: 70px;
      height: 70px;
      object-fit: contain;
      display: none;
    }


.estimate-scope input,.estimate-scope textarea,.estimate-scope select{min-height:0;box-shadow:none;letter-spacing:normal;}
.estimate-scope .paper {box-shadow:4px 4px 0 #c9c9c9;flex-shrink:0;}
.estimate-scope .title{color:#111827;}
.estimate-scope .stamp{margin:0;}
.estimate-scope .items th,.estimate-scope .items td{white-space:normal;}
.estimate-scope .export-capture .items .export-text{font-size:12px;line-height:1.3;}
.estimate-scope .items input{font-size:12px;}
.estimate-scope .items .qty input{padding:0;appearance:textfield;}
.estimate-scope input::-webkit-inner-spin-button{appearance:none;}
.estimate-scope .note-box textarea{font-size:11px;}
.estimate-scope .logo-preview{max-height:62px;}
.estimate-scope .paper .page-number{position:absolute;bottom:6mm;left:18mm;font-size:10px;color:#777;}
.estimate-scope .row-remove-btn{right:-29px;border-radius:0;min-height:0;padding:0;}
dialog.quote-dialog{max-width:1120px;width:calc(100vw - 28px);max-height:94dvh;padding:0;border:3px solid #171916;background:#fff;overflow:hidden;}
dialog.quote-dialog::backdrop{background:#17191688;}
.quote-layout{display:flex;flex-direction:column;max-height:calc(94dvh - 6px);}
.quote-head,.quote-foot{padding:18px 22px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;background:white;}
.quote-head{border-bottom:3px solid #171916;flex-wrap:wrap;}
.quote-head h2{font-size:20px;margin:0;}.quote-head p{margin:5px 0 0;color:#666;font-size:12px;}
.quote-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}.quote-controls select{width:auto;min-height:38px;}
.quote-controls label{font-size:12px;font-weight:700;display:flex;align-items:center;gap:6px;}
.quote-scroll{overflow:auto;min-height:0;padding:24px;background:#efefef;overscroll-behavior:contain;}
.quote-foot{border-top:3px solid #171916;flex-wrap:wrap;}
.quote-status{font-size:12px;white-space:pre-line;max-width:600px;}.quote-status.error{color:#b42318;}
.quote-foot button{font-size:12px;}.quote-actions{display:flex;gap:8px;flex-wrap:wrap;}
.quote-override{font-size:12px;color:#b42318;margin:0 0 14px;}
.quote-settings{display:grid;grid-template-columns:1fr 1fr;gap:16px;max-width:860px;margin:auto;background:#fff;padding:22px;border:2px solid #171916;}
.quote-settings .wide{grid-column:1/-1;}.quote-settings label{display:grid;gap:6px;font-size:12px;font-weight:700;}.quote-settings textarea{min-height:90px;}
.quote-settings img{max-width:220px;max-height:80px;object-fit:contain;object-position:left;}.quote-settings .asset{display:grid;gap:8px;}
.quote-exports{background:#fff;padding:20px;}.quote-exports article{margin-bottom:24px;}.quote-exports img{max-width:100%;height:auto;display:block;border:1px solid #bbb;margin:12px 0;}.quote-exports a{display:inline-block;background:#f5ed49;color:#171916;padding:10px 16px;border:2px solid #171916;font-weight:700;}
.detail-doc-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;}.detail-doc-actions button{font-size:11px;padding:10px 6px;}
@media(max-width:700px){dialog.quote-dialog{width:100vw;max-width:none;max-height:100dvh;height:100dvh;margin:0;border-width:0;}.quote-layout{height:100dvh;max-height:100dvh;}.quote-scroll{flex:1;padding:14px;}.quote-head,.quote-foot{padding:12px;}.quote-settings{grid-template-columns:1fr;padding:14px;}.quote-head h2{font-size:17px;}.quote-controls button{font-size:11px;padding:8px;}}
.quote-controls select[data-qcontrol="supplier"],.quote-controls select[data-qprofile]{max-width:220px;}

.quote-excel-picker{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700}.quote-excel-picker select{width:auto;max-width:130px;min-height:38px}.quote-excel-result{padding:16px;margin:0 0 16px;border:2px solid #171916;background:#fff}.quote-excel-result a{color:#171916;font-weight:700;text-decoration:underline}.quote-excel-result p{font-size:12px;margin:8px 0 0;color:#555}

.quote-order-hint{font-size:12px;color:#555;margin:0 0 14px;}
.estimate-scope .quote-row-handle{position:absolute;left:-32px;top:50%;transform:translateY(-50%);width:26px;height:30px;min-height:0;padding:0;border:1px solid #c2c4be;background:#fff;color:#666;display:flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;user-select:none;}
.estimate-scope .quote-row-handle:hover,.estimate-scope .quote-row-handle:focus-visible{border-color:#171916;color:#171916;background:#f5ed49;outline:2px solid #171916;outline-offset:1px;}
.estimate-scope .quote-row-moving{opacity:.35;}.estimate-scope .quote-drop-before td{box-shadow:inset 0 3px #168443;}.estimate-scope .quote-drop-after td{box-shadow:inset 0 -3px #168443;}
.quote-reordering,.quote-reordering *{cursor:grabbing!important;user-select:none!important;}
.quote-row-ghost{position:fixed;z-index:5;pointer-events:none;width:240px;padding:10px 12px;border:2px solid #171916;background:#f5ed49;box-shadow:3px 3px #171916;font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.quote-row-ghost.invalid{opacity:.45;}
@media print{.quote-row-handle,.quote-order-hint{display:none!important;}}
