/* ==========================================================================
   4. TEMPLATE LAYOUT STYLES (Modern Slate, Minimal Classic, Sidebar Split)
   ========================================================================== */

/* --- COMMON RULES FOR SINGLE COLUMN TEMPLATES (Modern & Minimal) --- */
.sheet.template-modern,
.sheet.template-minimal {
  padding: 68px 48px 115px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto auto auto 1fr;
  gap: 8px 0;
  align-content: stretch;
}

.sheet.template-modern .sheet-sidebar-wrap,
.sheet.template-modern .sheet-main-wrap,
.sheet.template-minimal .sheet-sidebar-wrap,
.sheet.template-minimal .sheet-main-wrap {
  display: contents;
}

.sheet.template-modern .seller-block,
.sheet.template-minimal .seller-block {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 16px;
}

.sheet.template-modern .invoice-title,
.sheet.template-minimal .invoice-title {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  text-align: right;
  margin-bottom: 16px;
}

.sheet.template-modern .meta,
.sheet.template-minimal .meta,
.sheet.template-modern .quotation-intro,
.sheet.template-minimal .quotation-intro,
.sheet.template-modern .invoice-table,
.sheet.template-minimal .invoice-table,
.sheet.template-modern .summary-area,
.sheet.template-minimal .summary-area,
.sheet.template-modern .quotation-closing,
.sheet.template-minimal .quotation-closing,
.sheet.template-modern .main-notes,
.sheet.template-minimal .main-notes,
.sheet.template-modern .running-header,
.sheet.template-minimal .running-header,
.sheet.template-modern .page-2-content-slot,
.sheet.template-minimal .page-2-content-slot,
.sheet.template-modern .footer,
.sheet.template-minimal .footer {
  grid-column: 1 / -1;
}

.sheet.template-modern .signature-wrap,
.sheet.template-minimal .signature-wrap {
  grid-column: 1 / -1;
  align-self: end !important;
  margin-top: auto !important;
  margin-bottom: 8px !important;
}

.sheet.template-modern .bill-to-sec,
.sheet.template-minimal .bill-to-sec,
.sheet.template-modern .payment-sec,
.sheet.template-minimal .payment-sec,
.sheet.template-modern .sidebar-notes,
.sheet.template-minimal .sidebar-notes,
.sheet.template-modern .sidebar-thankyou,
.sheet.template-minimal .sidebar-thankyou {
  display: none !important;
}


/* --- TEMPLATE 2: MINIMAL CLASSIC SPECIFIC OVERRIDES --- */
.sheet.template-minimal {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1e293b;
}

.sheet.template-minimal .seller-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0f172a;
}

.sheet.template-minimal .invoice-title h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #0f172a;
  margin: 0 0 3px;
}

.sheet.template-minimal .invoice-title .status {
  display: none;
}

/* Full Width Light Gray "INVOICE TO" Box */
.sheet.template-minimal .meta {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 16px 20px;
  margin-top: 73px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border: none;
}

.sheet.template-minimal .meta h3 {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f172a;
  margin-bottom: 4px;
}

/* Table with Solid Black Lines Top & Bottom */
.sheet.template-minimal .invoice-table {
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
  margin-bottom: 16px;
}

.sheet.template-minimal .invoice-table th {
  background: transparent;
  color: #0f172a;
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #cbd5e1;
  padding: 7px 8px;
}

.sheet.template-minimal .invoice-table td {
  border-bottom: 1px solid #f1f5f9;
  padding: 8px 8px;
}

.sheet.template-minimal .sum-row.total {
  border-top: 2px solid #0f172a;
  color: #0f172a;
  font-size: 14px;
}


/* --- TEMPLATE 3: SIDEBAR SPLIT (2-Column Layout) --- */
.sheet.template-sidebar {
  padding: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 1123px;
  height: 1123px;
  background: #ffffff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1e293b;
}

/* Left Sidebar Column (Gray background) */
.sheet.template-sidebar .sheet-sidebar-wrap {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 68px 26px 64px 28px;
  display: flex;
  flex-direction: column;
  gap: 110px;
  height: 100%;
  box-sizing: border-box;
}

