/* NHZ v341 — the look of /nhz-inputs.js (calendar table, grouped amounts, unit menus). */
.nhz-date {
  display: flex;
  align-items: stretch;
  gap: 6px;
  position: relative;
}
.nhz-date input.nhz-date-input,
.nhz-date input.nhz-date-input[readonly] {
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  color: #193b30;
  cursor: pointer;
  caret-color: transparent;
}
.nhz-date.nhz-disabled input.nhz-date-input {
  background: #f0f4ed;
  cursor: not-allowed;
}
.nhz-date-open,
.nhz-date-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #b9cfb4;
  border-radius: 8px;
  background: #eef5e6;
  color: #183d31;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.nhz-date-open svg,
.nhz-date-pick svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.nhz-date-clear {
  flex: 0 0 44px;
  min-height: 44px;
  border: 1px solid #dce5da;
  border-radius: 8px;
  background: #f5f7f1;
  color: #47584c;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.nhz-date-day,
.nhz-money-hint {
  display: block;
  min-height: 1.6em;
  margin-top: 4px;
  color: #3f6b4c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
}
.nhz-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  grid-column: 1 / -1;
}
.nhz-money {
  letter-spacing: 0.02em;
}

/* the month table; public pages (/book-service, /field) keep content-box
   sizing, so the dialog sets its own box model and never grows past the screen */
