/* =========================================================
   MotherHomeSolar Co., Ltd. - Quotation & Invoice SPA Styles
   ========================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: #e2e8f0;
  color: #1e293b;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 24px auto;
  padding: 32px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ========= DOCUMENT HEADER ========= */
.doc-header {
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 20px;
}

.doc-header-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  border-top: 5px solid #10b981;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.doc-logo-center {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.header-logo {
  max-width: 330px;
  max-height: 62px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.07));
}

.doc-header-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.doc-left {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.doc-left h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.company-info-row {
  font-size: 13px;
  color: #334155;
  margin: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.company-label {
  font-weight: 700;
  color: #475569;
  min-width: 60px;
  flex-shrink: 0;
}

.company-address-lines {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  color: #1e293b;
  font-weight: 500;
}

.company-fixed-val {
  color: #1e293b;
  font-weight: 500;
}

.doc-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-self: end;
  width: 270px;
}

.doc-type-selector {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  text-align: right;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 2px 6px;
  margin-bottom: 8px;
  outline: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.doc-type-selector:hover,
.doc-type-selector:focus {
  border-color: #94a3b8;
  background: #ffffff;
}

.doc-right p {
  font-size: 13.5px;
  margin: 2px 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.doc-right label {
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.doc-right input {
  text-align: right;
  width: 155px;
}

.doc-header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 16px;
  gap: 24px;
}

.prepared-for {
  flex: 1;
  max-width: 380px;
}

.prepared-for h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-bottom: 6px;
}

.prepared-for p {
  font-size: 13.5px;
  margin: 3px 0;
}

.project-info {
  flex: 1;
  text-align: right;
  max-width: 520px;
}

.project-info h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-bottom: 6px;
}

/* Editable header inputs */
.doc-header input,
.doc-header textarea {
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  padding: 3px 6px;
  outline: none;
  color: #1e293b;
  border-radius: 4px;
  transition: border-color 0.2s, background-color 0.2s;
}

.doc-header input:hover,
.doc-header textarea:hover,
.doc-header input:focus,
.doc-header textarea:focus {
  border-color: #94a3b8;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.doc-header textarea {
  resize: vertical;
  width: 100%;
  min-height: 52px;
  line-height: 1.4;
}

.input-company-address { width: 270px; }
.input-phone { width: 190px; }
.input-email { width: 220px; }
.input-id { width: 180px; font-weight: 600; }
.input-date { width: 145px; font-weight: 600; }
.input-client { width: 100%; }
.input-project { width: 100%; text-align: right; }

/* ========= SYSTEM TITLE ========= */
.system-title-container {
  text-align: center;
  margin: 18px 0 14px;
}

.system-title {
  display: inline-block;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  padding: 2px 10px;
}

/* ========= MAIN TABLE ========= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

table.main-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
}

table.main-table th,
table.main-table td {
  border: 1px solid #334155;
  padding: 6px 7px;
  vertical-align: middle;
}

table.main-table thead th {
  background: #f1f5f9;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  letter-spacing: 0.2px;
}

tr.section-header td {
  background: #10b981;
  color: #000000;
  font-weight: 700;
  padding: 6px 10px;
}

tr.highlight td {
  background: #fef08a !important; /* Soft high-visibility yellow */
}

table.main-table input[type="text"],
table.main-table input[type="number"] {
  width: 100%;
  border: 1px solid transparent;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  padding: 3px 5px;
  color: #0f172a;
  border-radius: 3px;
  transition: all 0.15s ease;
}

table.main-table input[type="text"]:hover,
table.main-table input[type="number"]:hover,
table.main-table input[type="text"]:focus,
table.main-table input[type="number"]:focus {
  border-color: #94a3b8;
  background: #ffffff;
}

table.main-table input[type="number"] {
  text-align: right;
  -moz-appearance: textfield;
}

