.article-search-wrap {
  position: relative;
  width: min(680px, 100%);
  margin: 0 0 18px;
}
.article-search-wrap label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}
.article-search-wrap input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #aeb8c2;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.article-search-wrap input[type="search"]:focus {
  outline: 3px solid rgba(38, 63, 88, .16);
  border-color: #263f58;
}
.article-search-hint {
  margin-top: 5px;
  color: #66727d;
  font-size: .86rem;
}
.article-results {
  position: absolute;
  z-index: 50;
  top: 73px;
  left: 0;
  right: 0;
  max-height: 330px;
  overflow: auto;
  border: 1px solid #aeb8c2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 35, 50, .18);
}
.article-results.hidden { display: none; }
.article-hit {
  display: flex;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #e6eaee;
  border-radius: 0;
  background: #fff;
  color: #17232e;
  text-align: left;
  cursor: pointer;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.article-hit:last-child { border-bottom: 0; }
.article-hit:hover, .article-hit:focus { background: #eef3f6; }
.article-hit span { color: #5a6670; font-size: .88rem; }

.accounting-link-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 2px solid #2f7d53;
  border-radius: 10px;
  background: #edf8f1;
}
.accounting-link-status.is-unposted {
  border-color: #b42318;
  background: #fff0ee;
  color: #7a1b15;
  box-shadow: 0 0 0 3px rgba(180,35,24,.08);
}
.accounting-state-copy { flex: 1 1 330px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; background: #2f7d53; }
.status-dot.danger { background: #b42318; }
.revenue-split-hint { color: #53606b; font-size: .9rem; }
.accounting-link-status form { margin: 0; }
.accounting-action { white-space: nowrap; }
.fibu-list-state { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.fibu-list-state.posted { color: #1f6644; background: #e6f4eb; }
.fibu-list-state.unposted { color: #8f1e16; background: #ffe6e2; border: 1px solid #e2a19a; }

/* Schweizer MWST 6.0 */
.vat-document-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
  border-left: 4px solid #c9252d;
}
.vat-document-controls h2,
.vat-settings-block h2 { margin: 0 0 4px; }
.vat-document-controls .vat-heading { grid-column: 1 / -1; }
.vat-heading p { margin: 4px 0 0; }
.vat-control-note {
  grid-column: 1 / -1;
  margin: 0;
  color: #66727d;
  font-size: .84rem;
}
.checkbox-line {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 9px;
  color: #26333f;
  line-height: 1.35;
}
.checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  accent-color: #1f4d3a;
}
.quote-grid.vat-grid {
  grid-template-columns: 46px minmax(145px,1.25fr) minmax(155px,1.35fr) 72px 72px 92px 72px 148px 150px 96px 100px;
  min-width: 1230px;
}
.vat-rate-select { min-width: 142px; }
.vat-line-total small {
  display: block;
  margin-top: 3px;
  color: #6b6b68;
  font-size: 10px;
  white-space: nowrap;
}
.vat-summary {
  width: min(480px, 100%);
  margin: 18px 0 0 auto;
  border-top: 2px solid #263f58;
  font-variant-numeric: tabular-nums;
}
.vat-summary-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(110px, auto);
  gap: 18px;
  padding: 7px 2px;
  border-bottom: 1px solid #e4e8eb;
  text-align: right;
}
.vat-summary-row.vat-grand {
  padding-top: 10px;
  border-bottom: 0;
  font-size: 1.15rem;
}
.vat-summary-groups:empty { display: none; }
.vat-summary-note {
  margin: 8px 0 0;
  color: #66727d;
  font-size: .78rem;
  text-align: right;
}
.vat-off .vat-rate-select { opacity: .52; }
.vat-off .vat-summary-groups { display: none; }

.vat-calculation {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid #dce3e8;
  border-radius: 9px;
  background: #f7f9fa;
}
.vat-calculation span { color: #66727d; font-size: .78rem; }
.vat-calculation b { display: block; margin-top: 3px; color: #17232e; font-size: 1.05rem; }

.vat-settings-block {
  border-top: 4px solid #c9252d;
}
.vat-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.swiss-vat-note {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f5f7f8;
  color: #4d5963;
  font-size: .88rem;
  line-height: 1.45;
}
.swiss-vat-note strong { color: #263f58; }

.vat-rate-table input,
.vat-rate-table select { min-width: 92px; }
.vat-rate-table .rate-code { min-width: 100px; }
.vat-rate-table .rate-name { min-width: 180px; }
.vat-rate-table .date-field { min-width: 145px; }
.vat-rate-table .rate-actions { display: flex; gap: 6px; white-space: nowrap; }
.vat-rate-table tr.inactive { opacity: .58; background: #fafafa; }
.vat-rate-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f4ed;
  color: #245b3d;
  font-size: .78rem;
  font-weight: 700;
}
.vat-rate-badge.inactive { background: #eceff1; color: #68737c; }

.vat-report-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 240px)) auto;
  gap: 12px;
  align-items: end;
}
.vat-report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vat-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.vat-kpi {
  padding: 16px;
  border: 1px solid #dfe4e7;
  border-radius: 10px;
  background: #fff;
}
.vat-kpi span { display: block; color: #66727d; font-size: .78rem; }
.vat-kpi b { display: block; margin-top: 6px; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.vat-kpi.due { border-color: #c9252d; box-shadow: inset 0 3px #c9252d; }
.vat-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.vat-report-grid .panel { min-width: 0; }
.vat-report-total td { border-top: 2px solid #263f58; font-weight: 700; }
.vat-method-label {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9eef2;
  color: #425363;
  font-size: .75rem;
  font-weight: 700;
}

@media (max-width: 1000px) {
  .vat-kpis { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .vat-report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .article-search-wrap { width: 100%; }
  .article-results { position: fixed; top: 24%; left: 12px; right: 12px; max-height: 55vh; }
  .vat-document-controls { grid-template-columns: 1fr; }
  .vat-document-controls .vat-heading,
  .vat-control-note { grid-column: auto; }
  .vat-report-filter { grid-template-columns: 1fr; }
  .vat-report-actions { align-items: stretch; }
  .vat-report-actions .button,
  .vat-report-actions button { flex: 1 1 140px; text-align: center; }
}
@media (max-width: 540px) {
  .vat-calculation,
  .vat-kpis { grid-template-columns: 1fr; }
  .vat-summary { width: 100%; }
  .vat-summary-row { grid-template-columns: 1fr auto; }
}
