/* HENDAR V89 — corporate document lifecycle, RTL-first and responsive. */

#recordForm.hcd-v89-official-form,
#recordForm.hcd-v89-correspondence-form{
  --hcd-border:#cbd9e5;
  --hcd-ink:#102a43;
  --hcd-muted:#62778b;
  --hcd-teal:#0f766e;
}

#recordForm .hcd-v89-fields{
  min-inline-size:0;
  margin:4px 0;
  padding:16px;
  border:1px solid var(--hcd-border);
  border-radius:18px;
  background:linear-gradient(145deg,#f8fffe 0%,#fff 66%);
}

#recordForm .hcd-v89-fields.hidden,
#recordForm .hcd-v89-correspondence-note.hidden{
  display:none!important;
}

#recordForm .hcd-v89-fields legend{
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:6px 12px;
  max-inline-size:100%;
  padding:0 8px;
  color:var(--hcd-ink);
}

#recordForm .hcd-v89-fields legend span{font-weight:800}
#recordForm .hcd-v89-fields legend small{color:var(--hcd-muted);font-size:.76rem;font-weight:600}

#recordForm .hcd-v89-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

#recordForm .hcd-v89-grid label{
  min-inline-size:0;
  margin:0;
}

#recordForm .hcd-v89-grid input,
#recordForm .hcd-v89-grid select{
  inline-size:100%;
  max-inline-size:100%;
}

#recordForm .hcd-v89-computed{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:4px 10px;
  margin-block-start:14px;
  padding:11px 13px;
  border:1px solid #d8e5e9;
  border-radius:14px;
  background:#f7fbfc;
}

#recordForm .hcd-v89-computed>span{color:var(--hcd-muted);font-size:.78rem;font-weight:700}
#recordForm .hcd-v89-computed>small{grid-column:1/-1;color:var(--hcd-muted);line-height:1.55}

.hcd-status{
  justify-self:start;
  display:inline-flex;
  align-items:center;
  min-block-size:30px;
  max-inline-size:100%;
  padding:4px 11px;
  border:1px solid currentColor;
  border-radius:999px;
  font-size:.8rem;
  font-weight:800;
  line-height:1.35;
  white-space:normal;
}

.hcd-status--active,.hcd-status--effective-approved{color:#166534;background:#ecfdf3;border-color:#86d7a2}
.hcd-status--expiring{color:#854d0e;background:#fffbeb;border-color:#f7cf64}
.hcd-status--expired{color:#b42318;background:#fff1f0;border-color:#f4a49c}
.hcd-status--renewing,.hcd-status--under-review{color:#1d4ed8;background:#eff6ff;border-color:#93b8fb}
.hcd-status--suspended{color:#9a4a0a;background:#fff7ed;border-color:#f7bc77}
.hcd-status--cancelled,.hcd-status--archived,.hcd-status--draft{color:#596579;background:#f5f7fa;border-color:#cbd5e1}
.hcd-status--replaced,.hcd-status--closed{color:#475569;background:#f1f5f9;border-color:#aebbc9}
.hcd-status--approved{color:#166534;background:#ecfdf3;border-color:#86d7a2}
.hcd-status--outgoing{color:#4338ca;background:#eef2ff;border-color:#a5b4fc}
.hcd-status--incoming{color:#0e7490;background:#ecfeff;border-color:#67d9e6}

#recordForm .hcd-v89-correspondence-note{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px 12px;
  padding:12px 14px;
  border-inline-start:4px solid #6366f1;
  border-radius:13px;
  color:var(--hcd-ink);
  background:#f5f6ff;
}

#recordForm .hcd-v89-correspondence-note span{color:var(--hcd-muted);font-size:.82rem}

#recordForm.hcd-v89-official-form #recordSaveButton,
#recordForm.hcd-v89-correspondence-form #recordSaveButton{
  box-shadow:0 8px 18px rgba(15,118,110,.16);
}

#recordForm #recordSubmitButton[hidden]{display:none!important}

@media(max-width:720px){
  #recordForm .hcd-v89-fields{padding:13px;border-radius:15px}
  #recordForm .hcd-v89-grid{grid-template-columns:minmax(0,1fr);gap:10px}
  #recordForm .hcd-v89-computed{grid-template-columns:minmax(0,1fr);align-items:start}
  #recordForm .hcd-v89-computed .hcd-status{justify-self:stretch;justify-content:center}
}

@media(forced-colors:active){
  .hcd-status{forced-color-adjust:auto}
  #recordForm .hcd-v89-fields{border:1px solid CanvasText}
}