.sheet.template-sidebar .seller-block {
  margin-bottom: 0;
}

.sheet.template-sidebar .sheet-sidebar-wrap .seller-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f172a;
  margin-top: 8px;
  margin-bottom: 4px;
}

.sheet.template-sidebar .sheet-sidebar-wrap .seller-detail {
  font-size: 11px;
  color: #475569;
  line-height: 1.6;
}

.sheet.template-sidebar .bill-to-sec,
.sheet.template-sidebar .payment-sec,
.sheet.template-sidebar .notes,
.sheet.template-sidebar .sidebar-section.questions-sec {
  border-top: 1px solid #e2e8f0;
  margin-top: 0;
  padding-top: 18px;
}

.sheet.template-sidebar .bill-to-sec h4,
.sheet.template-sidebar .payment-sec h4,
.sheet.template-sidebar .notes h3,
.sheet.template-sidebar .sidebar-section.questions-sec h4 {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f172a;
  margin: 0 0 8px;
}

.sheet.template-sidebar .client-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.sheet.template-sidebar .client-detail {
  font-size: 11px;
  color: #475569;
  line-height: 1.6;
}

.sheet.template-sidebar .sidebar-notes p {
  font-size: 11px;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

.sheet.template-sidebar .sidebar-section.questions-sec {
  font-size: 11px;
  color: #475569;
  line-height: 1.6;
}

.sheet.template-sidebar .sidebar-section.questions-sec strong {
  color: #0f172a;
  font-weight: 700;
}

.sheet.template-sidebar .sheet-main-wrap .meta .bill-to-box,
.sheet.template-sidebar .sheet-main-wrap .main-notes {
  display: none;
}

.sheet.template-sidebar .sheet-main-wrap .meta {
  justify-content: flex-end;
  margin-top: 55px;
  margin-bottom: 12px;
  border-top: none;
  padding: 0;
}

.sheet.template-sidebar .sidebar-thankyou {
  margin-top: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #334155;
  text-transform: uppercase;
  padding-top: 14px;
  border-top: 1px solid #cbd5e1;
  height: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
}

/* Right Main Column (White background) */
.sheet.template-sidebar .sheet-main-wrap {
  padding: 68px 36px 64px 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.sheet.template-sidebar .invoice-title {
  text-align: right;
  margin-bottom: 2px;
}

.sheet.template-sidebar .invoice-title h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #0f172a;
  margin: 0 0 2px;
}

.sheet.template-sidebar .invoice-table {
  border-top: 2px solid #000000;
  border-bottom: 2px solid #000000;
  margin-top: 4px;
}

.sheet.template-sidebar .invoice-table th {
  background: transparent;
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 8px;
  border-bottom: 1px solid #cbd5e1;
}

.sheet.template-sidebar .invoice-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
}

.sheet.template-sidebar .sum-row.total {
  border-top: 2px solid #000000;
  border-bottom: 2px solid #000000;
  padding: 6px 0;
  margin-top: 4px;
  font-size: 14.5px;
  color: #000000;
  font-weight: 800;
}

/* Sidebar Split Specific Footer & Signature Rules */
.sheet.template-sidebar .footer {
  display: none !important;
}

.sheet.template-modern .sidebar-right-footer,
.sheet.template-minimal .sidebar-right-footer {
  display: none !important;
}

.sheet.template-sidebar .signature-wrap {
  margin-top: auto !important;
  margin-bottom: 8px;
  align-self: flex-end;
  padding-top: 4px;
}

.sheet.template-sidebar .sidebar-right-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 3px;
  border-top: 1px solid #cbd5e1;
  padding-top: 14px;
  margin-top: auto !important;
  font-size: 9.5px;
  color: #4b5563;
  height: 48px;
  box-sizing: border-box;
}

.sheet.template-sidebar .sf-line1 {
  color: #374151;
  font-size: 9.5px;
}

.sheet.template-sidebar .sf-line1 strong {
  color: #111827;
  font-weight: 700;
}

.sheet.template-sidebar .sf-line2 {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #4b5563;
  font-size: 9.5px;
}