table.main-table input[type="number"]::-webkit-outer-spin-button,
table.main-table input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.col-no { text-align: center; width: 34px; font-weight: 600; }
.col-item { width: 130px; font-weight: 500; }
.col-desc { width: 155px; }
.col-spec { width: 110px; }
.col-qty { width: 65px; text-align: right; }
.col-unit { width: 55px; text-align: center; }
.col-price { width: 105px; text-align: right; }
.col-amount { width: 115px; text-align: right; font-weight: 600; color: #0f172a; }
.col-remark { width: 125px; }
.col-action { width: 70px; text-align: center; }

tr.summary-row td {
  font-weight: 700;
  border: 1px solid #334155;
  padding: 7px 10px;
  background: #f8fafc;
}

tr.summary-row-grand td {
  background: #f1f5f9;
  font-size: 13.5px;
}

/* ========= BUTTONS ========= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  transition: all 0.2s ease;
  user-select: none;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-add { background: #10b981; margin: 4px 2px; }
.btn-add-section { background: #2563eb; }
.btn-del { background: #ef4444; font-size: 13px; padding: 2px 7px; border-radius: 4px; line-height: 1; }
.btn-del-section { background: #b91c1c; font-size: 14px; padding: 2px 8px; border-radius: 4px; line-height: 1; }
.btn-save { background: #0284c7; }
.btn-folder-save {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}
.btn-folder-save:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.btn-folder-manage {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
}
.btn-folder-manage:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
}
.btn-clear {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(225, 29, 72, 0.25);
}
.btn-clear:hover {
  background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
}
.btn-pdf {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.3);
}
.btn-pdf:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.btn-icon-svg {
  display: inline-block;
  vertical-align: middle;
}

.toolbar {
  margin: 20px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar .btn {
  padding: 9px 18px;
  font-size: 13.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hl-cb {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #f59e0b;
  margin-right: 4px;
}

/* ========= FOOTER / TERMS & SIGNATURE ========= */
.doc-footer {
  margin-top: 24px;
  border-top: 2px solid #e2e8f0;
  padding-top: 18px;
  font-size: 12.5px;
}

.validity-tag {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #047857;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.validity-tag input {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #047857;
  padding: 3px 6px;
  outline: none;
  border-radius: 4px;
}

.validity-tag input:focus {
  background: #ffffff;
  border-color: #6ee7b7;
}

.terms-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 26px;
}

.terms-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
}

.terms-col h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f766e;
  border-bottom: 1px solid #ccfbf1;
  padding-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.terms-col textarea {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
  min-height: 96px;
  font-family: inherit;
  color: #334155;
  outline: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.terms-col textarea:hover,
.terms-col textarea:focus {
  background: #ffffff;
  border-color: #cbd5e1;
}

.signature-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 36px;
  padding: 0 30px 10px;
}

.sig-block {
  text-align: center;
  width: 250px;
}

.sig-line {
  border-bottom: 1px dashed #64748b;
  height: 48px;
  margin-bottom: 8px;
}

.sig-seal {
  width: 76px;
  height: 76px;
  border: 2px dashed #10b981;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  color: #047857;
  font-weight: 800;
  margin: 0 auto 8px;
  background: #ecfdf5;
  line-height: 1.2;
}

.sig-seal span {
  font-size: 8px;
  font-weight: 600;
  opacity: 0.85;
}

.sig-title {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}

.sig-name {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  margin-top: 3px;
}

.sig-sub {
  font-size: 11.5px;
  color: #475569;
  margin-top: 2px;
}

.sig-company {
  font-size: 11.5px;
  color: #475569;
  font-weight: 600;
  margin-top: 2px;
}

/* Toast notification */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============ CLOUDFLARE R2 MODAL ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 16px;
}

