/* =====================================================================
   C.I.C. - Crownhill International College
   Brand stylesheet for finance documents and checkout
   Colours: Teal #0B4D4A, Gold #D4A820, Cream #F5F1E8, Ink #1A2421
   Fonts: Georgia (headings), Arial (body)
   ===================================================================== */

:root {
  --cic-teal:  #0B4D4A;
  --cic-gold:  #D4A820;
  --cic-cream: #F5F1E8;
  --cic-ink:   #1A2421;
  --cic-teal-soft: #0f5f5b;
  --cic-line:  #d8d2c4;
  --cic-grey:  #6b6f6c;
  --cic-shade: #eef0ec;   /* light grey for shaded fiscal fields */
  --cic-ok:    #1f7a4d;
  --cic-warn:  #a6402a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--cic-ink);
  background: var(--cic-cream);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--cic-teal);
  margin: 0 0 .4em;
  font-weight: 700;
}

.cic-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: #ffffff;
  padding: 18mm 16mm;
  position: relative;
}

/* Header band */
.cic-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid var(--cic-teal);
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.cic-brandmark { display: flex; align-items: center; gap: 12px; }
.cic-logo-img { height: 72px; width: auto; display: block; }
.cic-logo {
  width: 54px; height: 54px; border-radius: 8px;
  background: var(--cic-teal); color: var(--cic-gold);
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-weight: 700; font-size: 20px;
  letter-spacing: 1px;
}
.cic-name { font-family: Georgia, serif; font-size: 18px; color: var(--cic-teal); font-weight: 700; }
.cic-tag  { font-size: 11px; color: var(--cic-grey); letter-spacing: .4px; }
.cic-doc-title { text-align: right; }
.cic-doc-title .k { font-family: Georgia, serif; font-size: 22px; color: var(--cic-ink); }
.cic-doc-title .n { font-size: 12px; color: var(--cic-grey); }

/* Meta grid */
.cic-meta { display: flex; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.cic-meta .block { flex: 1 1 200px; }
.cic-label { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--cic-gold); font-weight: 700; }
.cic-value { font-size: 13px; }

/* Tables */
.cic-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.cic-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  color: #fff; background: var(--cic-teal); padding: 8px 10px;
}
.cic-table td { padding: 8px 10px; border-bottom: 1px solid var(--cic-line); font-size: 13px; vertical-align: top; }
.cic-table .num { text-align: right; white-space: nowrap; }

/* Totals */
.cic-totals { width: 46%; margin-left: auto; }
.cic-totals .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.cic-totals .grand {
  border-top: 2px solid var(--cic-gold); margin-top: 6px; padding-top: 10px;
  font-family: Georgia, serif; font-size: 18px; color: var(--cic-teal); font-weight: 700;
}

/* Fiscal shaded field (Valor Liquido + IBS/CBS) */
.cic-shade { background: var(--cic-shade); }

/* Status chips */
.cic-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.cic-chip.paid    { background: #e4f2ea; color: var(--cic-ok); }
.cic-chip.due     { background: #fbeee9; color: var(--cic-warn); }
.cic-chip.pending { background: #fcf4dd; color: #8a6d13; }

/* Footer */
.cic-foot { margin-top: 26px; border-top: 1px solid var(--cic-line); padding-top: 12px; font-size: 11px; color: var(--cic-grey); }
.cic-legal { margin-top: 14px; border-top: 2px solid var(--cic-gold); padding-top: 10px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 10.5px; color: var(--cic-grey); }
.cic-legal .col b { color: var(--cic-teal); font-family: Georgia, serif; display: block; margin-bottom: 2px; }

/* Watermark for cancelled / substituted fiscal notes */
.cic-watermark {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-30deg);
  font-family: Georgia, serif; font-size: 96px; font-weight: 700;
  color: rgba(166, 64, 42, 0.14); letter-spacing: 8px; pointer-events: none; user-select: none;
}

/* Homologation banner */
.cic-homolog {
  text-align: center; background: #fcf4dd; color: #8a6d13;
  font-weight: 700; padding: 6px; font-size: 12px; letter-spacing: .5px; margin-bottom: 10px;
}

/* QR block */
.cic-qr { display: flex; align-items: center; gap: 14px; }
.cic-qr img, .cic-qr .qr-ph { width: 118px; height: 118px; }  /* min 1.52cm satisfied at print */
.cic-qr .qr-ph { border: 1px dashed var(--cic-line); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--cic-grey); text-align: center; }

@media print {
  body { background: #fff; }
  .cic-sheet { margin: 0; box-shadow: none; }
  @page { size: A4; margin: 0; }
}
