/* Locale + tax-intelligence UI for document/country/industry/template routes.
 * Component styles work in both directions; the RTL section mirrors layout.
 * Print-safe on purpose: RTL direction must also hold in print output. */

.tax-notice {
  font-size: 10px;
  line-height: 1.55;
  color: #475467;
  background: #f6f9ff;
  border: 1px solid #e2eaf3;
  border-inline-start: 3px solid var(--blue);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0 0;
}

.tax-advanced {
  grid-column: 1 / -1;
  border: 1px solid #e2eaf3;
  border-radius: 6px;
  padding: 7px;
  margin-top: 7px;
}
.tax-advanced > summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  color: #344054;
  padding: 4px 2px;
}
.tax-advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 6px;
}

.tax-suggestion {
  grid-column: 1 / -1;
  border: 1px solid #d5e7ff;
  border-radius: 9px;
  background: #f7faff;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.55;
  color: #344054;
}
.tax-suggestion h3 {
  font-size: 11px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tax-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .3px;
  border-radius: 99px;
  padding: 3px 9px;
  background: #e4e7ec;
  color: #344054;
}
.tax-pill[data-state="KNOWN"] { background: #d1fadf; color: #027a48; }
.tax-pill[data-state="SUGGESTED"] { background: #d9ecff; color: #1049c7; }
.tax-pill[data-state="NEEDS_USER_INPUT"] { background: #fef0c7; color: #93370d; }
.tax-pill[data-state="CUSTOM"] { background: #e4e7ec; color: #344054; }
.tax-suggestion ul {
  margin: 6px 0;
  padding-inline-start: 18px;
}
.tax-suggestion li { margin: 2px 0; }
.tax-suggestion .tax-why { margin-top: 6px; }
.tax-suggestion .tax-why strong { display: block; margin-bottom: 2px; }
.tax-sources {
  margin: 6px 0 0;
  font-size: 10px;
}
.tax-sources a { color: var(--blue); }
.tax-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.tax-actions .add { margin-top: 0; }
.tax-gated {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #fedf89;
  background: #fffaeb;
  border-radius: 6px;
  color: #93370d;
  font-size: 10px;
}

.locale-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid #b2ccff;
  border-radius: 8px;
  background: #f2f7ff;
  color: #344054;
  font-size: 11px;
  padding: 8px 10px;
  margin: 0 0 10px;
}
.locale-banner .add { margin-top: 0; }
.locale-banner button.linklike {
  border: 0;
  background: none;
  color: var(--blue-dark);
  font-weight: 750;
  padding: 6px 4px;
  cursor: pointer;
}

.field-note {
  display: block;
  font-size: 10px;
  color: #667085;
  margin-top: 3px;
  line-height: 1.45;
}

/* Mixed-content fields stay left-to-right so IBAN, email, URL, invoice
 * numbers and codes remain readable inside RTL layouts. */
.ltr-field,
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"] {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}
html[dir="rtl"] input[type="number"],
html[dir="rtl"] .lineamount {
  direction: ltr;
  unicode-bidi: isolate;
}
html[dir="rtl"] .preview-table td,
html[dir="rtl"] .preview-table th {
  unicode-bidi: plaintext;
}

/* RTL layout mirroring for header, forms, tables, preview and menus. */
html[dir="rtl"] .items-table th,
html[dir="rtl"] .preview-table th {
  text-align: right;
}
html[dir="rtl"] .preview-table td:last-child,
html[dir="rtl"] .preview-table th:last-child {
  text-align: left;
}
html[dir="rtl"] .dropmenu {
  left: auto;
  right: -15px;
}
html[dir="rtl"] .search-popover {
  right: auto;
  left: -40px;
}
html[dir="rtl"] .previewtotals {
  margin: 8px auto 17px 0;
}
html[dir="rtl"] .paper-stamp {
  right: auto;
  left: 22px;
  transform: rotate(11deg);
}
html[dir="rtl"] .note {
  border-left: 0;
  border-right: 3px solid var(--blue);
}
html[dir="rtl"] .tax-notice {
  border-inline-start: 3px solid var(--blue);
}
html[dir="rtl"] #invoicePreview {
  text-align: right;
}
html[dir="rtl"] #invoicePreview .previewgrand,
html[dir="rtl"] #invoicePreview .grand {
  text-align: right;
}
@media (max-width: 720px) {
  html[dir="rtl"] .search-popover {
    left: 14px;
    right: 14px;
  }
  html[dir="rtl"] .dropmenu {
    right: 0;
  }
  .tax-advanced-grid {
    grid-template-columns: 1fr;
  }
}

/* Suggested-rate block: progressive disclosure inside the suggestion panel. */
.tax-rate {
  border-top: 1px dashed var(--border, #d5dde8);
  margin-top: 0.6rem;
  padding-top: 0.6rem;
}
.tax-rate p { margin: 0.35rem 0; }
.tax-rate-source {
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.tax-rate-choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tax-rate-choice select {
  min-height: 44px;
}
