@font-face
{
  font-family: 'BlissfulThinking';
  src: url('fonts/BlissfulThinking.otf') format('truetype');
}

@font-face
{
  font-family: 'Constantia';
  src: url('fonts/Constantia.ttf') format('truetype');
}

*
{
  box-sizing:border-box
}

body
{
  margin: 0;
  font-family: 'Constantia', sans-serif;
  font-size: 1.1rem;
  background: #0b0b0c;
  color: #e9e9ea;
}

h2
{
  font-family: 'BlissfulThinking',sans-serif;
  text-align: center;
}

h3
{
  font-family: 'BlissfulThinking',sans-serif;
}

small
{
  font-family: 'BlissfulThinking',sans-serif;
}

.help
{
  font-family: 'BlissfulThinking',sans-serif;
}

a.classe1:link, a.classe1:visited, a.classe1:active 
{
	text-decoration: underline;
	color: #be171d;
}

a.classe1:hover 
{
	text-decoration: underline overline;
	color: #ed1d24;
}

.app-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background:#111113;border-bottom:1px solid #1d1d20;position:sticky;top:0;z-index:10}

.header-brand{display:flex;flex-direction:column;gap:4px}

.subtitle
{
  font-size: 14px;
  color: #c9c9cf;
  font-family: 'BlissfulThinking', sans-serif;
}

.container
{
  max-width: 1300px;
  margin: 20px auto;
  padding: 0 16px;
}

.card
{
  background: #151518;
  border: 1px solid #25252a;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow:0 0 0 1px rgba(255,255,255,.02), 0 12px 40px rgba(0,0,0,.35);
}

