.wc-fiscal-page {
  --fiscal-ink: #102a43;
  --fiscal-muted: #627d98;
  --fiscal-line: #d9e2ec;
  --fiscal-soft: #f4f7fa;
  --fiscal-blue: #0b4f8a;
  color: var(--fiscal-ink);
}

.wc-fiscal-page[hidden],
.wc-fiscal-page .wc-fiscal-panel[hidden] {
  display: none !important;
}

.wc-fiscal-header,
.wc-fiscal-toolbar,
.wc-fiscal-detail-heading,
.wc-fiscal-card-title,
.wc-fiscal-preflight-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.wc-fiscal-header {
  margin-bottom: 20px;
  padding: 24px 26px;
  border: 1px solid #c9d8e8;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fbff 0%, #e8f2fa 100%);
}

.wc-fiscal-header h2,
.wc-fiscal-toolbar h3,
.wc-fiscal-detail-heading h3,
.wc-fiscal-placeholder h3 {
  margin: 3px 0 5px;
  color: #092b4c;
}

.wc-fiscal-header p,
.wc-fiscal-toolbar p,
.wc-fiscal-detail-heading p,
.wc-fiscal-section-heading p,
.wc-fiscal-placeholder p {
  margin: 0;
  color: var(--fiscal-muted);
}

.wc-fiscal-eyebrow {
  display: block;
  color: #23679f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.wc-fiscal-scope {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid #bed3e5;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #315d80;
  font-size: 12px;
  font-weight: 700;
}

.wc-fiscal-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--fiscal-line);
  border-radius: 12px;
  background: #edf2f7;
}

.wc-fiscal-tabs button {
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #52667a;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.wc-fiscal-tabs button.is-active {
  background: #fff;
  color: var(--fiscal-blue);
  box-shadow: 0 2px 8px rgba(20, 47, 74, .1);
}

.wc-fiscal-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}

