/* SHINE GLASS ERP — custom styles */

body { font-size: 13px; }
.page-title { font-size: 1.1rem; font-weight: 600; color: #495057; }

/* Color-coded item-master columns */
.col-cost  { background-color: #ffe2e6 !important; }
.col-sell  { background-color: #d4f3d4 !important; }
.col-min   { background-color: #fff3cd !important; }

/* Proforma grid */
.pi-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.pi-grid th, .pi-grid td { border: 1px solid #cfd6db; padding: 2px 4px; }
.pi-grid th { background: #2c3e50; color: #fff; font-weight: 600; text-align: center; vertical-align: middle; }
.pi-grid input, .pi-grid select { border: none; background: transparent; width: 100%; padding: 2px 4px; font-size: 12px; }
.pi-grid input.text-right, .pi-grid input.number { text-align: right; }
.pi-grid input:focus, .pi-grid select:focus { background: #fffae6; outline: 1px solid #3498db; }
.pi-grid td.cell-actual    { background: #f9fbfd; }
.pi-grid td.cell-chrg      { background: #cfe2f3; }
.pi-grid td.cell-qty       { background: #fff3cd; }
.pi-grid td.cell-rft       { background: #fde0d2; }
.pi-grid td.cell-sqmt,
.pi-grid td.cell-goods     { background: #d9ead3; }
.pi-grid td.cell-fp        { background: #efefef; }
.pi-grid td.cell-rate      { background: #fff; }
.pi-grid input[readonly]   { color: #4d5b67; background: transparent !important; }

.pi-grid thead th.group-header { background: #34495e; }

/* Summary boxes */
.summary-box {
    background: #fff; border: 1px solid #d6dbe0; border-radius: 4px;
    padding: 10px; margin-bottom: 10px;
}
.summary-box .row { margin-left: 0; margin-right: 0; }
.summary-row { display: flex; justify-content: space-between; padding: 2px 4px; font-size: 13px; }
.summary-row.total { font-weight: 420; font-size: 16px; color: #b00; border-top: 2px solid #444; padding-top: 6px; }

.badge-mode { font-size: 11px; padding: 4px 8px; }

/* Header strip on proforma form */
.pi-header { background: #f3f5f9; border: 1px solid #d6dbe0; padding: 8px; border-radius: 4px; }
.pi-header label { font-size: 11px; margin-bottom: 1px; font-weight: 600; color: #555; }
.pi-header .form-control-sm { font-size: 12px; }

/* Print invoice layout */
.invoice-paper { width: 210mm; min-height: 297mm; box-sizing: border-box; margin: 0 auto; background: #fff; padding: 7mm 6mm 5mm; border: 2px solid #111; color: #111; font-family: Arial, Helvetica, sans-serif; font-size: 8.5px; line-height: 1.25; position: relative; }
.invoice-paper h1 { text-align: center; font-weight: 800; font-size: 22px; margin: 0 0 2px; letter-spacing: 0.5px; }
.invoice-paper .text-center { text-align: center; }
.invoice-paper .text-right { text-align: right; }

.pi-top { display: grid; grid-template-columns: 105px 1fr 170px; gap: 8px; align-items: start; padding-bottom: 4px; margin-bottom: 4px; }
.pi-logo {
  text-align: center;
  width: 105px;
  max-width: 105px;
  min-width: 0;
  overflow: hidden;
}
.pi-logo img {
  display: block;
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 100px;
  max-height: 72px;
  object-fit: contain;
}
.pi-doc-col {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
}
.pi-doc-col img.pi-logo-partner {
  max-width: 92px;
  max-height: 44px;
  margin: 0 0 4px;
  object-fit: contain;
}
.pi-doc-col .pi-doc-title {
  align-self: end;
  margin-top: auto;
}
.pi-logo-mark { width: 82px; height: 62px; border: none; border-radius: 0; display: flex; align-items: center; justify-content: center; font-size: 42px; font-weight: 800; color:#27549c; margin: 0 auto; font-style: italic; }
.pi-logo-text { text-align: center; font-size: 13px; font-weight: 700; color:#0aa1c0; font-style: italic; margin-top: 0; }
.pi-company { text-align: center; font-size: 7.5px; }
.pi-company .pi-gst { margin-top: 10px; font-size: 11px; }
.pi-doc-title { border: 2px solid #222; box-shadow: 4px 4px 0 #111; text-align: center; font-family: "Times New Roman", serif; font-weight: 700; font-size: 14px; line-height: 1.1; padding: 5px 4px; }

.pi-meta-strip { display: grid; grid-template-columns: 190px 1fr 120px; gap: 10px; margin: 5px 0 8px; font-size: 8px; line-height: 1.7; }
.pi-factory-job { text-align: center; font-weight: 400; font-size: 8px; align-self: end; }

.pi-address-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 6px; }
.pi-address-box { border: 1px solid #111; padding: 5px 8px; min-height: 112px; font-size: 8px; line-height: 1.65; }
.pi-address-box + .pi-address-box { border-left: none; }
.pi-address-row .pi-address-box + .pi-address-box { border-left: 1px solid #111; }
.pi-address-title { font-weight: 700; border-bottom: 1px solid #111; margin: -5px -8px 5px; padding: 4px 8px; text-decoration: none; }

.invoice-paper .invoice-table { width: 100%; border-collapse: collapse; margin-top: 0; table-layout: fixed; }
.invoice-paper .invoice-table th,
.invoice-paper .invoice-table td { border: 1px solid #111; padding: 2px 3px; font-size: 7.4px; vertical-align: middle; word-wrap: break-word; }
.invoice-paper .invoice-table th { border: 1px solid #111; padding: 2px 3px; font-size: 7.2px; background: #fff; text-align: center; font-weight: 700; }
.pi-items-table .pi-desc-row td { background: #fff; font-size: 8px; padding: 3px 6px; }
.pi-items-table .pi-summary-row td { background: #fafafa; font-weight: 600; }
.pi-items-table .pi-meta-row2 td { font-size: 8px; padding: 4px 6px; }
.pi-items-table .pi-group-sub-row td { background: #f0f4f8; border-top: 1px solid #888; font-weight: 600; }

.pi-bottom { display: grid; grid-template-columns: 1fr 315px; gap: 12px; margin-top: 8px; align-items: start; }
.pi-bottom-left .bank-box { border: 1px solid #bbb; padding: 0; font-size: 8px; margin-bottom: 30px; line-height: 1.3; width: 330px; }
.pi-bottom-left .bank-box strong { display:block; padding: 5px 8px; border-bottom: 1px solid #bbb; }
.pi-bottom-left .bank-box table { width: 100%; border-collapse: collapse; }
.pi-bottom-left .bank-box td { border-bottom: 1px solid #bbb; padding: 4px 8px; }
.pi-bottom-left .bank-box tr:last-child td { border-bottom: none; }
.pi-bottom-left .bank-box td:first-child { width: 36%; }
.pi-bottom-left .tnc { font-size: 7.7px; line-height: 1.35; margin-top: 28px; }
.pi-bottom-left .tnc ol { margin: 4px 0 0 16px; padding: 0; }
.pi-bottom-left .tnc li { margin-bottom: 2px; }

.pi-charges-table { width: 100%; border-collapse: collapse; font-size: 8px; }
.pi-charges-table td { border: 1px solid #111; padding: 4px 6px; }
.pi-charges-table td:first-child { width: 46%; }
.pi-charges-table td:nth-child(2),
.pi-charges-table td:nth-child(3) { width: 18%; }
.pi-charges-table td:last-child { width: 18%; }
.pi-subtotal-row td,
.pi-grand-sub-row td { background: #fff; }
.pi-grand-total-row td { background: #fff; font-size: 9px; }

.pi-footer { position: absolute; left: 6mm; right: 6mm; bottom: 4mm; display: flex; justify-content: space-between; align-items: flex-end; margin-top: 0; padding-top: 0; border-top: none; font-size: 7px; }
.pi-sign { margin-top: 55px; font-weight: 700; text-align: right; }
.pi-sign-sub { text-align: right; font-size: 7px; margin-top: 34px; }

.btn-print { background: #007bff; color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn-print:hover { background: #0069d9; }

@media print {
  @page { size: A4 portrait; margin: 4mm; }
  body { background: #fff !important; font-size: 8px; }
  .main-sidebar, .main-header, .control-sidebar, .content-header,
  .no-print, .btn, .breadcrumb, footer { display: none !important; }
  .content-wrapper, .content { margin: 0 !important; padding: 0 !important; }
  .invoice-box { page-break-after: avoid; width: auto; min-height: 289mm; max-width: 100%; }
  .invoice-table { font-size: 7px; }
  .invoice-table th, .invoice-table td { padding: 2px 2px !important; border: 1px solid #111; }
}

.numbox { text-align: right; }

/* Cost/Sell pills used on item lists */
.col-cost-pill { background: #ffe5e8; color: #802b3a; padding: 2px 6px; border-radius: 3px; }
.col-sell-pill { background: #ddf5dd; color: #1f6b1f; padding: 2px 6px; border-radius: 3px; }

/* Disable AdminLTE's overflow on content for tables */
.pi-grid-wrap { max-height: 460px; overflow: auto; border: 1px solid #cfd6db; }
.pi-grid thead th { position: sticky; top: 0; z-index: 2; }

/* Toggle switch */
.toggle-block { padding-top: 24px; }

/* Login */
.login-page .card { box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.login-page .brand { text-align: center; padding: 12px 0; }
.login-page .brand i { font-size: 28px; color: #007bff; }
