body {
  font-family: "Times New Roman", Times, serif;
}

.form-label small,
.text-en {
  font-style: italic;
  font-weight: 400;
  color: #555;
  display: block;
  font-size: 0.78rem;
}

.sheet {
  background: #fff;
  border: 1px solid #d8ddda;
  border-radius: 6px;
  padding: 18px 22px;
  max-width: 950px;
  margin: 0 auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.sheet-header img { width: 56px; height: auto; }
.sheet-header .company-name { font-weight: 700; text-transform: uppercase; font-size: 1rem; }
.sheet-header .company-addr { font-size: 0.85rem; color: #333; }

.form-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.35rem;
  margin: 10px 0 2px;
}
.form-subtitle {
  text-align: center;
  font-style: italic;
  color: #333;
  margin-bottom: 10px;
}

table.items-table th, table.items-table td {
  vertical-align: middle;
  font-size: 0.85rem;
}
table.items-table input {
  border: none;
  border-bottom: 1px dotted #999;
  width: 100%;
  background: transparent;
}
table.items-table input:focus {
  outline: none;
  border-bottom: 1px solid #2f6f4f;
}
.text-end-num { text-align: right !important; }

.totals-table td { font-weight: 700; }
.totals-table .grand td { font-size: 1.05rem; background: #f4f8f6; }

.sign-block { display: flex; text-align: center; margin-top: 14px; }
.sign-block > div { flex: 1; }
.sign-space { height: 60px; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .sheet { border: none; box-shadow: none; max-width: 100%; padding: 0; }
  table.items-table input, .sign-block input, .field-print {
    border-bottom: none !important;
  }
  @page { size: A4; margin: 12mm; }
}

/* ============================================================
   Exact grid replica of "Form ĐX.xlsx" (đề nghị phê thanh toán)
   Used by Details.cshtml (read-only / print) and _Form.cshtml
   (editable). Cell borders / merges / font sizes mirror the
   original spreadsheet exactly so the printed page matches it.
   ============================================================ */
.xls-page {
  background: #fff;
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px;
}
table.xls {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Times New Roman", Times, serif;
}
table.xls td {
  padding: 3px 5px;
  vertical-align: middle;
  overflow-wrap: break-word;
  font-size: 11pt;
  line-height: 1.25;
}
table.xls col.c1 { width: 5.25%; }
table.xls col.c2 { width: 7.18%; }
table.xls col.c3 { width: 11.47%; }
table.xls col.c4 { width: 35.22%; }
table.xls col.c5 { width: 5.66%; }
table.xls col.c6 { width: 7.32%; }
table.xls col.c7 { width: 12.29%; }
table.xls col.c8 { width: 15.61%; }

.xb  { border: 1px solid #000; }
.xnb { border: none; }
.xc  { text-align: center; }
.xr  { text-align: right; }
.xl  { text-align: left; }
.xbold { font-weight: 700; }
.f10 { font-size: 10pt; }
.f11 { font-size: 11pt; }
.f12 { font-size: 12pt; }
.f13 { font-size: 13pt; }
.f14 { font-size: 14pt; }
/* Gray shading — matches the 3 header/label fill shades used in Form ĐX.xlsx */
.xg1 {
    background-color: #D1D1D1;
}
/* "Người đề nghị" / "Khoa phòng ban" */
.xg2 {
    background-color: #D9D9D9;
}
/* "Hình Thức Thanh Toán", "Đơn vị thụ hưởng", "TK thụ hưởng", header bảng chi tiết */
.xg3 {
    background-color: #E8E8E8;
}
/* "Chi tiết thanh toán", "Địa điểm" */

table.xls .logo-cell { text-align: center; vertical-align: middle; }
table.xls .logo-cell img { width: 52px; height: auto; }

table.xls input, table.xls textarea {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  min-height: 1.2em;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-align: inherit;
  padding: 0;
  margin: 0;
  resize: none;
  display: block;
}
table.xls textarea { min-height: 3.2em; }
table.xls input:focus, table.xls textarea:focus {
  outline: 1px solid #2f6f4f;
  background: #fbfdfc;
}
table.xls input[type="checkbox"] { width: 13px; height: 13px; display: inline-block; vertical-align: middle; margin-right: 4px; }
table.xls input[type="number"] { text-align: inherit; }

.xls-blank-space { height: 58px; }

@media print {
  .xls-page { max-width: 100%; padding: 0; }
  table.xls input:focus, table.xls textarea:focus { outline: none; background: transparent; }
}
table.xls, table.xls td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
}
