@font-face {
  font-family: Vazir;
  src: url("/brand/nhz-home-regular.ttf") format("truetype");
  font-display: swap;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f5f6f0;
  color: #183d30;
  font-family: Vazir, Tahoma, sans-serif;
  line-height: 1.9;
}
a {
  color: inherit;
}
button,
input,
summary {
  font: inherit;
}
button,
a,
input,
summary {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #a77615;
}
header,
main,
footer {
  max-width: 1160px;
  margin: auto;
  padding: 24px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d7e0d4;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 24px;
  font-weight: 800;
}
.brand small {
  display: block;
  font-size: 12px;
  font-weight: 400;
}
.brand-icon {
  display: grid;
  place-items: center;
  background: #e2ead6;
  border-radius: 18px;
  width: 58px;
  height: 58px;
}
.stage,
.eyebrow {
  font-size: 12px;
  color: #576948;
}
.stage {
  border: 1px solid #c7d4bd;
  padding: 4px 12px;
  border-radius: 24px;
}
.hero {
  padding: 34px 0 18px;
  max-width: 760px;
}
.hero h1 {
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.6;
  letter-spacing: -1px;
  margin: 12px 0;
}
.hero > p:last-child {
  max-width: 650px;
  color: #4e6256;
}
.eyebrow {
  font-weight: 700;
  margin: 0;
}
.card {
  padding: 26px;
  border: 1px solid #d9e1d2;
  background: #fffefa;
  border-radius: 22px;
  min-width: 0;
}
.card h2 {
  margin: 5px 0 12px;
  font-size: 22px;
}
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.workspace-head h2 {
  margin: 0;
}
.notice {
  background: #ecf0e1;
  border: 1px solid #cfdbc0;
  border-radius: 14px;
  padding: 16px;
  overflow-wrap: anywhere;
}
.hint {
  font-size: 13px;
  color: #566657;
}
.status {
  min-height: 28px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.status[data-error="true"] {
  color: #9c2f23;
}
.records {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.record {
  border: 1px solid #dfe6da;
  border-radius: 14px;
  padding: 16px;
  overflow-wrap: anywhere;
}
.record h3 {
  font-size: 15px;
  margin: 0;
}
.record small {
  display: block;
  color: #596c5b;
}
.record .state {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  background: #edf2e6;
  border-radius: 8px;
  margin-top: 8px;
}
.action {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 0;
}
button {
  cursor: pointer;
  border: 1px solid #c4d3ba;
  border-radius: 12px;
  background: #fffefa;
  padding: 11px 18px;
  min-height: 46px;
  color: #183d30;
}
button.primary {
  background: #1c4938;
  border-color: #1c4938;
  color: #fff;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
label {
  display: block;
  font-size: 14px;
  margin: 14px 0 6px;
}
input:not([type="checkbox"]) {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border: 1px solid #b3c5ad;
  border-radius: 10px;
  padding: 12px;
  display: block;
  min-height: 46px;
}
form button {
  margin-top: 18px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 700px;
}
.check input {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 6px;
}
details {
  margin-top: 20px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
}
#loginPanel {
  max-width: 650px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #64705e;
  font-size: 12px;
  margin-top: 35px;
  border-top: 1px solid #d7e0d4;
}
.skip {
  position: absolute;
  top: -100px;
  right: 20px;
  background: white;
  padding: 12px;
  z-index: 10;
}
.skip:focus {
  top: 10px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 650px) {
  header,
  main,
  footer {
    padding: 18px;
  }
  .stage {
    font-size: 10px;
    max-width: 135px;
    text-align: center;
  }
  .brand {
    font-size: 20px;
  }
  .brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .hero {
    padding-top: 24px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero > p:last-child {
    font-size: 14px;
  }
  footer {
    flex-direction: column;
    gap: 4px;
  }
  .workspace-head {
    align-items: flex-start;
  }
  .workspace-head h2 {
    font-size: 20px;
  }
}

.workspace-request {
  margin-block: 20px;
  overflow-wrap: anywhere;
}
.workspace-request:focus {
  outline: 3px solid #a77615;
  outline-offset: 4px;
}
.request-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.request-facts dt {
  font-weight: 700;
}
.request-facts dd {
  margin: 0;
}
.request-description,
#workspaceRequestMessages p {
  white-space: pre-wrap;
}
#workspaceRequestMessages {
  max-height: 420px;
  overflow: auto;
  padding: 4px;
}

#workspaceMessageForm {
  margin-block: 20px;
  border-top: 1px solid #d7e0d4;
  padding-block-start: 16px;
}
#workspaceMessageBody {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  font: inherit;
  border: 1px solid #819879;
  border-radius: 10px;
  resize: vertical;
}

.history-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 12px;
}

#workspaceFarms {
  margin-block: 20px;
  overflow-wrap: anywhere;
}
#workspaceFarms:focus {
  outline: 3px solid #a77615;
  outline-offset: 4px;
}
#workspaceFarmsRows {
  max-height: 540px;
  overflow: auto;
  padding: 4px;
}

#workspaceFarmCreateForm,
#workspaceFarmEditForm {
  margin-block: 24px;
  padding-block-start: 18px;
  border-top: 1px solid #d7e0d4;
}
#workspaceFarmAddress,
#workspaceFarmEditAddress {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  font: inherit;
  border: 1px solid #819879;
  border-radius: 10px;
  resize: vertical;
}