dialog.nhz-cal,
dialog.nhz-cal *,
.nhz-date,
.nhz-date *,
.nhz-date-row,
.nhz-date-row * {
  box-sizing: border-box;
}
dialog.nhz-cal {
  max-width: calc(100% - 24px);
  width: 360px;
  max-height: calc(100% - 24px);
  padding: 14px 14px 12px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #193b30;
  box-shadow: 0 18px 50px rgba(18, 48, 36, 0.28);
  font-family: inherit;
  direction: rtl;
}
dialog.nhz-cal::backdrop {
  background: rgba(16, 36, 28, 0.45);
}
.nhz-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.nhz-cal-title {
  font-size: 16px;
}
.nhz-cal-nav {
  width: 44px;
  height: 44px;
  border: 1px solid #dce5da;
  border-radius: 10px;
  background: #f5f7f1;
  color: #183d31;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.nhz-cal-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.nhz-cal-week,
.nhz-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.nhz-cal-week span {
  padding: 4px 0;
  color: #586b60;
  font-size: 12px;
  font-weight: 700;
}
.nhz-cal-day {
  min-width: 0;
  padding: 0;
  aspect-ratio: 1 / 1;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f5f7f1;
  color: #193b30;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.nhz-cal-day:hover:not(:disabled) {
  border-color: #9fbe95;
}
.nhz-cal-day:disabled {
  background: transparent;
  color: #b7c2b9;
  cursor: default;
}
.nhz-cal-fri,
.nhz-cal-week .nhz-cal-fri {
  color: #b23a2b;
}
.nhz-cal-day.nhz-cal-fri:disabled {
  color: #e2b8b2;
}
.nhz-cal-today {
  border-color: #87601a;
  font-weight: 700;
}
.nhz-cal-selected,
.nhz-cal-selected.nhz-cal-fri {
  background: #183d31;
  color: #fff;
  font-weight: 700;
}
.nhz-cal-day:focus-visible,
.nhz-cal-nav:focus-visible,
.nhz-cal-act:focus-visible {
  outline: 3px solid #926b14;
  outline-offset: 2px;
}
.nhz-cal-note {
  min-height: 1.8em;
  margin: 10px 2px 8px;
  color: #3f6b4c;
  font-size: 13px;
  font-weight: 700;
}
.nhz-cal-foot {
  display: flex;
  gap: 8px;
}
.nhz-cal-act {
  flex: 1 1 0;
  min-height: 44px;
  border: 1px solid #cddbc9;
  border-radius: 10px;
  background: #fff;
  color: #183d31;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.nhz-cal-act:disabled {
  opacity: 0.45;
  cursor: default;
}
.nhz-cal-close {
  background: #183d31;
  color: #fff;
  border-color: #183d31;
}
@media (max-width: 520px) {
  dialog.nhz-cal {
    margin: auto auto 0;
    /* % of the viewport box, not vw: ui-prefs.js may zoom the page (bigger text)
       and a zoomed vw width would spill past the screen edges */
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

/* unit menus */
.nhz-unit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nhz-unit > input[data-nhz-unit-num] {
  flex: 1 1 120px;
  min-width: 0;
}
.nhz-unit > select[data-nhz-unit-select] {
  flex: 1 1 140px;
  min-width: 0;
}
.nhz-unit > input[data-nhz-unit-other] {
  flex: 1 1 100%;
}
.nhz-unit.nhz-unit-only > select[data-nhz-unit-select] {
  flex-basis: 100%;
}

/* v344 — staff panel: Gregorian date field + «تقویم شمسی» button */
.nhz-iso input.nhz-iso-input {
  flex: 1 1 auto;
  min-width: 0;
}
/* the Jalali table replaces the browser's Gregorian picker; its icon only took the field's width */
.nhz-iso input.nhz-iso-input::-webkit-calendar-picker-indicator {
  display: none;
}
.nhz-iso input.nhz-iso-input::-webkit-datetime-edit {
  padding: 0;
}
.nhz-iso .nhz-date-open {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 10px;
  font-size: 12px;
}
input.nhz-money[readonly] {
  background: #f5f7f1;
}

/* v345: the staff panel's in-page form that replaced window.prompt() (#askModal). */
.nhz-ask-backdrop {
  z-index: 95;
}
.nhz-ask .modal-header p {
  font-size: 10px;
  line-height: 1.9;
  white-space: pre-line;
}
.nhz-ask .form-grid.one-column {
  gap: 14px;
  margin-bottom: 14px;
}
.nhz-ask .field > span {
  font-size: 11px;
}
.nhz-ask .nhz-ask-hint {
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted, #6f7e78);
}
.nhz-ask .form-message {
  margin-bottom: 12px;
  font-size: 11px;
}
.nhz-ask input.nhz-decimal,
.nhz-ask .nhz-ask-code input,
.nhz-ask .nhz-ask-password input {
  direction: ltr;
  text-align: left;
}
.nhz-ask-copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.nhz-ask-copy-row input {
  flex: 1;
  min-width: 0;
  font-family: Consolas, monospace;
  font-size: 12px;
  direction: ltr;
  text-align: left;
}
.nhz-ask-copy-row .nhz-ask-copy-button {
  flex: none;
  min-height: 43px;
}
@media (max-width: 480px) {
  .nhz-ask-copy-row {
    flex-direction: column;
  }
}

/* v348: the question / notice dialog (NHZInputs.confirm, NHZInputs.tell) that
   replaces the browser's confirm and alert boxes */
dialog.nhz-ask,
dialog.nhz-ask * {
  box-sizing: border-box;
}
dialog.nhz-ask {
  width: 400px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 18px 18px 14px;
  border: 0;
  border-top: 4px solid #2f7d5b;
  border-radius: 16px;
  background: #fff;
  color: #193b30;
  box-shadow: 0 18px 50px rgba(18, 48, 36, 0.28);
  font-family: inherit;
  direction: rtl;
  text-align: right;
}
dialog.nhz-ask.nhz-ask-is-danger,
dialog.nhz-ask.nhz-ask-is-error {
  border-top-color: #c0392b;
}
dialog.nhz-ask::backdrop {
  background: rgba(16, 36, 28, 0.45);
}
dialog.nhz-ask [hidden] {
  display: none !important;
}
.nhz-ask-title {
  display: block;
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.nhz-ask-text {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.9;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.nhz-ask-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.nhz-ask-ok,
.nhz-ask-no {
  min-height: 44px;
  min-width: 96px;
  padding: 8px 16px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nhz-ask-ok {
  border: 1px solid #2f7d5b;
  background: #2f7d5b;
  color: #fff;
}
.nhz-ask-ok.nhz-ask-danger {
  border-color: #c0392b;
  background: #c0392b;
}
.nhz-ask-no {
  border: 1px solid #cfdcd5;
  background: #fff;
  color: #193b30;
}
.nhz-ask-ok:focus-visible,
.nhz-ask-no:focus-visible {
  outline: 3px solid #f3b33d;
  outline-offset: 2px;
}
