
:root{
  --navy:#0a438f;
  --navy2:#0f5fb8;
  --gold:#f4b400;
  --bg:#f4f7fb;
  --card:#fff;
  --text:#17304f;
  --muted:#718096;
  --border:#dbe4ef;
  --danger:#b42318;
  --success:#067647;
}
*{box-sizing:border-box}
body{margin:0;font-family:Segoe UI,Arial,sans-serif;background:var(--bg);color:#1f2937}
a{text-decoration:none;color:inherit}
.layout{display:flex;min-height:100vh}
.sidebar{width:245px;background:linear-gradient(180deg,#082e67,#0a438f);color:white;padding:22px 16px;position:fixed;top:0;bottom:0;left:0}
.brand{font-weight:800;font-size:22px;line-height:1.1;padding:4px 10px 18px;border-bottom:3px solid var(--gold);margin-bottom:16px}
.brand small{display:block;font-size:11px;font-weight:500;opacity:.82;margin-top:6px}
.nav a{display:block;padding:11px 12px;border-radius:8px;margin:4px 0;color:#e8f0ff;font-size:14px}
.nav a:hover,.nav a.active{background:#ffffff18;color:white}
.sidebar .userbox{position:absolute;bottom:18px;left:16px;right:16px;font-size:12px;background:#ffffff12;padding:12px;border-radius:10px}
.main{margin-left:245px;width:calc(100% - 245px)}
.topbar{height:68px;background:white;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:5}
.topbar h1{font-size:20px;color:var(--navy);margin:0}
.content{padding:26px}
.card{background:white;border:1px solid var(--border);border-radius:12px;padding:18px;box-shadow:0 3px 12px #16355a10}
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.stat strong{font-size:28px;color:var(--navy);display:block;margin-top:6px}
.stat span{font-size:12px;color:var(--muted)}
.btn{border:0;border-radius:8px;padding:10px 15px;font-weight:600;cursor:pointer;display:inline-block}
.btn-primary{background:var(--navy);color:white}
.btn-gold{background:var(--gold);color:#252525}
.btn-light{background:#edf2f7;color:#334155}
.btn-danger{background:#fee4e2;color:var(--danger)}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}
table{width:100%;border-collapse:collapse;background:white}
th,td{padding:10px;border-bottom:1px solid var(--border);font-size:13px;text-align:left}
th{background:#eef4fb;color:#23456f}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-group label{display:block;font-size:12px;font-weight:700;color:#415a77;margin-bottom:6px}
input,select,textarea{width:100%;padding:10px 11px;border:1px solid #cbd5e1;border-radius:8px;background:white;font:inherit}
textarea{min-height:78px}
.section-title{font-size:15px;color:var(--navy);font-weight:800;margin:22px 0 10px}
.line-table input,.line-table select{padding:7px}
.money{text-align:right}
.flash{padding:11px 14px;border-radius:8px;margin-bottom:14px;background:#eaf3ff;color:#164e89}
.flash.error{background:#fee4e2;color:#912018}
.login-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#061f46,#0a438f 65%,#0d67c8)}
.login-box{width:410px;background:white;border-radius:16px;overflow:hidden;box-shadow:0 30px 70px #001b3f66}
.login-head{background:#0a438f;color:white;padding:28px;text-align:center;border-bottom:5px solid var(--gold)}
.login-head h2{margin:0;font-size:24px}
.login-head p{margin:7px 0 0;color:#d9e8ff}
.login-body{padding:28px}
.login-body .btn{width:100%;margin-top:10px}
.badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#eaf3ff;color:#175ca8;font-size:11px;font-weight:700}
.quote-paper{max-width:980px;margin:auto;background:white;padding:30px;border:1px solid var(--border)}
.quote-head{display:grid;grid-template-columns:2fr 1fr;gap:20px;border-bottom:4px solid var(--gold);padding-bottom:14px}
.quote-title{text-align:right;color:var(--navy)}
.totals{margin-left:auto;width:340px}
.totals td:first-child{font-weight:700}
.small{font-size:12px;color:var(--muted)}
@media(max-width:1000px){.grid{grid-template-columns:repeat(2,1fr)}.sidebar{width:210px}.main{margin-left:210px;width:calc(100% - 210px)}}
@media(max-width:760px){.sidebar{display:none}.main{margin:0;width:100%}.grid,.form-grid{grid-template-columns:1fr}}
@media print{
  .sidebar,.topbar,.no-print{display:none!important}
  .main{margin:0;width:100%}
  .content{padding:0}
  .quote-paper{border:0;box-shadow:none;max-width:none;padding:12mm}
}

/* Modern quotation screen/print design */
.quote-wrap{display:flex;max-width:1120px;margin:auto;gap:0;align-items:stretch}.quotation-sidebar{width:145px;background:linear-gradient(180deg,#062f67,#0a4f99);color:white;padding:22px 15px;text-align:center;flex:0 0 145px}.side-brand{font-size:38px;font-weight:900;border:3px solid #55adff;border-radius:18px;padding:10px;margin:0 auto 12px;max-width:82px}.side-name{font-weight:800;letter-spacing:1px}.side-tag{margin-top:26px;font-size:11px;line-height:1.65;color:#89c7ff;letter-spacing:1.3px}.side-menu{margin-top:56px;font-size:10px;line-height:2;color:#eaf4ff}.modern-quote{max-width:none;flex:1;margin:0;border-left:0}.qtop{display:grid;grid-template-columns:1fr 170px;gap:18px;align-items:start;border-bottom:1px solid #cbd9e8;padding-bottom:14px}.company-name{margin:0;color:#0a438f;font-size:30px}.company-sub{font-size:10px;letter-spacing:1.6px;color:#526d8a;margin-top:3px}.company-contact{margin-top:9px;font-size:11px;line-height:1.5}.trust{text-align:right;color:#31577c;font-weight:800;font-size:11px;letter-spacing:1.6px;line-height:1.55}.qtitle-row{display:grid;grid-template-columns:1fr 290px;gap:20px;margin:16px 0}.big-quote-title{font-size:38px;font-weight:900;color:#082d5b;letter-spacing:1px}.quote-meta{background:#edf5fb;border:1px solid #d9e6f2;border-radius:8px;padding:11px 13px}.quote-meta div{display:grid;grid-template-columns:105px 1fr;gap:8px;font-size:11px;margin:4px 0}.info-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:14px;margin-bottom:14px}.info-card{border:1px solid #d8e3ee;border-radius:8px;overflow:hidden}.block-title{background:linear-gradient(90deg,#0b4a89,#2181c4);color:white;padding:7px 10px;font-weight:800;font-size:12px;letter-spacing:.3px;margin-top:12px}.info-card .block-title{margin-top:0}.clean-table td{border:0;padding:5px 8px;font-size:11px}.clean-table td:first-child{font-weight:700;width:120px;color:#496078}.thank-card{padding:18px;background:#f7fbff}.thank-title{font-weight:800;color:#0a4f99;font-size:15px}.quote-table{font-size:10px}.quote-table th,.quote-table td{padding:6px 7px;font-size:10px}.subtotal-row td{background:#e5f2fb;font-weight:800}.subtotal-row td:first-child{text-align:right}.bottom-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.terms-box{border:1px solid #d9e5f0;background:#f9fcff;border-radius:8px;padding:12px;margin-bottom:10px}.mini-title{color:#0a4f99;font-weight:800;margin-bottom:7px}.preline{white-space:pre-line;font-size:10px;line-height:1.5}.summary-table td{padding:7px 9px}.summary-table td:last-child{text-align:right}.grand-row td{background:#0a4f99;color:white;font-size:15px;font-weight:900}.signature-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.sig-box{border:1px solid #cbd9e8;border-radius:8px;padding:12px;min-height:145px}.sig-space{height:55px}.esign{display:block;max-width:180px;max-height:70px;object-fit:contain;margin:8px 0}.sig-line{border-top:1px solid #64748b;padding-top:5px;width:70%;margin-top:4px}.qfooter{border-top:1px solid #b9cadc;margin-top:15px;padding-top:8px;font-size:9px;color:#64748b}
@media print{@page{size:A4;margin:8mm}.quotation-sidebar,.screen-only{display:none!important}.quote-wrap{display:block;max-width:none;margin:0}.modern-quote{padding:0!important;width:100%!important}.company-name{font-size:24px}.big-quote-title{font-size:31px}.qtitle-row{grid-template-columns:1fr 250px;gap:12px}.quote-table th,.quote-table td{font-size:8.5px;padding:4px 5px}.clean-table td,.preline{font-size:9px}.block-title{font-size:10px;padding:5px 8px}.bottom-grid,.signature-grid{gap:8px}.sig-box{min-height:115px}.sig-space{height:42px}.esign{max-height:55px}}


/* === POS pickers === */
.pos-toolbar{display:flex;align-items:center;gap:12px;margin-bottom:12px}.picker-overlay{display:none;position:fixed;inset:0;background:#0b1f36aa;z-index:99;align-items:center;justify-content:center;padding:24px}.picker-overlay.show{display:flex}.picker-card{width:min(900px,96vw);max-height:82vh;background:white;border-radius:14px;box-shadow:0 25px 70px #001f4466;overflow:hidden}.picker-head{display:flex;justify-content:space-between;align-items:center;padding:16px 18px;background:#0a438f;color:white}.picker-x{border:0;background:transparent;color:white;font-size:28px;cursor:pointer}.picker-tools{display:grid;grid-template-columns:220px 1fr;gap:10px;padding:14px;border-bottom:1px solid var(--border)}#servicePicker .picker-tools{grid-template-columns:1fr}.picker-results{padding:10px;overflow:auto;max-height:55vh}.pick-row{width:100%;display:grid;grid-template-columns:1fr 150px 160px;gap:12px;align-items:center;text-align:left;border:1px solid #dce7f2;background:white;border-radius:9px;padding:11px 13px;margin:6px 0;cursor:pointer}.pick-row:hover{background:#eef6ff;border-color:#7db5e8}.pick-row small{display:block;color:#74869a;margin-top:3px}.pick-cat{font-size:11px;color:#46647f;background:#eef4fa;border-radius:999px;padding:5px 9px;text-align:center}.pick-price{text-align:right;font-weight:800;color:#0a438f}.empty-result{text-align:center;color:#76879a;padding:35px}

/* === Reference quotation design === */
.reference-layout{max-width:1160px}.reference-layout .quotation-sidebar{width:150px;flex-basis:150px;padding:25px 15px}.cp-mark{font-size:35px;font-weight:900;color:#62b4ff;border:4px solid #62b4ff;border-radius:28px;padding:11px 7px;margin:0 auto 12px;width:84px}.reference-paper{padding:24px 28px}.ref-header{display:grid;grid-template-columns:1fr 150px;gap:22px;padding-bottom:13px;border-bottom:1px solid #a9bdcf;background:linear-gradient(110deg,#fff 0 68%,#eaf5fd 68%)}.ref-company{font-size:31px;font-weight:900;color:#092e5f}.ref-company span{color:#1476bd}.ref-sub{font-size:9px;letter-spacing:1.5px;color:#47647f;font-weight:700;margin-top:2px}.ref-contact{font-size:10px;line-height:1.65;color:#294965;margin-top:9px}.ref-trust{text-align:right;font-size:10px;line-height:1.5;letter-spacing:1.4px;color:#264969;font-weight:800;padding-top:5px}.ref-title-row{display:grid;grid-template-columns:1fr 285px;gap:18px;align-items:start;padding:14px 0 10px}.ref-title{font-size:41px;line-height:1;font-weight:950;color:#072d5f;letter-spacing:-1px}.ref-tags{font-size:9px;margin-top:8px;color:#5b6f82;font-weight:700}.ref-meta{background:#edf5fb;border:1px solid #d9e7f3;border-radius:7px;padding:10px 13px}.ref-meta div{display:grid;grid-template-columns:105px 1fr;font-size:10px;padding:3px 0}.ref-info-grid{display:grid;grid-template-columns:1.25fr .75fr;gap:13px;margin-bottom:12px}.ref-box,.ref-thanks{border:1px solid #d8e5ef;border-radius:7px;overflow:hidden}.ref-bar{margin-top:10px;background:linear-gradient(90deg,#0b4b8c,#2284c8);color:white;font-weight:800;padding:7px 10px;border-radius:5px 5px 0 0;font-size:11px;letter-spacing:.2px}.ref-box .ref-bar{margin-top:0}.ref-info-table td{border:0;padding:4px 7px;font-size:10px}.ref-info-table td:first-child{width:105px}.ref-info-table td:nth-child(2){width:10px}.ref-thanks{background:#f7fbfe;padding:15px}.thanks-head{font-size:14px;font-weight:800;color:#0d5598}.ref-thanks p{font-size:10px;line-height:1.45}.ref-table{width:100%;border-collapse:collapse}.ref-table th{background:#edf3f8;color:#1f354a;padding:5px 6px;border:1px solid #d8e1e9;font-size:9px}.ref-table td{padding:5px 6px;border:1px solid #d8e1e9;font-size:9px}.ref-subtotal td{background:#dceefa;font-weight:800}.ref-subtotal td:first-child{text-align:right}.ref-bottom{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:13px}.ref-note{border:1px solid #d9e6f0;border-radius:7px;padding:10px 12px;margin-bottom:8px;background:#fafdff}.ref-note h4{margin:0 0 6px;color:#0e5596;font-size:11px}.ref-note .preline{font-size:9px;line-height:1.45}.ref-summary{width:100%;border-collapse:collapse}.ref-summary td{font-size:10px;padding:6px 9px;border-bottom:1px solid #dfe7ee}.ref-summary td:last-child{text-align:right}.ref-grand td{background:#0b4e91;color:white;font-size:15px;font-weight:900}.ref-signatures{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:10px}.ref-sign{border:1px solid #aebfce;border-radius:6px;padding:9px;font-size:9px;min-height:140px}.ref-sign b{font-size:9px}.signature-space{height:55px}.ref-sign .esign{max-width:145px;max-height:58px;margin:5px auto;display:block}.sig-line{border-top:1px solid #75899c;padding-top:4px;margin-top:2px}.ref-footer{font-size:8px;color:#667b8e;border-top:1px solid #b9c8d5;margin-top:12px;padding-top:6px;display:flex;justify-content:space-between}
@media print{
 @page{size:A4 portrait;margin:6mm}
 .sidebar,.topbar,.no-print,.quotation-sidebar,.screen-only{display:none!important}
 .main{margin:0!important;width:100%!important}.content{padding:0!important}.quote-wrap,.reference-layout{display:block!important;max-width:none!important;margin:0!important}.reference-paper{border:0!important;box-shadow:none!important;padding:0!important;width:100%!important;max-width:none!important}
 .ref-company{font-size:24px}.ref-title{font-size:31px}.ref-title-row{grid-template-columns:1fr 235px;gap:10px;padding:9px 0 7px}.ref-meta{padding:7px 9px}.ref-meta div{font-size:8px;grid-template-columns:85px 1fr}.ref-info-grid{gap:8px;margin-bottom:7px}.ref-bar{font-size:9px;padding:4px 7px;margin-top:6px}.ref-info-table td,.ref-thanks p{font-size:8px;padding:3px 5px}.thanks-head{font-size:10px}.ref-table th,.ref-table td{font-size:7px;padding:3px 4px}.ref-bottom{gap:8px;margin-top:8px}.ref-note{padding:6px 8px;margin-bottom:5px}.ref-note h4{font-size:8px}.ref-note .preline,.ref-summary td{font-size:7.5px}.ref-summary td{padding:4px 6px}.ref-grand td{font-size:11px}.ref-sign{min-height:95px;padding:6px;font-size:7px}.signature-space{height:35px}.ref-sign .esign{max-height:38px}.ref-footer{font-size:7px;margin-top:7px}.ref-header{padding-bottom:8px}.ref-contact{font-size:7.5px}.ref-sub,.ref-tags,.ref-trust{font-size:7px}
}


/* ===== V1.2 management/search ===== */
.form-card-title{margin:0 0 15px;color:var(--navy)}
.filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.currency-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.currency-cards.compact{margin:15px 0}
.currency-card strong{display:block;font-size:24px;color:var(--navy);margin-top:5px}
.currency-card span{font-size:12px;color:var(--muted)}

/* ===== V1.2 quotation reference / print ===== */
.reference-layout{max-width:1100px;align-items:stretch}
.quote-brand-side{width:148px!important;flex-basis:148px!important;background:linear-gradient(180deg,#062d61 0%,#074982 58%,#062d61 100%)!important;position:relative;min-height:100%}
.cp-logo-mark{width:82px;height:68px;margin:2px auto 11px;border:4px solid #56b6ff;border-radius:25px;display:flex;align-items:center;justify-content:center;font-size:31px;font-weight:900;color:#74c3ff;letter-spacing:-2px}
.quote-brand-side .side-name{font-size:14px;font-weight:900;letter-spacing:.8px;margin-bottom:23px}
.quote-brand-side .side-tag{font-size:10px;line-height:1.75;letter-spacing:1.4px;color:#65b8f6;margin-top:0}
.side-service{margin:42px 0;color:#fff;font-size:9px;font-weight:600}
.side-icon{width:36px;height:36px;margin:0 auto 8px}
.side-icon svg{width:100%;height:100%;fill:none;stroke:#66bdfb;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.side-bottom{position:absolute;left:15px;right:15px;bottom:30px;text-align:left;color:#6fc1fa;font-size:9px;line-height:1.65;letter-spacing:1.5px}

.reference-paper{font-family:"Segoe UI","Myanmar Text","Pyidaungsu",Arial,sans-serif;padding:24px 27px}
.ref-header{grid-template-columns:1fr 155px;background:linear-gradient(110deg,#fff 0 66%,#eaf5fd 66%);padding-bottom:14px}
.ref-company{font-size:31px;line-height:1.05}
.ref-sub{font-size:9.5px}
.ref-contact{font-size:11.5px!important;line-height:1.65!important;font-weight:600;color:#365876}
.ref-trust{font-size:9.5px;padding-right:8px}
.trust-line{width:30px;border-top:2px solid #274c70;margin:9px 0 0 auto}
.ref-title{font-size:40px}
.ref-tags{font-size:8.5px}
.ref-meta div{font-size:9.5px}
.ref-bar{font-size:10.5px;padding:6px 9px}
.bar-icon{font-size:11px;margin-right:4px}
.ref-info-table td{font-size:10px;padding:4px 7px}
.ref-info-table td:first-child{width:110px;font-weight:500}
.thanks-head{font-size:13px}
.ref-thanks p{font-size:9.5px}
.ref-table th,.ref-table td{font-size:8.8px;padding:4.5px 5px}
.ref-note h4{font-size:10.5px}
.ref-note .preline{font-size:8.8px;line-height:1.5}
.ref-summary td{font-size:9.3px;padding:5px 8px}
.ref-grand td{font-size:14px}
.ref-sign{font-size:8.5px;min-height:125px}
.ref-footer{font-size:7.5px}

@media(max-width:900px){.filter-grid{grid-template-columns:1fr 1fr}}

/* PRINT: Keep the branded blue side panel and make text readable on A4 */
@media print{
  @page{size:A4 portrait;margin:4mm}
  body{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;background:#fff!important}
  .sidebar,.topbar,.no-print{display:none!important}
  .main{margin:0!important;width:100%!important}
  .content{padding:0!important}
  .quote-wrap.reference-layout.print-with-side{
    display:flex!important;
    width:202mm!important;
    max-width:202mm!important;
    min-height:287mm!important;
    margin:0 auto!important;
    align-items:stretch!important;
  }
  .quotation-sidebar.quote-brand-side{
    display:block!important;
    flex:0 0 31mm!important;
    width:31mm!important;
    min-height:287mm!important;
    padding:7mm 3mm!important;
    background:linear-gradient(180deg,#062d61 0%,#074982 58%,#062d61 100%)!important;
    color:#fff!important;
  }
  .reference-paper{
    flex:1!important;
    width:auto!important;
    max-width:none!important;
    border:0!important;
    box-shadow:none!important;
    padding:5mm 5.5mm!important;
    margin:0!important;
  }
  .cp-logo-mark{width:18mm;height:15mm;font-size:18pt;border-radius:6mm;border-width:1mm}
  .quote-brand-side .side-name{font-size:8.5pt}
  .quote-brand-side .side-tag{font-size:6pt;line-height:1.55}
  .side-service{margin:10mm 0;font-size:5.6pt}
  .side-icon{width:8mm;height:8mm;margin-bottom:2mm}
  .side-bottom{bottom:7mm;font-size:5.4pt}

  .ref-header{grid-template-columns:1fr 31mm;gap:3mm;padding-bottom:2.5mm}
  .ref-company{font-size:18pt}
  .ref-sub{font-size:6.2pt}
  .ref-contact{font-size:7.2pt!important;line-height:1.5!important}
  .ref-trust{font-size:6pt}
  .ref-title-row{grid-template-columns:1fr 48mm;gap:3mm;padding:3mm 0 2mm}
  .ref-title{font-size:24pt}
  .ref-tags{font-size:5.5pt}
  .ref-meta{padding:2mm 2.5mm}
  .ref-meta div{font-size:6pt;grid-template-columns:21mm 1fr;padding:.5mm 0}

  .ref-info-grid{grid-template-columns:1.25fr .75fr;gap:2.5mm;margin-bottom:2mm}
  .ref-bar{font-size:6.6pt;padding:1.5mm 2mm;margin-top:2mm}
  .ref-info-table td{font-size:6.5pt;padding:1mm 1.5mm}
  .ref-info-table td:first-child{width:23mm}
  .ref-thanks{padding:3mm}
  .thanks-head{font-size:7.4pt}
  .ref-thanks p{font-size:6.1pt;line-height:1.35}

  .ref-table th,.ref-table td{font-size:5.7pt;padding:.9mm 1mm}
  .ref-bottom{grid-template-columns:1fr 1fr;gap:2.5mm;margin-top:2.5mm}
  .ref-note{padding:2mm;margin-bottom:1.5mm}
  .ref-note h4{font-size:6.6pt;margin-bottom:1mm}
  .ref-note .preline{font-size:5.8pt;line-height:1.35}
  .ref-summary td{font-size:6.1pt;padding:1.25mm 1.5mm}
  .ref-grand td{font-size:8.4pt}
  .ref-signatures{gap:2mm;margin-top:2mm}
  .ref-sign{font-size:5.7pt;min-height:27mm;padding:2mm}
  .signature-space{height:10mm}
  .ref-sign .esign{max-height:11mm}
  .ref-footer{font-size:5pt;margin-top:2mm;padding-top:1mm}
}


/* ===== V1.2A PRINT DESIGN: NO LEFT BLUE SIDEBAR ===== */

/* Main quotation body: Pyidaungsu 12pt.
   Company name keeps its existing corporate font style. */
.reference-layout.no-quote-sidebar{
  display:block !important;
  max-width:980px !important;
  width:100% !important;
  margin:0 auto !important;
}

.reference-layout.no-quote-sidebar .reference-paper{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  font-family:"Pyidaungsu","Myanmar Text","Segoe UI",Arial,sans-serif !important;
  font-size:12pt !important;
}

/* Keep Cyber Point Co., Ltd. in its current corporate-style font */
.reference-layout.no-quote-sidebar .ref-company{
  font-family:"Segoe UI","Arial",sans-serif !important;
  font-weight:800 !important;
}

/* All quotation content except the company name uses Pyidaungsu */
.reference-layout.no-quote-sidebar .ref-sub,
.reference-layout.no-quote-sidebar .ref-contact,
.reference-layout.no-quote-sidebar .ref-trust,
.reference-layout.no-quote-sidebar .ref-title,
.reference-layout.no-quote-sidebar .ref-tags,
.reference-layout.no-quote-sidebar .ref-meta,
.reference-layout.no-quote-sidebar .ref-info-table,
.reference-layout.no-quote-sidebar .ref-thanks,
.reference-layout.no-quote-sidebar .ref-bar,
.reference-layout.no-quote-sidebar .ref-table,
.reference-layout.no-quote-sidebar .ref-note,
.reference-layout.no-quote-sidebar .ref-summary,
.reference-layout.no-quote-sidebar .ref-sign,
.reference-layout.no-quote-sidebar .ref-footer{
  font-family:"Pyidaungsu","Myanmar Text","Segoe UI",Arial,sans-serif !important;
}

/* Readable 12pt body text */
.reference-layout.no-quote-sidebar .ref-contact,
.reference-layout.no-quote-sidebar .ref-meta div,
.reference-layout.no-quote-sidebar .ref-info-table td,
.reference-layout.no-quote-sidebar .ref-thanks p,
.reference-layout.no-quote-sidebar .ref-table th,
.reference-layout.no-quote-sidebar .ref-table td,
.reference-layout.no-quote-sidebar .ref-note .preline,
.reference-layout.no-quote-sidebar .ref-summary td,
.reference-layout.no-quote-sidebar .ref-sign,
.reference-layout.no-quote-sidebar .ref-footer{
  font-size:12pt !important;
  line-height:1.35 !important;
}

/* Contact details intentionally a little stronger for visibility */
.reference-layout.no-quote-sidebar .ref-contact{
  font-size:12pt !important;
  font-weight:600 !important;
}

/* Headings keep visual hierarchy while using Pyidaungsu */
.reference-layout.no-quote-sidebar .ref-title{
  font-size:28pt !important;
  line-height:1.05 !important;
}
.reference-layout.no-quote-sidebar .ref-bar{
  font-size:12pt !important;
  font-weight:700 !important;
}
.reference-layout.no-quote-sidebar .thanks-head{
  font-family:"Pyidaungsu","Myanmar Text","Segoe UI",Arial,sans-serif !important;
  font-size:13pt !important;
}
.reference-layout.no-quote-sidebar .ref-grand td{
  font-size:14pt !important;
}

/* Give the page more usable width now that the sidebar is gone */
.reference-layout.no-quote-sidebar .ref-title-row{
  grid-template-columns:1fr 300px !important;
}
.reference-layout.no-quote-sidebar .ref-info-grid{
  grid-template-columns:1.25fr .75fr !important;
}

/* Print-specific rules */
@media print{
  @page{
    size:A4 portrait;
    margin:8mm;
  }

  body{
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
    background:#fff !important;
  }

  .sidebar,.topbar,.no-print,.quotation-sidebar{
    display:none !important;
  }

  .main{
    margin:0 !important;
    width:100% !important;
  }

  .content{
    padding:0 !important;
  }

  .quote-wrap.reference-layout.no-quote-sidebar{
    display:block !important;
    width:100% !important;
    max-width:none !important;
    min-height:auto !important;
    margin:0 !important;
  }

  .reference-layout.no-quote-sidebar .reference-paper{
    width:100% !important;
    max-width:none !important;
    padding:0 !important;
    border:0 !important;
    box-shadow:none !important;
    font-family:"Pyidaungsu","Myanmar Text","Segoe UI",Arial,sans-serif !important;
    font-size:12pt !important;
  }

  .reference-layout.no-quote-sidebar .ref-company{
    font-family:"Segoe UI","Arial",sans-serif !important;
  }

  /* Avoid unwanted page splits inside key blocks */
  .ref-header,
  .ref-title-row,
  .ref-info-grid,
  .ref-bottom,
  .ref-signatures,
  .ref-note,
  .ref-summary{
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }

  .ref-table{
    break-inside:auto !important;
  }

  .ref-table tr{
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }
}


/* ===== Print Design V2 adjustments ===== */

/* Header address: keep inside the white area and wrap naturally to about 2 lines. */
.reference-layout.no-quote-sidebar .ref-header > div:first-child{
  min-width:0;
  padding-right:14px;
}
.reference-layout.no-quote-sidebar .ref-contact{
  max-width:100%;
}
.reference-layout.no-quote-sidebar .contact-address{
  display:flex;
  align-items:flex-start;
  gap:7px;
  max-width:620px;
  line-height:1.45 !important;
  margin-bottom:4px;
}
.reference-layout.no-quote-sidebar .contact-address > span:last-child{
  display:block;
  max-width:560px;
  white-space:normal;
  overflow-wrap:anywhere;
}
.reference-layout.no-quote-sidebar .contact-symbol{
  color:#d8172f;
  font-size:8pt;
  padding-top:3px;
  flex:0 0 auto;
}
.reference-layout.no-quote-sidebar .contact-line{
  display:flex;
  align-items:center;
  gap:22px;
  flex-wrap:nowrap;
  white-space:nowrap;
  font-size:12pt !important;
}

/* Service icons below QUOTATION */
.reference-layout.no-quote-sidebar .service-strip{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  margin-top:11px;
  max-width:620px;
}
.reference-layout.no-quote-sidebar .service-chip{
  min-height:46px;
  display:flex;
  align-items:center;
  gap:7px;
  padding:7px 8px;
  border:1px solid #c8deef;
  border-radius:8px;
  background:linear-gradient(180deg,#fafdff,#edf6fc);
  color:#0a4f90;
  font-size:9pt !important;
  font-weight:700;
  line-height:1.15;
}
.reference-layout.no-quote-sidebar .service-chip-icon{
  width:27px;
  height:27px;
  flex:0 0 27px;
  border-radius:50%;
  background:#e3f2fd;
  display:flex;
  align-items:center;
  justify-content:center;
}
.reference-layout.no-quote-sidebar .service-chip-icon svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:#0c6fb5;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Repeating SERVICE CHARGES heading on each printed page */
.service-table thead{
  display:table-header-group;
}
.service-table .repeat-section-title th{
  background:linear-gradient(90deg,#0b4b8c,#2284c8) !important;
  color:#fff !important;
  text-align:left;
  font-family:"Pyidaungsu","Myanmar Text","Segoe UI",Arial,sans-serif !important;
  font-size:12pt !important;
  font-weight:700 !important;
  padding:7px 10px !important;
  border:0 !important;
}
.table-title-icon{
  display:inline-flex;
  width:20px;
  height:20px;
  vertical-align:middle;
  margin-right:6px;
}
.table-title-icon svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:#fff;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Avoid splitting the service heading away from rows. */
.service-table thead,
.service-table thead tr{
  break-inside:avoid !important;
  page-break-inside:avoid !important;
}

/* Browser-generated print header/footer (URL, page title, date) cannot be
   reliably removed by page CSS. Use the browser print option:
   More settings -> Headers and footers -> Off. */

@media print{
  .reference-layout.no-quote-sidebar .ref-header > div:first-child{
    padding-right:3mm;
  }
  .reference-layout.no-quote-sidebar .contact-address{
    max-width:128mm;
    margin-bottom:1mm;
  }
  .reference-layout.no-quote-sidebar .contact-address > span:last-child{
    max-width:120mm;
    line-height:1.45 !important;
  }
  .reference-layout.no-quote-sidebar .contact-line{
    gap:5mm;
    font-size:12pt !important;
  }
  .reference-layout.no-quote-sidebar .service-strip{
    max-width:123mm;
    gap:1.5mm;
    margin-top:2mm;
  }
  .reference-layout.no-quote-sidebar .service-chip{
    min-height:10mm;
    padding:1.2mm 1.5mm;
    border-radius:2mm;
    font-size:7.2pt !important;
  }
  .reference-layout.no-quote-sidebar .service-chip-icon{
    width:6mm;
    height:6mm;
    flex-basis:6mm;
  }
  .reference-layout.no-quote-sidebar .service-chip-icon svg{
    width:4.5mm;
    height:4.5mm;
  }
  .service-table .repeat-section-title th{
    font-size:12pt !important;
    padding:1.5mm 2mm !important;
  }
}


/* ===== Print Design V3 ===== */

/* Customer Information: full width, 2 columns x 3 rows */
.reference-layout.no-quote-sidebar .customer-full{
  width:100%;
  margin-bottom:12px;
  border:1px solid #d8e3ee;
  border-radius:8px;
  overflow:hidden;
}
.reference-layout.no-quote-sidebar .customer-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  column-gap:28px;
  row-gap:9px;
  padding:13px 15px;
}
.reference-layout.no-quote-sidebar .customer-field{
  display:grid;
  grid-template-columns:130px 1fr;
  gap:8px;
  align-items:start;
  font-family:"Pyidaungsu","Myanmar Text","Segoe UI",Arial,sans-serif !important;
  font-size:12pt !important;
  line-height:1.4 !important;
}
.reference-layout.no-quote-sidebar .customer-label{
  font-weight:700;
  color:#243b53;
}
.reference-layout.no-quote-sidebar .customer-value{
  overflow-wrap:anywhere;
}

/* Bigger section headings */
.reference-layout.no-quote-sidebar .ref-note h4{
  font-size:14pt !important;
  font-weight:800 !important;
  color:#0a4f90 !important;
  margin:0 0 8px !important;
}
.reference-layout.no-quote-sidebar .ref-sign > b{
  display:block;
  font-size:14pt !important;
  font-weight:800 !important;
  color:#0a355f !important;
  margin-bottom:5px !important;
}

/* Thank-you note below Warranty */
.reference-layout.no-quote-sidebar .thank-you-note{
  background:linear-gradient(180deg,#f8fcff,#edf6fb);
  border-left:4px solid #1d79b7;
}

/* Repeating Materials heading */
.material-table thead{
  display:table-header-group;
}
.material-table .materials-title th{
  background:linear-gradient(90deg,#0b4b8c,#2284c8) !important;
  color:#fff !important;
  text-align:left;
  font-family:"Pyidaungsu","Myanmar Text","Segoe UI",Arial,sans-serif !important;
  font-size:12pt !important;
  font-weight:700 !important;
  padding:7px 10px !important;
  border:0 !important;
}
.material-table thead,
.material-table thead tr{
  break-inside:avoid !important;
  page-break-inside:avoid !important;
}

/* The quotation info box no longer has Currency */
.reference-layout.no-quote-sidebar .ref-meta{
  align-self:start;
}

@media print{
  .reference-layout.no-quote-sidebar .customer-grid{
    column-gap:5mm;
    row-gap:2mm;
    padding:2.5mm 3mm;
  }
  .reference-layout.no-quote-sidebar .customer-field{
    grid-template-columns:28mm 1fr;
    gap:2mm;
    font-size:12pt !important;
  }

  .reference-layout.no-quote-sidebar .ref-note h4{
    font-size:12pt !important;
  }
  .reference-layout.no-quote-sidebar .ref-sign > b{
    font-size:12pt !important;
  }

  .material-table .materials-title th{
    font-size:12pt !important;
    padding:1.5mm 2mm !important;
  }
}


/* ===== V1.3 Branch-based Item / Service Masters ===== */
.branch-master-bar{margin-bottom:16px}
.branch-master-form{display:flex;align-items:end;gap:16px;flex-wrap:wrap}
.branch-master-form .form-group{min-width:300px;margin:0}
.branch-currency-badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:42px;padding:0 18px;border-radius:10px;
  background:#eaf3ff;color:#0a438f;font-weight:800;
  border:1px solid #c8dff5;
}


/* ===== V1.4 Roles & Permissions ===== */
.role-add-row{display:flex;align-items:end;gap:12px;flex-wrap:wrap}
.role-add-row .form-group{min-width:300px;margin:0}
.role-card{margin-bottom:16px}
.role-head{display:flex;align-items:end;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.role-name-box{min-width:260px;flex:1}
.role-active-box{width:130px}
.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.permission-item{
  display:flex;gap:10px;align-items:center;padding:10px 12px;
  border:1px solid #dbe4ef;border-radius:8px;background:#f8fbff;
  font-size:13px;font-weight:600;color:#284868
}
.permission-item input{width:auto}
.material-table th:last-child,.material-table td:last-child{min-width:72px}
@media(max-width:760px){.permission-grid{grid-template-columns:1fr}}


/* ===== V1.5 FINAL Material Table Widths ===== */
.material-table{
  width:100% !important;
  table-layout:fixed !important;
}
.material-table col.col-no{width:5%}
.material-table col.col-desc{width:18%}
.material-table col.col-model{width:30%}
.material-table col.col-qty{width:5%}
.material-table col.col-unit{width:6%}
.material-table col.col-unitprice{width:13%}
.material-table col.col-amount{width:13%}
.material-table col.col-warranty{width:10%}

.material-table th,
.material-table td{
  overflow-wrap:anywhere;
}
.material-table th:nth-child(8),
.material-table td:nth-child(8){
  min-width:0 !important;
  white-space:normal !important;
}

/* V1.7 */
.pos-entry-table{min-width:1000px}.pos-entry-table th{white-space:nowrap}
.master-price-note{margin-top:4px;font-size:11px;color:#6b7f94;white-space:nowrap}
.line-amount{min-width:125px;text-align:right;font-weight:800;color:#0a438f;white-space:nowrap}
.status-form{display:flex;gap:5px;flex-wrap:wrap}
.status-option{display:inline-flex;align-items:center;gap:4px;padding:5px 7px;border:1px solid #d5e0eb;border-radius:999px;background:#fff;font-size:11px;font-weight:700;cursor:pointer}
.status-option input{width:auto;margin:0}.status-option:has(input:checked){box-shadow:inset 0 0 0 2px #0b5ea8}
.status-pending{color:#8a6300}.status-confirm{color:#087443}.status-fail{color:#a82121}
.status-badge{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800}
.status-badge.status-pending{background:#fff5cc}.status-badge.status-confirm{background:#ddf7e9}.status-badge.status-fail{background:#ffe1e1}
.inline-form{display:inline-flex;margin:3px 0}.lock-badge{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;font-size:11px;font-weight:800}
.lock-badge.locked{background:#ffe2e2;color:#9d2020}.lock-badge.unlocked{background:#e2f5e9;color:#16633d}
.btn-small{padding:5px 8px;font-size:11px}.action-cell{white-space:nowrap}
.master-lock-panel{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.master-fieldset{border:0;padding:0;margin:0;min-width:0}.master-fieldset:disabled{opacity:.58}


/* ===== V1.8 Quotation List Live Filters ===== */
.status-filter-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:14px;
}
.status-filter-label{
  font-weight:800;
  color:#173f6b;
  margin-right:3px;
}
.status-filter-option{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:7px 11px;
  border:1px solid #d5e0eb;
  border-radius:999px;
  background:#fff;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
}
.status-filter-option input{
  width:auto;
  margin:0;
}
.status-filter-option:has(input:checked){
  box-shadow:inset 0 0 0 2px #0b5ea8;
  background:#eef6ff;
}
.quotation-list-table td,
.quotation-list-table th{
  vertical-align:middle;
}


/* ===== V1.8.1 Print + Row Ordering ===== */
.row-actions{
  min-width:112px;
  white-space:nowrap;
  text-align:center;
}
.move-btn{
  border:1px solid #c8d8e8;
  background:#eef6ff;
  color:#0b4e91;
  border-radius:7px;
  min-width:30px;
  height:34px;
  margin-right:4px;
  cursor:pointer;
  font-weight:900;
}
.move-btn:hover{
  background:#dceeff;
}

/* Prepared By layout with real e-sign space */
.ref-sign.prepared-sign{
  display:flex;
  flex-direction:column;
}
.prepared-esign-space{
  flex:1 1 auto;
  min-height:70px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.prepared-sign .esign{
  max-width:160px;
  max-height:70px;
  object-fit:contain;
}
.prepared-footer{
  margin-top:auto;
  padding-top:5px;
}

/* Keep the materials subtotal value under Amount, not Warranty */
.material-subtotal td:nth-last-child(2){
  white-space:nowrap !important;
  text-align:right !important;
}

/* PRINT */
@media print{
  @page{
    size:A4 portrait;
    margin:4mm !important;
  }

  /* Do not print app flash messages such as "Quotation updated successfully." */
  .flash{
    display:none !important;
  }

  .quote-wrap.reference-layout.no-quote-sidebar{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
  }

  .reference-layout.no-quote-sidebar .reference-paper{
    width:100% !important;
    max-width:none !important;
    padding:0 !important;
    margin:0 !important;
  }

  /* Make table totals stay on one line */
  .material-table .money,
  .service-table .money,
  .ref-subtotal .money,
  .ref-summary td:last-child{
    white-space:nowrap !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
  }

  /* Slightly rebalance material columns for A4 print */
  .material-table col.col-no{width:4% !important}
  .material-table col.col-desc{width:17% !important}
  .material-table col.col-model{width:31% !important}
  .material-table col.col-qty{width:5% !important}
  .material-table col.col-unit{width:6% !important}
  .material-table col.col-unitprice{width:13% !important}
  .material-table col.col-amount{width:15% !important}
  .material-table col.col-warranty{width:9% !important}

  /* QUOTATION services: cleaner one-line print treatment */
  .reference-layout.no-quote-sidebar .service-strip{
    display:flex !important;
    align-items:center !important;
    gap:0 !important;
    max-width:none !important;
    margin-top:2mm !important;
    flex-wrap:nowrap !important;
  }
  .reference-layout.no-quote-sidebar .service-chip{
    display:inline-flex !important;
    min-height:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:none !important;
    font-size:6.5pt !important;
    font-weight:700 !important;
    line-height:1.2 !important;
    color:#35536f !important;
    gap:0 !important;
    white-space:nowrap !important;
  }
  .reference-layout.no-quote-sidebar .service-chip-icon{
    display:none !important;
  }
  .reference-layout.no-quote-sidebar .service-chip:not(:last-child)::after{
    content:" | ";
    display:inline-block;
    margin:0 2mm;
    color:#7b8fa1;
  }

  /* Prepared By: keep user/date at bottom and reserve room for E-sign */
  .ref-signatures{
    align-items:stretch !important;
  }
  .ref-sign.prepared-sign,
  .ref-sign.customer-sign{
    min-height:38mm !important;
  }
  .prepared-esign-space{
    min-height:17mm !important;
  }
  .prepared-sign .esign{
    max-height:16mm !important;
    max-width:38mm !important;
  }
  .prepared-footer{
    margin-top:auto !important;
    padding-top:1mm !important;
  }
}


/* ===== V1.8.2 PRINT: MATCH SCREEN PREVIEW MORE CLOSELY ===== */
@media print{
  @page{
    size:A4 portrait;
    margin:1mm !important;
  }

  /* Use almost the full A4 width */
  html, body{
    margin:0 !important;
    padding:0 !important;
    width:100% !important;
    background:#fff !important;
  }

  .main,
  .content,
  .quote-wrap.reference-layout.no-quote-sidebar,
  .reference-layout.no-quote-sidebar .reference-paper{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
  }

  .content,
  .reference-layout.no-quote-sidebar .reference-paper{
    padding:0 !important;
  }

  /* Keep the QUOTATION service cards + icons in print, same idea as preview */
  .reference-layout.no-quote-sidebar .service-strip{
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:1.5mm !important;
    max-width:126mm !important;
    margin-top:2mm !important;
  }

  .reference-layout.no-quote-sidebar .service-chip{
    min-height:9.5mm !important;
    display:flex !important;
    align-items:center !important;
    gap:1.2mm !important;
    padding:1.2mm 1.4mm !important;
    border:1px solid #c8deef !important;
    border-radius:2mm !important;
    background:linear-gradient(180deg,#fafdff,#edf6fc) !important;
    color:#0a4f90 !important;
    font-size:6.6pt !important;
    font-weight:700 !important;
    line-height:1.1 !important;
    white-space:normal !important;
  }

  .reference-layout.no-quote-sidebar .service-chip-icon{
    display:flex !important;
    width:5.5mm !important;
    height:5.5mm !important;
    flex:0 0 5.5mm !important;
    border-radius:50% !important;
    background:#e3f2fd !important;
    align-items:center !important;
    justify-content:center !important;
  }

  .reference-layout.no-quote-sidebar .service-chip-icon svg{
    display:block !important;
    width:4.1mm !important;
    height:4.1mm !important;
    fill:none !important;
    stroke:#0c6fb5 !important;
    stroke-width:1.8 !important;
  }

  .reference-layout.no-quote-sidebar .service-chip:not(:last-child)::after{
    content:none !important;
    display:none !important;
  }

  /* Quotation No / Date / Valid Until: force same-line values */
  .reference-layout.no-quote-sidebar .ref-title-row{
    grid-template-columns:minmax(0,1fr) 70mm !important;
    column-gap:3mm !important;
  }

  .reference-layout.no-quote-sidebar .ref-meta{
    min-width:70mm !important;
    width:70mm !important;
    padding:2.5mm 3mm !important;
  }

  .reference-layout.no-quote-sidebar .ref-meta div{
    display:grid !important;
    grid-template-columns:26mm minmax(0,1fr) !important;
    column-gap:2mm !important;
    align-items:center !important;
  }

  .reference-layout.no-quote-sidebar .ref-meta b,
  .reference-layout.no-quote-sidebar .ref-meta span{
    font-size:8.3pt !important;
    line-height:1.25 !important;
    white-space:nowrap !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
  }

  /* Customer Information: keep labels on one line like preview */
  .reference-layout.no-quote-sidebar .customer-grid{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    column-gap:7mm !important;
    row-gap:1.8mm !important;
    padding:2.5mm 3mm !important;
  }

  .reference-layout.no-quote-sidebar .customer-field{
    grid-template-columns:31mm minmax(0,1fr) !important;
    gap:2mm !important;
    align-items:start !important;
    font-size:8.5pt !important;
    line-height:1.35 !important;
  }

  .reference-layout.no-quote-sidebar .customer-label{
    white-space:nowrap !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
    font-size:8.5pt !important;
  }

  .reference-layout.no-quote-sidebar .customer-value{
    font-size:8.5pt !important;
    line-height:1.35 !important;
  }

  /* Right side values should have enough room */
  .reference-layout.no-quote-sidebar .customer-field:nth-child(even){
    grid-template-columns:19mm minmax(0,1fr) !important;
  }

  /* Address is allowed to wrap naturally, but labels never wrap */
  .reference-layout.no-quote-sidebar .customer-field:nth-child(5) .customer-value{
    white-space:normal !important;
  }

  /* Material table: keep numbers and headings from wrapping unnecessarily */
  .material-table th,
  .material-table td,
  .service-table th,
  .service-table td{
    font-size:7.5pt !important;
    line-height:1.2 !important;
  }

  .material-table .money,
  .service-table .money,
  .ref-subtotal .money{
    white-space:nowrap !important;
    word-break:normal !important;
    overflow-wrap:normal !important;
  }

  .material-table col.col-no{width:4% !important}
  .material-table col.col-desc{width:17% !important}
  .material-table col.col-model{width:31% !important}
  .material-table col.col-qty{width:5% !important}
  .material-table col.col-unit{width:6% !important}
  .material-table col.col-unitprice{width:13% !important}
  .material-table col.col-amount{width:15% !important}
  .material-table col.col-warranty{width:9% !important}
}


/* ===== V1.8.3 PRINT REFINEMENT ===== */
@media print{
  /* User requested Top/Bottom 4 mm, Left/Right stay tight at 1 mm */
  @page{
    size:A4 portrait;
    margin:4mm 1mm !important;
  }

  /* Restore normal readable size for Quotation No / Date / Valid Until */
  .reference-layout.no-quote-sidebar .ref-meta{
    min-width:72mm !important;
    width:72mm !important;
    padding:2.5mm 3mm !important;
  }
  .reference-layout.no-quote-sidebar .ref-meta div{
    grid-template-columns:27mm minmax(0,1fr) !important;
    column-gap:2mm !important;
    padding:.8mm 0 !important;
  }
  .reference-layout.no-quote-sidebar .ref-meta b,
  .reference-layout.no-quote-sidebar .ref-meta span{
    font-size:10pt !important;
    line-height:1.3 !important;
    white-space:nowrap !important;
  }

  /* Restore Customer Information to normal readable size */
  .reference-layout.no-quote-sidebar .customer-grid{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    column-gap:7mm !important;
    row-gap:2.2mm !important;
    padding:3mm 3.5mm !important;
  }
  .reference-layout.no-quote-sidebar .customer-field{
    grid-template-columns:32mm minmax(0,1fr) !important;
    gap:2mm !important;
    font-size:10pt !important;
    line-height:1.35 !important;
  }
  .reference-layout.no-quote-sidebar .customer-field:nth-child(even){
    grid-template-columns:20mm minmax(0,1fr) !important;
  }
  .reference-layout.no-quote-sidebar .customer-label,
  .reference-layout.no-quote-sidebar .customer-value{
    font-size:10pt !important;
    line-height:1.35 !important;
  }
  .reference-layout.no-quote-sidebar .customer-label{
    white-space:nowrap !important;
  }

  /* Center every table column heading: No., Description, Qty, Unit, etc. */
  .material-table th,
  .service-table th{
    text-align:center !important;
    vertical-align:middle !important;
  }

  /* Warranty slightly wider than V1.8.2 */
  .material-table col.col-no{width:4% !important}
  .material-table col.col-desc{width:17% !important}
  .material-table col.col-model{width:28% !important}
  .material-table col.col-qty{width:5% !important}
  .material-table col.col-unit{width:6% !important}
  .material-table col.col-unitprice{width:13% !important}
  .material-table col.col-amount{width:15% !important}
  .material-table col.col-warranty{width:12% !important}

  .material-table th:nth-child(8),
  .material-table td:nth-child(8){
    white-space:normal !important;
    overflow-wrap:normal !important;
    word-break:normal !important;
  }
}


/* ===== V1.9 Customer / Delete History / Default Masters ===== */
.customer-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.default-master-box{
  grid-column:1/-1;
  border:1px solid #cfe0f1;
  background:#f5f9ff;
  border-radius:10px;
  padding:12px;
  margin-bottom:4px;
}
.default-master-check{
  display:flex;
  align-items:flex-start;
  gap:10px;
  cursor:pointer;
}
.default-master-check input{
  width:auto;
  margin-top:3px;
}
.default-master-check span{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.default-master-check small{
  font-weight:400;
  color:#66798d;
}
.currency-price-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:12px;
}
@media(max-width:800px){
  .currency-price-grid{grid-template-columns:1fr}
}


/* ===== V1.10 Data Tools / Reports ===== */
.data-tools-grid,
.report-menu-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.report-card h3,
.data-tools-grid h3{
  margin-top:0;
  color:#0a438f;
}
.danger-card{
  border:1px solid #efb6b6;
  background:#fffafa;
}

.report-print-page{
  background:#eef3f8;
  margin:0;
  font-family:Pyidaungsu,Arial,sans-serif;
  color:#18324d;
}
.report-toolbar{
  max-width:1120px;
  margin:14px auto;
  display:flex;
  gap:8px;
}
.report-paper{
  max-width:1120px;
  margin:0 auto 30px;
  padding:24px;
  background:#fff;
  box-shadow:0 2px 10px rgba(20,50,80,.08);
}
.report-head{
  display:flex;
  justify-content:space-between;
  align-items:end;
  border-bottom:2px solid #0b5ea8;
  padding-bottom:10px;
  margin-bottom:12px;
}
.report-head h1{
  margin:0;
  color:#083d76;
  font-size:24px;
}
.report-head h2{
  margin:4px 0 0;
  color:#1567a8;
  font-size:18px;
}
.report-generated{
  font-size:12px;
}
.report-filters{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  background:#f3f8fd;
  border:1px solid #d9e7f3;
  padding:8px 10px;
  margin-bottom:12px;
}
.report-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
.report-table th,
.report-table td{
  border:1px solid #d5e0eb;
  padding:6px 7px;
  vertical-align:top;
}
.report-table th{
  background:#eaf3fb;
  color:#123e69;
  text-align:center;
}
.report-table .money{
  text-align:right;
  white-space:nowrap;
}
.quote-report-block{
  margin-bottom:20px;
  page-break-inside:avoid;
}
.quote-report-title{
  display:flex;
  gap:18px;
  align-items:center;
  background:#0d5ea3;
  color:#fff;
  padding:7px 10px;
}
.quote-report-customer{
  padding:7px 10px;
  background:#f5f9fd;
  border:1px solid #d5e0eb;
  border-top:0;
}
.report-total-row td{
  font-weight:800;
  background:#e8f4fd;
}
.report-total-row td:first-child{
  text-align:right;
}

@media(max-width:800px){
  .data-tools-grid,
  .report-menu-grid{
    grid-template-columns:1fr;
  }
}

@media print{
  .report-print-page{
    background:#fff !important;
  }
  .report-toolbar{
    display:none !important;
  }
  .report-paper{
    box-shadow:none !important;
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
  }
  .report-table{
    font-size:9pt !important;
  }
  .report-table thead{
    display:table-header-group;
  }
  .quote-report-block{
    page-break-inside:auto;
  }
}


/* ===== V1.10.2 refinements ===== */
.btn-danger{
  background:#b42318;
  color:#fff;
  border-color:#b42318;
}
.btn-danger:hover{
  background:#8f1d14;
  border-color:#8f1d14;
}


/* ===== V1.10.3 Master Search + Specification PDF ===== */
.master-search-card{
  padding:10px 12px !important;
  margin-bottom:10px;
}
.master-search-input{
  width:100%;
  box-sizing:border-box;
  border:1px solid #c9d9ea;
  border-radius:8px;
  padding:10px 12px;
  font-size:14px;
}
.spec-include-control{
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:4px 6px;
  border:1px solid #8ebbe4;
  border-radius:6px;
  background:#eef7ff;
  color:#07579d;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.spec-include-control input{
  width:auto !important;
  margin:0 !important;
}
.spec-summary-card{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  padding:10px 14px !important;
}
.spec-summary-item{
  display:inline-block;
  padding:4px 8px;
  background:#edf6ff;
  border:1px solid #c8def2;
  border-radius:999px;
  font-size:12px;
}
.row-actions{
  min-width:170px;
}


/* ===== V1.10.6 COMBINED PDF PRINT FIX ===== */
@media print{
  @page{
    size:A4 portrait;
    margin:4mm !important;
  }

  /* The 1 mm left/right print margin used before was too close to the paper edge. */
  html, body{
    margin:0 !important;
    padding:0 !important;
  }

  /* Keep the quotation footer on the quotation page when possible. */
  .ref-sign.prepared-sign,
  .ref-sign.customer-sign{
    min-height:35mm !important;
  }

  .prepared-esign-space{
    min-height:14mm !important;
  }

  .prepared-sign .esign{
    display:block !important;
    max-height:15mm !important;
    max-width:38mm !important;
    width:auto !important;
    height:auto !important;
    object-fit:contain !important;
    margin:1mm auto !important;
  }

  .prepared-footer{
    margin-top:auto !important;
    padding-top:.5mm !important;
  }

  .ref-footer{
    margin-top:3px !important;
    padding-top:4px !important;
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }
}


/* ===== V1.10.7 Output Choice ===== */
.output-choice-overlay{
  position:fixed;
  inset:0;
  background:rgba(7,31,61,.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:20px;
}
.output-choice-overlay.show{
  display:flex;
}
.output-choice-card{
  width:min(460px,92vw);
  background:#fff;
  border-radius:14px;
  box-shadow:0 18px 55px rgba(0,0,0,.22);
  padding:20px;
}
.output-choice-title{
  color:#0b4d91;
  font-size:20px;
  font-weight:800;
  margin-bottom:6px;
}
.output-choice-text{
  color:#56697d;
  margin-bottom:18px;
}
.output-choice-actions{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}

/* Template-specific @page rules override this for:
   - Combined PDF: 8mm all around
   - Quotation Only: 8mm top/bottom, 4mm left/right */


/* ===== V1.10.8 Saved Customer Delete ===== */
.customer-pick-row{
  display:flex;
  align-items:stretch;
  gap:8px;
  margin-bottom:6px;
}
.customer-pick-main{
  flex:1 1 auto;
  margin:0 !important;
}
.customer-delete-btn{
  flex:0 0 auto;
  align-self:stretch;
  min-width:68px;
}