.card-split
{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

.grid-2
{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:10px;
  font-size: 1rem;
}

.grid-3
{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:12px;
  margin-bottom:10px;
  font-size: 1rem;
}

.grid-4
{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin:10px 0;
  font-size: 1rem;
}

label
{
  font-family: 'BlissfulThinking', sans-serif;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #b8b8bc;
  gap: 6px
}

input, select, textarea, button
{
  background: #0f0f12;
  border:1px solid #2b2b30;
  border-radius:10px; color:#f1f1f3;
  padding:10px; 
  font-size:14px;
}

button
{
  font-family: 'BlissfulThinking', sans-serif;
}

input[type=number]
{
  width:12ch;
  font-family: 'Constantia', sans-serif;
}

fieldset
{
  font-size: 1rem;
}

button{cursor:pointer} button:hover{border-color:#ed1c24}

.inline-actions{margin-top:8px;display:flex;gap:8px;flex-wrap:wrap}

.help{font-size:12px;color:#ed1c24;margin-bottom:6px}

.table
{
  overflow: auto;
  border: 1px solid #26262b;
  border-radius: 10px;
  max-height: 320px;
  overflow-y: auto;
}

table
{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th
{
  position: sticky;
  top: 0;
  background: #1a1a1e;
  border-bottom: 1px solid #2a2a31;
  padding: 8px;
  text-align: left;
  font-family: 'BlissfulThinking', sans-serif;
}

tbody td
{
  border-bottom: 1px solid #26262b;
  padding: 8px;
  vertical-align: middle;
}

tbody tr:hover
{
  background: #15151a;
}

.totais
{
  align-self: center;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed #2b2b30;
  border-radius: 10px;
  color: #ed1c24;
  display: inline-block;
  flex-wrap: wrap;
  gap: 8px;
  font-family: 'BlissfulThinking', sans-serif;
}

.app-footer{padding:12px 20px;color:#9a9aa0;text-align:center}

.badge{display:inline-flex;align-items:center;gap:6px;background:#0f1b0f;border:1px solid #214021;color:#b8f1b8;border-radius:999px;padding:6px 10px;font-size:12px}

.warn{background:#2a1717;border-color:#ed1c24 ;color:#efb0b0}


@page { size: A4; margin: 4mm; }
@media print {
  html, body { height: auto; }
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-family: 'BlissfulThinking', sans-serif;
    font-size: 12pt;
    background: #fff;
    color:#000;
  }

  .app-header, .app-footer, #btn-open-json, #btn-save-json, #btn-print, #btn-export-pdf, #btn-clear-character,#btn-reset-catalogos, input[type=file], .inline-actions
  {
    display: none !important;
  }

  .card
  {
    border: 1px solid #000;
    box-shadow:none;
  }

}

.ficha
{
  column-count: 3; column-gap: 2mm; widows: 2; orphans: 2;
  font-family: 'BlissfulThinking', 'Constantia', sans-serif;
  background:#fff;
  color: #FFF;
  padding: 14px 20px;
}

.f-header
{
  width: 100%;
  font-family: 'BlissfulThinking', sans-serif;
  color: #000;
  gap: 16px;
  padding: 10px 10px;
}

.f-logo
{
  width: 160px;
  height: 80px;
  font-weight: bold;
  font-size: 12px;
}

.f-logo img
{
  width: 160px;
  height: auto;
}

.f-title
{
  font-size: 24px;
  font-weight: 700;
}

.f-meta
{
  gap: 8px
}

.f-box
{
  width: 100%;
}

.f-row
{
  display: grid;
  gap: 2px;
  margin: 6px 6px;
}

.f-section
{
  margin: 4px 4px;
  color: #000;
}

.f-table
{
  width: 100%;
  border-collapse: collapse;
  margin: 1px;
  background-color: #000;
  font-family: 'BlissfulThinking', sans-serif;
}

.f-table th, .f-table td
{
  border: 1px solid #000;
  padding: 4px 4px;
  font-size: 12px;
}

.f-tableatr
{
  width: 100%;
  margin: 2px;
  background-color: #000;
  font-family: 'BlissfulThinking', sans-serif;
  border: 1px solid #000;
}

.f-tableatr th,.f-tableatr td
{
  border: 1px solid #000;
  padding: 3px 3px;
  font-style: bold;
  font-size: 16px;
}

.f-tabledadcomb
{
  width: 100%;
  border-collapse: collapse;
  margin: 1px;
  background-color: #000;
  font-family: 'BlissfulThinking', sans-serif;
}

.f-tabledadcomb th, .f-tabledadcomb td
{
  border: 1px solid #000;
  padding: 4px 4px;
  font-size: 14px;
}

.f-notas
{
  min-height: 220px;
  font-size: 14px;
  margin: 8px;
}

.f-dasarea
{
  max-width: 10%;
  text-align: center;
}

.f-boxlistacar
{
  width: 100%;
  min-height: 440px;
}

.f-box-armas
{
  width: 100%;
  min-height: 150px;
}

.f-boxlistahab
{
  width: 100%;
  min-height: 900px;
}

.f-box-das
{
  width: 100%;
  min-height: 362px;
}

.f-boxnome
{
  margin: 10px;
  width: 100%;
  min-height: 88px;
  color: #000;
}

.f-boxdesc
{
  margin: 0px;
  padding: 20px 0px;
  width: 100%;
  min-height: 114px;
  color: #000;
}

.f-box-notas
{
  border: 1px solid #000;
  margin: 0px;
  padding: 2px 2px;
  width: 100%;
  min-height: 100px;
  color: #000;
}

.f-box-atr
{
  width: 100%;
  /*min-height: 325px;*/
}

.txtpdf
{
  background-color: #FFF;
  color: #000;
  text-align: center;
  font-family: 'Constantia', sans-serif;
  min-width: 30%;
}

.txtpdf2
{
  background-color: #FFF;
  color: #000;
  text-align: justify;
  font-family: 'Constantia', sans-serif;
  font-size: 14px;
}

.txtpdf3
{
  padding: 4px 4px;
  background-color: #FFF;
  color: #000;
  text-align: left;
  font-family: 'Constantia', sans-serif;
}

/* ===== DAS styles ===== */
.das-picker{ display:flex; gap:12px; align-items:center; margin:8px 0 12px; }
.das-picker select{ padding:6px 10px; border:1px solid #d1d5db; border-radius:8px; }
.das-visual{ margin:8px 0 12px; }
.das-tabela-wrap table{ width:100%; border-collapse: collapse; }
.das-tabela-wrap th, .das-tabela-wrap td{ border:1px solid #e5e7eb; padding:6px 8px; }

/* ===== DAS print mapping & select width ===== */
/*.das-picker .das-select{ min-width: 32ch; width: clamp(32ch, 40vw, 64ch); }*/
/* ===== PATCH v4_21: DAS print/position ===== */
@media screen { #das_img_invertida{ display:block; } #das_img_normal{ display:none; } }
@media print  { 
  #das_img_invertida{ display:none !important; } 
  #das_img_normal{ display:block !important; } 
  .das-tabela-wrap { display:none !important; } 
  .das-tabela-print-wrap { display:block !important; } 
  #das_section{ break-inside: avoid; page-break-inside: avoid; }
}