#workspaceFarmEditForm:focus {
  outline: 3px solid #a77615;
  outline-offset: 4px;
}

#workspaceFieldForm { margin-top: 18px; display: grid; gap: 9px; }
#workspaceFieldForm[hidden] { display: none; }
#workspaceFieldForm textarea, #workspaceFieldForm select { width: 100%; box-sizing: border-box; font: inherit; color: inherit; padding: 12px; background: #fff; border: 1px solid #b7c3b4; border-radius: 10px; }
#workspaceFieldForm textarea { resize: vertical; }
#workspaceFieldForm:focus { outline: 3px solid #a77615; outline-offset: 4px; }

#workspaceFarmArchiveForm { margin-top: 18px; display: grid; gap: 9px; }
#workspaceFarmArchiveForm[hidden] { display: none; }
#workspaceFarmArchiveForm:focus { outline: 3px solid #a77615; outline-offset: 4px; }

.coordination {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #b7c3b4;
  border-radius: 14px;
}
.coordination:focus {
  outline: 3px solid #a77615;
  outline-offset: 4px;
}

.company-operator-entry { margin-bottom: 20px; }
.company-operator-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border: 1px solid #b7c3b4;
  border-radius: 20px;
  color: #183d30;
  background: #fffefa;
  font: inherit;
  overflow: auto;
  overflow-wrap: anywhere;
}
.company-operator-dialog:not([open]) { display: none; }
.company-operator-dialog::backdrop { background: rgb(14 36 27 / 65%); }
.company-operator-dialog h2 { font-size: 22px; margin: 0; }
.company-operator-dialog .record { min-width: 0; }

/* Company workspace (the only mode since v336; Keshtyar parts were removed).
   The server marks <body>. */
body[data-workspace-mode="company"] .stage {
  display: none !important;
}
body:not([data-workspace-mode="company"]) .company-only {
  display: none !important;
}
body[data-workspace-mode="company"] #passwordLogin > summary {
  display: none;
}
/* Farmers see their login and cases first; the company colleague entry
   (field staff with a company-issued code) stays reachable below. */
body[data-workspace-mode="company"] main {
  display: flex;
  flex-direction: column;
}
body[data-workspace-mode="company"] main > .company-operator-entry {
  order: 1;
  margin-top: 20px;
}
/* NHZ-31 G-D: company logo in company-only mode (set by the server). */
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
}
/* v332 phase 1: /customer/cases — the case pages inside the one farmer app
   «هیرکان زمین». Farms live in «حساب من» and login in /customer, so those
   duplicates and the long introduction are not shown here. */
body[data-app-shell="customer"]
  :is(.hero, #loginPanel, #workspaceFarmsOpen, #workspaceFarms,
    .company-operator-entry, #customerView .action[href="/customer"]) {
  display: none !important;
}
body[data-app-shell="customer"][data-colleague="1"] #main > .company-operator-entry {
  display: block !important;
}
body[data-app-shell="customer"] {
  padding-bottom: 84px;
}
body[data-app-shell="customer"] header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #183d31;
  color: #fff;
  border-bottom: 0;
  max-width: none;
  padding: 12px max(16px, calc((100% - 1112px) / 2));
}
body[data-app-shell="customer"] .brand {
  font-size: 18px;
}
body[data-app-shell="customer"] .brand small {
  color: #cfe0d6;
}
.app-back {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}
/* v340: the same bottom bar as /customer (#mobileNav in customer.css): five
   tabs, icon above label, same colours, sizes and unread badge. */
.app-tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: #fffffff5;
  backdrop-filter: blur(16px);
  border-top: 1px solid #dce4d5;
  box-shadow: 0 -5px 25px #183d3107;
  padding: 9px max(8px, calc((100% - 760px) / 2)) calc(9px + env(safe-area-inset-bottom, 0px));
  min-height: 72px;
  box-sizing: border-box;
}
.app-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  min-height: 51px;
  padding: 2px 1px;
  border-radius: 12px;
  color: #62735a;
  font-size: 10px;
  line-height: 1.6;
  text-decoration: none;
}
.app-tabbar a[aria-current="page"] {
  color: #183d31;
  font-weight: 700;
  background: #f0f5e6;
}
.app-tabbar .tab-icon {
  position: relative;
  display: inline-flex;
  height: 24px;
}
.app-tabbar .app-icon {
  width: 23px;
  height: 23px;
}
.app-tabbar .unread-count {
  position: absolute;
  left: -10px;
  top: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 12px;
  background: #deeb9b;
  color: #193b30;
  font-size: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}
.app-tabbar .unread-count[hidden] {
  display: none;
}
@media (min-width: 761px) {
  .app-tabbar a {
    font-size: 12px;
  }
}
@media print {
  .app-tabbar,
  .app-back {
    display: none !important;
  }
}
body[data-app-shell="customer"] main {
  padding-top: 12px;
}
body[data-app-shell="customer"] #status:empty {
  display: none;
}
/* v358: legal fine print in case panels stays collapsed under one short hint. */
details.fine-print {
  margin-top: 4px;
  font-size: 13px;
  color: #566657;
}
details.fine-print > summary {
  min-height: 44px;
  padding: 10px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
details.fine-print > p {
  margin: 4px 0 8px;
}