.wc-fiscal-notice--success { border-color: #a7d7c5; background: #edf9f3; color: #176544; }
.wc-fiscal-notice--error { border-color: #efb1b1; background: #fff2f2; color: #9b2c2c; }
.wc-fiscal-notice--warning { border-color: #efd08a; background: #fff9e8; color: #805b10; }
.wc-fiscal-notice--info { border-color: #b9d5ec; background: #eef7fe; color: #245f8e; }

.wc-fiscal-toolbar {
  margin-bottom: 14px;
}

.wc-fiscal-toolbar h3 {
  font-size: 20px;
}

.wc-fiscal-toolbar p {
  font-size: 13px;
}

.wc-fiscal-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.wc-fiscal-list-card,
.wc-fiscal-detail-card {
  border: 1px solid var(--fiscal-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(31, 55, 78, .06);
}

.wc-fiscal-list-card {
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.wc-fiscal-card-title {
  padding: 15px 16px;
  border-bottom: 1px solid var(--fiscal-line);
}

.wc-fiscal-card-title span {
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf2f8;
  color: #315d80;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.wc-fiscal-list {
  max-height: 640px;
  overflow: auto;
  padding: 8px;
}

.wc-fiscal-list-item {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--fiscal-ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.wc-fiscal-list-item:hover {
  background: #f5f8fb;
}

.wc-fiscal-list-item.is-selected {
  border-color: #9fc2df;
  background: #edf6fd;
}

.wc-fiscal-list-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.wc-fiscal-list-item > span:not(.wc-fiscal-list-topline),
.wc-fiscal-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-fiscal-list-item > span:not(.wc-fiscal-list-topline) {
  font-size: 13px;
  font-weight: 650;
}

.wc-fiscal-list-item small {
  margin-top: 3px;
  color: var(--fiscal-muted);
  font-size: 11px;
}

.wc-fiscal-detail-card {
  min-height: 260px;
  padding: 20px;
}

.wc-fiscal-detail-heading {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--fiscal-line);
}

.wc-fiscal-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9eef3;
  color: #52667a;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .02em;
}

.wc-fiscal-status--rascunho { background: #fff3cd; color: #795a00; }
.wc-fiscal-status--preparado { background: #dceeff; color: #125b91; }
.wc-fiscal-status--autorizado { background: #dff5e9; color: #176544; }
.wc-fiscal-status--cancelado,
.wc-fiscal-status--rejeitado { background: #fde2e2; color: #9b2c2c; }

.wc-fiscal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.wc-fiscal-summary-grid > div {
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid #e4eaf0;
  border-radius: 10px;
  background: var(--fiscal-soft);
}

.wc-fiscal-summary-grid span,
.wc-fiscal-summary-grid strong {
  display: block;
}

.wc-fiscal-summary-grid span {
  margin-bottom: 5px;
  color: var(--fiscal-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.wc-fiscal-summary-grid strong {
  overflow: hidden;
  color: #193b59;
  font-size: 13px;
  text-overflow: ellipsis;
}

.wc-fiscal-form {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid var(--fiscal-line);
  border-radius: 13px;
  background: #fbfcfe;
}

.wc-fiscal-section-heading h4,
.wc-fiscal-preflight h4,
.wc-fiscal-related-grid h4 {
  margin: 0 0 4px;
  color: #183b56;
}

.wc-fiscal-section-heading p {
  font-size: 12px;
}

.wc-fiscal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 15px;
}

.wc-fiscal-form-grid label,
.wc-fiscal-form-grid label > span {
  display: block;
}

.wc-fiscal-form-grid label > span {
  margin-bottom: 6px;
  color: #3e5870;
  font-size: 11px;
  font-weight: 750;
}

.wc-fiscal-form-grid input,
.wc-fiscal-form-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #bdcad6;
  border-radius: 9px;
  background: #fff;
  color: #17324d;
  font: inherit;
  font-size: 13px;
}

.wc-fiscal-form-grid input:focus,
.wc-fiscal-form-grid select:focus {
  border-color: #4f91c6;
  outline: 3px solid rgba(79, 145, 198, .16);
}

.wc-fiscal-form-grid input:disabled,
.wc-fiscal-form-grid select:disabled {
  background: #edf1f4;
  color: #6b7d8e;
}

.wc-fiscal-field-wide {
  grid-column: 1 / -1;
}

.wc-fiscal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.wc-fiscal-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.wc-fiscal-button:disabled {
  cursor: wait;
  opacity: .62;
}

.wc-fiscal-button--primary { background: #0b4f8a; color: #fff; }
.wc-fiscal-button--secondary { border-color: #b7c7d5; background: #fff; color: #294e6d; }
.wc-fiscal-button--outline { border-color: #6da2cb; background: #edf6fd; color: #155f96; }

.wc-fiscal-preflight {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid;
  border-radius: 13px;
}

.wc-fiscal-preflight.is-ready { border-color: #addac8; background: #f1fbf6; }
.wc-fiscal-preflight.has-blockers { border-color: #efb7b7; background: #fff7f7; }

.wc-fiscal-preflight-result {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  font-size: 11px;
  font-weight: 850;
}

.wc-fiscal-message-group {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 9px;
  font-size: 12px;
}

.wc-fiscal-message-group ul {
  margin: 7px 0 0;
  padding-left: 19px;
}

.wc-fiscal-message-group--error { background: #fde8e8; color: #842727; }
.wc-fiscal-message-group--warning { background: #fff2cc; color: #74540b; }
.wc-fiscal-success-copy { margin: 10px 0 0; color: #176544; font-size: 12px; }

.wc-fiscal-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.wc-fiscal-related-grid section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--fiscal-line);
  border-radius: 11px;
}

.wc-fiscal-related-grid p {
  margin: 7px 0 0;
  color: var(--fiscal-muted);
  font-size: 12px;
}

.wc-fiscal-related-grid ul {
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.wc-fiscal-related-grid li {
  min-width: 0;
  padding: 7px 0;
  border-top: 1px solid #edf1f4;
}

.wc-fiscal-related-grid li strong,
.wc-fiscal-related-grid li span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-fiscal-related-grid li strong { font-size: 12px; }
.wc-fiscal-related-grid li span { margin-top: 2px; color: var(--fiscal-muted); font-size: 10px; }

.wc-fiscal-boundary,
.wc-fiscal-placeholder-note {
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px dashed #9fb6c9;
  border-radius: 9px;
  background: #f5f9fc;
  color: #46647d;
  font-size: 11px;
  font-weight: 650;
}

.wc-fiscal-settings-card {
  overflow: hidden;
  border: 1px solid var(--fiscal-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(31, 55, 78, .06);
}

.wc-fiscal-environment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 20px;
  border-bottom: 1px solid #c9d8e8;
  background: #eef7fe;
}

.wc-fiscal-environment.is-production {
  border-bottom-color: #e3c18d;
  background: #fff7e8;
}

.wc-fiscal-environment strong {
  display: block;
  margin-top: 4px;
  color: #175f92;
  font-size: 21px;
}

.wc-fiscal-environment.is-production strong {
  color: #8a5506;
}

.wc-fiscal-environment p {
  max-width: 560px;
  margin: 0;
  color: #49677f;
  font-size: 12px;
  font-weight: 650;
}

.wc-fiscal-settings-form {
  padding: 20px;
}

.wc-fiscal-settings-section + .wc-fiscal-settings-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--fiscal-line);
}

.wc-fiscal-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 15px;
}

.wc-fiscal-settings-grid label,
.wc-fiscal-settings-grid label > span {
  display: block;
}

.wc-fiscal-settings-grid label > span {
  margin-bottom: 6px;
  color: #3e5870;
  font-size: 11px;
  font-weight: 750;
}

.wc-fiscal-settings-grid label > span small {
  color: #70869a;
  font-size: 10px;
  font-weight: 600;
}

.wc-fiscal-settings-grid input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #bdcad6;
  border-radius: 9px;
  background: #fff;
  color: #17324d;
  font: inherit;
  font-size: 13px;
}

.wc-fiscal-settings-grid input:focus {
  border-color: #4f91c6;
  outline: 3px solid rgba(79, 145, 198, .16);
}

.wc-fiscal-settings-grid .wc-fiscal-field-wide {
  grid-column: 1 / -1;
}

.wc-fiscal-settings-grid .wc-fiscal-address-street {
  grid-column: span 2;
}

.wc-fiscal-accounting-note {
  padding: 10px 12px;
  border: 1px solid #d5c489;
  border-radius: 9px;
  background: #fff9e8;
  color: #71550f;
  font-size: 11px;
  font-weight: 650;
}

.wc-fiscal-settings-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 15px;
  border: 1px dashed #9fb6c9;
  border-radius: 11px;
  background: #f5f9fc;
}

.wc-fiscal-settings-save strong,
.wc-fiscal-settings-save span {
  display: block;
}

.wc-fiscal-settings-save strong {
  color: #294e6d;
  font-size: 12px;
}

.wc-fiscal-settings-save span {
  max-width: 650px;
  margin-top: 3px;
  color: #5b7185;
  font-size: 11px;
}

.wc-fiscal-placeholder {
  max-width: 680px;
  margin: 36px auto;
  padding: 38px;
  border: 1px solid var(--fiscal-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(31, 55, 78, .07);
  text-align: center;
}

.wc-fiscal-placeholder-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 15px;
  background: #e5f0f8;
  color: #23679f;
  font-size: 16px;
  font-weight: 900;
}

.wc-fiscal-empty,
.wc-fiscal-loading,
.wc-fiscal-error {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--fiscal-muted);
  text-align: center;
  font-size: 12px;
}

.wc-fiscal-empty strong {
  color: #34516a;
  font-size: 14px;
}

.wc-fiscal-empty--compact {
  min-height: 140px;
  padding: 12px;
}

.wc-fiscal-error {
  color: #9b2c2c;
}

@media (max-width: 980px) {
  .wc-fiscal-workspace { grid-template-columns: 1fr; }
  .wc-fiscal-list-card { position: static; }
  .wc-fiscal-list { max-height: 310px; }
  .wc-fiscal-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .wc-fiscal-header,
  .wc-fiscal-toolbar,
  .wc-fiscal-detail-heading,
  .wc-fiscal-preflight-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .wc-fiscal-header { padding: 19px; }
  .wc-fiscal-detail-card { padding: 14px; }
  .wc-fiscal-summary-grid,
  .wc-fiscal-form-grid,
  .wc-fiscal-related-grid,
  .wc-fiscal-settings-grid { grid-template-columns: 1fr; }
  .wc-fiscal-field-wide { grid-column: auto; }
  .wc-fiscal-settings-grid .wc-fiscal-field-wide,
  .wc-fiscal-settings-grid .wc-fiscal-address-street { grid-column: auto; }
  .wc-fiscal-tabs { display: flex; width: 100%; flex-direction: column; }
  .wc-fiscal-tabs button { width: 100%; }
  .wc-fiscal-button { flex: 1 1 100%; }
  .wc-fiscal-placeholder { margin: 20px 0; padding: 25px 18px; }
  .wc-fiscal-environment,
  .wc-fiscal-settings-save { align-items: flex-start; flex-direction: column; }
  .wc-fiscal-settings-form { padding: 15px; }
}
