:root {
  --green: #035d7c;
  --green-dark: #034960;
  --green-soft: #e7f1f4;
}

.brand { gap: 12px; min-width: 270px; }
.brand-logo { width: 48px; height: 48px; flex: none; border-radius: 12px; object-fit: cover; }
.print-brand-logo { width: 35px; height: 35px; flex: none; border-radius: 9px; object-fit: cover; }
.brand small { white-space: nowrap; }
.topnav > a:first-child { color: var(--muted); font-weight: 600; }
.topnav > a.is-active { color: var(--green-dark); }
.topnav > a:first-child.is-active { color: var(--green-dark); }
.actions-cell { align-items: center; gap: 6px; }
.row-action {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.row-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.row-action:hover { transform: translateY(-1px); border-color: var(--green); background: var(--green); color: #fff; }
.status-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 34, 45, .48);
  backdrop-filter: blur(2px);
}
.status-modal-overlay[hidden] { display: none; }
body.status-modal-open { overflow: hidden; }
.status-modal {
  width: min(100%, 480px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(12, 25, 38, .24);
  animation: status-modal-enter .18s ease-out;
}
.status-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.status-modal-heading { display: flex; align-items: center; gap: 12px; }
.status-modal-heading .eyebrow { margin-bottom: 2px; }
.status-modal-heading h2 { margin: 0; color: var(--navy); font-size: 18px; }
.status-modal-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); font-size: 25px; }
.status-modal-close { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 22px; line-height: 1; }
.status-modal-close:hover { background: #f5f7f9; color: var(--navy); }
.status-modal-contract { margin: 20px 0 16px; padding: 11px 13px; border-radius: 9px; background: #f5f8fa; color: var(--muted); font-size: 11px; }
.status-modal-contract strong { margin-right: 4px; color: var(--navy); }
.status-modal-field { display: flex; flex-direction: column; gap: 7px; }
.status-modal-field label { color: #43546a; font-size: 11px; font-weight: 700; }
.status-modal-field select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #dfe6ed; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.status-modal-field select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(3, 93, 124, .13); }
.status-modal-actions { display: flex; direction: ltr; gap: 9px; justify-content: flex-start; padding-top: 22px; margin-top: 20px; border-top: 1px solid var(--line); }
@keyframes status-modal-enter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 520px) {
  .status-modal-overlay { padding: 16px; }
  .status-modal { padding: 19px; border-radius: 14px; }
  .status-modal-heading h2 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .status-modal { animation: none; }
}
.button-secondary { border-color: #d1e5ea; color: var(--green-dark); }
.button-secondary:hover { background: #dcecf0; }
.search-bar input:focus,
.search-bar select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.customer-search-field input:focus,
.login-card input:focus { border-color: #4d98ac; box-shadow: 0 0 0 3px rgba(3, 93, 124, .13); }
.table-link:hover,
.icon-link:hover { color: var(--green-dark); }
.status-pill { background: #e8f2f5; color: #15586b; }
.empty-icon { background: #edf4f6; }
.suggestion-option:hover { background: #f2f8fa; }
.selected-record { background: #edf5f7; border-color: #d4e7ed; }
.selected-check { background: #d6ebf0; }
.summary-grid .summary-grand { background: #e8f2f5; border-color: #d3e7ec; }
.detail-icon { background: #eaf3f6; }
.jalali-date-control { position: relative; width: 100%; }
.jalali-date-control .jalali-date-input { direction: ltr; text-align: right; padding-left: 44px; }
.jalali-date-toggle {
  position: absolute;
  left: 6px;
  top: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 17px;
}
.jalali-date-toggle:hover { background: #dcecf0; }
.jalali-picker {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 40px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(20, 42, 69, .16);
}
.jalali-picker[hidden] { display: none; }
.jalali-picker-header { display: flex; direction: ltr; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.jalali-picker-header strong { direction: rtl; color: var(--navy); font-size: 12px; }
.jalali-picker-nav { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--green-dark); font-size: 20px; line-height: 1; }
.jalali-picker-weekdays,
.jalali-picker-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.jalali-picker-weekdays { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.jalali-picker-weekdays span { padding: 4px 0; }
.jalali-picker-day { min-height: 34px; border: 1px solid transparent; border-radius: 7px; background: #fff; color: var(--ink); font-size: 11px; }
.jalali-picker-day:hover { border-color: #c6dfe6; background: #f0f7f9; color: var(--green-dark); }
.jalali-picker-day.is-selected { background: var(--green); color: #fff; font-weight: 700; }
.jalali-picker-spacer { min-height: 34px; }
.customer-form-card { padding: 24px; }
.customer-form-card .field-span-2 { grid-column: span 2; }
.customer-contracts-card { margin-top: 16px; }
.print-section > h2 span { background: #e8f2f5; color: #035d7c; }
.print-item-title strong { background: #e8f2f5; color: #034960; }
.print-item-total { background: #e8f2f5 !important; }
.print-item-total dd { color: #034960 !important; }
.print-grand-total { background: #e8f2f5 !important; border-color: #d3e7ec !important; }
.print-grand-total dd { color: #034960 !important; }

@media print {
  @page { size: A4 portrait; margin: 8mm 9mm; }
  .print-document { font-size: 8.5px !important; line-height: 1.45 !important; }
  .print-document-header { gap: 8px; padding-bottom: 7px; margin-bottom: 8px; }
  .print-section { margin-bottom: 6px; }
  .print-section > h2 { gap: 6px; padding-bottom: 3px; margin-bottom: 5px; font-size: 11px; }
  .print-section > h2 span { width: 18px; height: 18px; }
  .print-grid { gap: 4px 8px; }
  .print-grid > div { padding: 3px 5px; }
  .print-grid dt { margin-bottom: 1px; }
  .print-grid dd { line-height: 1.4; }
  .print-item { margin-bottom: 5px; padding: 5px; }
  .print-item-title { margin-bottom: 4px; padding-bottom: 3px; }
  .print-item-specs > div { padding: 2px 4px; }
  .print-financial-section { break-inside: avoid; page-break-inside: avoid; }
  .print-closing-block { break-inside: avoid; page-break-inside: avoid; }
  .signature-section { gap: 8px; margin-top: 10px; }
  .signature-box { min-height: 60px; gap: 3px; padding: 6px; }
  .signature-box span:first-of-type { margin-top: 5px; }
  .print-footer { margin-top: 6px; }
}

@media (max-width: 760px) {
  .brand { min-width: 0; }
  .brand small { display: none; }
  .topnav { gap: 12px; }
  .customer-form-card .field-span-2 { grid-column: auto; }
}