.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title h3 {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.modal-icon {
  font-size: 20px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

.modal-close:hover {
  color: #0f172a;
  background: #e2e8f0;
}

/* ============ LOCAL STORAGE FOLDER MODAL STYLES ============ */
.folder-status-banner {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.folder-status-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.folder-pill {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-family: monospace;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-status-banner.has-folder .folder-pill {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.btn-select-folder {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-select-folder:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.modal-toolbar {
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 220px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.filter-group {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 6px;
}

.filter-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  color: #0f172a;
}

.filter-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-refresh {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-refresh:hover {
  background: #e2e8f0;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  max-height: 55vh;
}

.cloud-status-msg {
  text-align: center;
  padding: 24px;
  color: #64748b;
  font-size: 14px;
}

.cloud-status-msg.error {
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
}

.cloud-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.cloud-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cloud-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cloud-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.cloud-table tr:hover td {
  background: #f8fafc;
}

.badge-doc {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-quotation {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-invoice {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.cloud-path-cell {
  font-family: monospace;
  font-size: 11px;
  color: #64748b;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-cloud-act {
  border: none;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-cloud-load {
  background: #0284c7;
  color: #ffffff;
}

.btn-cloud-load:hover {
  background: #0369a1;
}

.btn-cloud-pdf {
  background: #f59e0b;
  color: #ffffff;
}

.btn-cloud-pdf:hover {
  background: #d97706;
}

.btn-cloud-del {
  background: #ef4444;
  color: #ffffff;
}

.btn-cloud-del:hover {
  background: #dc2626;
}

.doc-actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.action-btn {
  border: none;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.action-load {
  background: #0284c7;
  color: #ffffff;
}

.action-load:hover {
  background: #0369a1;
}

.action-pdf {
  background: #f59e0b;
  color: #ffffff;
}

.action-pdf:hover {
  background: #d97706;
}

.action-link {
  background: #0078D4;
  color: #ffffff;
}

.action-link:hover {
  background: #005a9e;
}

.action-delete {
  background: #ef4444;
  color: #ffffff;
  padding: 4px 6px;
  font-size: 12px;
}

.action-delete:hover {
  background: #dc2626;
}

.modal-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-hint {
  font-size: 11.5px;
  color: #64748b;
}

.btn-close-modal {
  background: #64748b;
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  cursor: pointer;
}

.btn-close-modal:hover {
  background: #475569;
}

/* ========= MOBILE RESPONSIVE STYLES ========= */
@media (max-width: 768px) {
  body {
    background: #f1f5f9;
  }
  .container {
    margin: 8px auto;
    padding: 16px;
    border-radius: 8px;
    box-shadow: none;
  }
  .doc-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
  }
  .doc-header-top {
    padding: 16px;
    gap: 12px;
  }
  .doc-logo-center {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .header-logo {
    max-width: 250px;
    max-height: 48px;
  }
  .doc-header-row {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .doc-left {
    width: 100%;
    text-align: center;
  }
  .doc-left h2 {
    font-size: 18px;
    white-space: nowrap;
  }
  .company-info-row {
    justify-content: center;
    text-align: center;
  }
  .company-address-lines {
    text-align: center;
  }
  .doc-right {
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .doc-type-selector {
    font-size: 24px;
    text-align: center;
  }
  .doc-right p {
    justify-content: center;
    gap: 8px;
  }
  .doc-right input {
    text-align: center !important;
  }
  .doc-header-bottom {
    flex-direction: column;
    gap: 16px;
    margin-top: 14px;
  }
  .prepared-for,
  .project-info {
    width: 100%;
    max-width: 100%;
    text-align: left;
  }
  .input-client,
  .input-project,
  .input-id,
  .input-phone,
  .input-email,
  .input-company-address,
  .input-date {
    width: 100% !important;
    text-align: left;
  }
  .project-info textarea {
    text-align: left;
  }
  .system-title {
    font-size: 14px;
  }
  table.main-table {
    min-width: 820px;
  }
  .validity-tag {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .validity-tag input {
    width: 100% !important;
  }
  .terms-box {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .signature-grid {
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 10px 0;
  }
  .sig-block {
    width: 100%;
    max-width: 260px;
  }
  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .toolbar .btn {
    width: 100%;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .toolbar {
    grid-template-columns: 1fr;
  }
}

/* ========= PRINT STYLES ========= */
@media print {
  body {
    background: #ffffff;
    color: #000000;
  }
  .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }
  .toolbar,
  .col-action,
  th.col-action,
  .btn-add,
  .btn-del,
  .btn-del-section,
  .toast-msg,
  .modal-overlay {
    display: none !important;
  }
  .doc-header input,
  .doc-header textarea,
  .doc-header select {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
  }
  .table-responsive {
    border: none;
    overflow: visible;
  }
  table.main-table {
    page-break-inside: auto;
  }
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
}
