:root {
  --ink: #4a2b22;
  --line: #c9b6ae;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, Arial;
  background: #fff;
  color: var(--ink);
}
.wrap {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 14px;
}
h1 {
  text-align: center;
  margin: 20px 0 20px;
  font-size: 30px;
}

select,
input,
textarea {
  font-size: 16px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  width: 100%;
}
.top {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.top select {
  width: auto;
  min-width: 210px;
  max-width: 100%;
}
.pill {
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12.5px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin: 12px 0;
}
.field {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.field label {
  min-width: 160px;
  text-align: right;
  font-size: 15px;
}

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.panel {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #6b4c41;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 15px;
}
.small {
  font-size: 13.5px;
  border-bottom: 1px dashed var(--line);
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.warn {
  color: #a23b2a;
  font-size: 13.5px;
  margin-top: 8px;
  white-space: pre-line;
}

.btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
button {
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #fff;
  cursor: pointer;
}
button:hover {
  background: #f7f1ee;
}

/* Mobile */
@media (max-width: 720px) {
  h1 {
    font-size: 20px;
  }
  .top select {
    width: 100%;
    min-width: unset;
  }
  .pill {
    width: 100%;
    text-align: center;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .field {
    flex-direction: column;
    align-items: stretch;
  }
  .field label {
    min-width: unset;
    text-align: left;
  }
  .panels {
    grid-template-columns: 1fr;
  }
  .btns button {
    width: 100%;
  }
}

/* ================== INVOICE (FORMAT LIKE SAMPLE) ================== */
.invoice-wrap {
  max-width: 1100px;
  margin: 14px auto;
  padding: 0 14px;
}
.inv {
  border: 1px solid #d7c6bf;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}
.inv-head {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  align-items: start;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.logoBox {
  width: 56px;
  height: 56px;
  border: 1px solid #e2d6d0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}
.logoBox img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.invTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.invSmall {
  font-size: 12.5px;
  color: #5a3b31;
  line-height: 1.35;
}

.metaCard {
  border: 1px solid #e2d6d0;
  border-radius: 14px;
  padding: 10px 12px;
}
.metaRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed #e2d6d0;
  font-size: 13px;
}
.metaRow:last-child {
  border-bottom: none;
}
.metaRow span {
  color: #6b4c41;
}
.metaRow b {
  font-weight: 700;
}

.card {
  border: 1px solid #e2d6d0;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.customerCard {
  margin-top: 12px;
}
.customerGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.f {
  display: flex;
  gap: 8px;
  align-items: center;
}
.f label {
  min-width: 70px;
  font-size: 12.5px;
  color: #6b4c41;
}
.f input,
.f textarea {
  width: 100%;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid #e2d6d0;
  border-radius: 12px;
}
.f textarea {
  min-height: 44px;
  resize: none;
}
.customerGrid .full {
  grid-column: 1/-1;
}

.invGrid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.invTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid #e2d6d0;
  border-radius: 12px;
  font-size: 13px;
}
.invTable th {
  background: #faf7f5;
  text-align: left;
  padding: 8px 9px;
  border-bottom: 1px solid #e2d6d0;
}
.invTable td {
  padding: 8px 9px;
  border-bottom: 1px solid #f0e6e1;
  vertical-align: top;
}
.invTable tr:last-child td {
  border-bottom: none;
}
.invTable .num {
  text-align: left;
  border-left: 1px solid #e2d6d0;
  white-space: nowrap;
}

.note {
  margin-top: 10px;
  font-size: 11.5px;
  color: #6b4c41;
  line-height: 1.35;
}

.sumTitle {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.sumRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #e2d6d0;
  font-size: 13px;
}
.sumRow:last-child {
  border-bottom: none;
}
.sumRow span {
  color: #6b4c41;
}
.sumRow b {
  font-weight: 700;
}
.sumBlock {
  margin-top: 10px;
}
.inputRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}
.inputRow label {
  font-size: 12.5px;
  color: #6b4c41;
  min-width: 110px;
}
.inputRow input {
  width: 120px;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid #e2d6d0;
  border-radius: 12px;
  text-align: right;
}

.grand {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid #4a2b22;
}
.grand .sumRow {
  border-bottom: none;
  font-size: 14px;
}

.signRow {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.signBox {
  border: 1px dashed #e2d6d0;
  border-radius: 14px;
  height: 120px;
  padding: 10px;
  display: flex;
  align-items: flex-end;
  color: #6b4c41;
  font-size: 12px;
}

.inv-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.inv-actions button {
  font-size: 14px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 2px solid #4a2b22;
  background: #fff;
  cursor: pointer;
}

/* ✅ print only invoice */
@media print {
  body * {
    visibility: hidden !important;
  }
  body.print-invoice #invoiceSection,
  body.print-invoice #invoiceSection * {
    visibility: visible !important;
  }
  body.print-invoice #invoiceSection {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
  }
  body.print-invoice .inv-actions {
    display: none !important;
  }
  @page {
    size: A4;
    margin: 10mm;
  }
  .inv {
    border: 0 !important;
    padding: 0 !important;
  }
  .invTable th,
  .invTable td {
    padding: 6px 7px;
    font-size: 12px;
  }
  .metaRow,
  .sumRow {
    padding: 4px 0;
  }
  .signBox {
    height: 52px;
  }
}

/***********calculator floting****************/

.calc-float-btn{
  position: fixed;
  right: 20px;
  top: 45%;
  z-index: 99999;
  background: #1f5b2e;
  color: #fff;
  padding: 14px 22px;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
}

.calc-popup{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  z-index: 100000;
}

.calc-popup-inner{
  position: fixed;
  right: 0;
  top: 0;
  height: 100dvh;
  width: 420px;
  max-width: 100%;
  background: #fff;
  padding: 10px;
  box-shadow: -10px 0 30px rgba(0,0,0,.25);
}

.calc-close{
  position: absolute;
  top: 10px;
  right: 10px;
  background: #c0392b;
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 5;
}

.calc-iframe{
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  margin-top: 40px; /* close button space */
}

@media (max-width:768px){
  .calc-popup-inner{ width: 100%; }
}


/*******additional css******************/

/* Force floating calculator button visible */
.calc-float-btn{
  position: fixed !important;
  right: 22px !important;
  bottom: 110px !important;  /* Live chat এর উপরে রাখলাম */
  top: auto !important;
  z-index: 2147483647 !important;
  background: #1f5b2e !important;
  color: #fff !important;
  padding: 14px 22px !important;
  border-radius: 18px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 10px 25px rgba(0,0,0,.25) !important;
}

/* Popup overlay */
.calc-popup{
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,.55) !important;
  display: none;
  z-index: 2147483646 !important;
}

/* Right drawer */
.calc-popup-inner{
  position: fixed !important;
  right: 0 !important;
  top: 0 !important;
  height: 100vh !important;
  width: 420px !important;
  max-width: 100% !important;
  background: #fff !important;
  padding: 10px !important;
  box-shadow: -10px 0 30px rgba(0,0,0,.25) !important;
  overflow: hidden !important;
}

.calc-close{
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 2147483647 !important;
  background: #c0392b !important;
  color: #fff !important;
  border: none !important;
  padding: 6px 12px !important;
  font-size: 16px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
}

.calc-iframe{
  width: 100% !important;
  height: calc(100vh - 55px) !important;
  border: 0 !important;
  border-radius: 10px !important;
  margin-top: 45px !important;
}

@media (max-width:768px){
  .calc-popup-inner{ width: 100% !important; }
}


.calc-float-btn{
  position:fixed !important;
  right:18px !important;
  bottom:90px !important;  /* live chat এর উপরে */
  z-index:20000 !important;
  background:#1f5b2e !important;
  color:#fff !important;
  padding:14px 18px !important;
  border-radius:999px !important;
  font-weight:700 !important;
  cursor:pointer !important;
  box-shadow:0 8px 20px rgba(0,0,0,.25) !important;
}
.calc-popup{ z-index:30000 !important; }

