@charset "UTF-8";

/* Column resizer handles - invisible until hover */
.column-resizer {
  opacity: 0;
  transition: opacity 0.15s ease;
}
th:hover .column-resizer,
.column-resizer:hover {
  opacity: 1;
}

.manual-upload-details .manual-upload-chevron-expanded {
  display: none;
}

.manual-upload-details[open] .manual-upload-chevron-collapsed {
  display: none;
}

.manual-upload-details[open] .manual-upload-chevron-expanded {
  display: inline;
}

/* Compact ledger tables for invoice review/editing. */
.invoice-ledger-table {
  --ledger-border: #e5e7eb;
  --ledger-soft-border: #eef2f7;
  --ledger-header: #f3f4f6;
}

.invoice-ledger-table table {
  border-collapse: collapse;
}

.invoice-ledger-table thead {
  background: var(--ledger-header);
}

.invoice-ledger-table th {
  border-bottom: 1px solid var(--ledger-border);
  border-right: 1px solid #d1d5db;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  height: 1.55rem;
  letter-spacing: 0;
  line-height: 0.95rem;
  padding: 0.18rem 0.35rem !important;
  text-transform: none;
}

.invoice-ledger-table th:last-child {
  border-right: 0;
}

.invoice-ledger-table td {
  border-bottom: 1px solid var(--ledger-soft-border);
  height: 1.55rem;
  padding: 0.06rem 0.35rem !important;
  vertical-align: middle;
}

.invoice-ledger-table tbody tr:hover {
  background: rgb(239 246 255 / 0.42);
}

.invoice-ledger-table tbody > tr > td > input:not([type="hidden"]):not([type="checkbox"]),
.invoice-ledger-table tbody > tr > td > div > button[data-form-vat-selector-target="selectButton"],
.invoice-ledger-table tbody > tr > td > div > button[data-lookup-selector-target="selectButton"],
.invoice-ledger-table tbody > tr > td > div > div > button[data-lookup-selector-target="selectButton"] {
  border-color: transparent !important;
  border-radius: 0.15rem !important;
  box-shadow: inset 0 0 0 1px transparent;
  min-height: 1.25rem;
  padding: 0 0.2rem !important;
}

.invoice-ledger-table tbody > tr:hover > td > input:not([type="hidden"]):not([type="checkbox"]),
.invoice-ledger-table tbody > tr:hover > td > div > button[data-form-vat-selector-target="selectButton"],
.invoice-ledger-table tbody > tr:hover > td > div > button[data-lookup-selector-target="selectButton"],
.invoice-ledger-table tbody > tr:hover > td > div > div > button[data-lookup-selector-target="selectButton"] {
  border-color: #d1d5db !important;
}

.invoice-ledger-table tbody > tr > td > input:not([type="hidden"]):not([type="checkbox"]):focus,
.invoice-ledger-table tbody > tr > td > div > button[data-form-vat-selector-target="selectButton"]:focus,
.invoice-ledger-table tbody > tr > td > div > button[data-lookup-selector-target="selectButton"]:focus,
.invoice-ledger-table tbody > tr > td > div > div > button[data-lookup-selector-target="selectButton"]:focus {
  border-color: #64748b !important;
  box-shadow: inset 0 0 0 1px #64748b, 0 0 0 2px rgb(100 116 139 / 0.1) !important;
}

.invoice-ledger-table .bulk-line-checkbox {
  accent-color: #111827;
}

.invoice-ledger-table .bulk-line-checkbox:focus {
  box-shadow: 0 0 0 2px rgb(107 114 128 / 0.22);
  outline: 0;
}

.invoice-ledger-table tr.bulk-line-updated-row > td {
  animation: bulk-line-row-confirm 1.35s ease-out;
}

.invoice-ledger-table .bulk-line-updated-cell {
  animation: bulk-line-cell-confirm 1.35s ease-out;
}

/* Export preflight report: quiet table notice for user-fixable blockers. */
.export-problem-report {
  --export-report-accent: #98a2b3;
  --export-report-border: #d7dce5;
  --export-report-ink: #111827;
  --export-report-muted: #667085;

  background: #fff;
  border: 1px solid var(--export-report-border);
  border-radius: 6px;
  color: var(--export-report-ink);
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
}

.export-problem-report__header {
  align-items: center;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.export-problem-report__title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1rem;
  white-space: nowrap;
}

.export-problem-report__summary {
  color: var(--export-report-muted);
  font-size: 0.8rem;
  line-height: 1rem;
  min-width: 0;
}

.export-problem-report__dismiss {
  align-items: center;
  background: transparent;
  border: 0;
  color: #475467;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 500;
  height: 2rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 2rem;
}

.export-problem-report__dismiss:hover {
  color: #111827;
}

.export-problem-report__items {
  display: grid;
  gap: 0.18rem;
  max-height: min(18rem, 38vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
}

.export-problem-report__item {
  align-items: center;
  color: inherit;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(10rem, 18rem) minmax(0, 1fr) auto;
  min-height: 1.75rem;
  padding: 0;
  text-decoration: none;
}

.export-problem-report__item:hover {
  color: #000;
}

.export-problem-report__invoice {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-problem-report__messages {
  color: #475467;
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.export-problem-report__issue {
  font-size: 0.78rem;
  line-height: 1rem;
}

.export-problem-report__fix {
  color: #111827;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1rem;
  padding: 0.15rem 0;
  text-decoration: underline;
  text-underline-offset: 0.12rem;
  white-space: nowrap;
}

.export-problem-report__item:hover .export-problem-report__fix {
  color: #000;
}

.export-problem-row-highlight {
  background: #f8fafc !important;
  box-shadow:
    inset 2px 0 0 var(--export-report-accent, #98a2b3),
    inset 0 1px 0 #e4e7ec,
    inset 0 -1px 0 #e4e7ec;
}

@media (max-width: 768px) {
  .export-problem-report__header,
  .export-problem-report__item {
    grid-template-columns: 1fr;
  }

  .export-problem-report__dismiss,
  .export-problem-report__fix {
    justify-self: start;
  }
}

@keyframes bulk-line-row-confirm {
  0% {
    background-color: rgb(254 249 195 / 0.9);
  }
  70% {
    background-color: rgb(254 249 195 / 0.22);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes bulk-line-cell-confirm {
  0% {
    box-shadow: inset 0 0 0 1px rgb(202 138 4 / 0.5), 0 0 0 3px rgb(250 204 21 / 0.18);
  }
  100% {
    box-shadow: inset 0 0 0 1px transparent, 0 0 0 0 rgb(250 204 21 / 0);
  }
}

.invoice-ledger-table tfoot td {
  border-top: 1px solid var(--ledger-border);
  padding: 0.375rem !important;
}

.invoice-review-panel {
  background: #fff;
  container: invoice-review-panel / inline-size;
}

.invoice-review-header {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem 0.45rem;
}

.invoice-ledger-form {
  background: #fff;
}

.invoice-ledger-form .invoice-ledger-header-grid,
.invoice-ledger-form #custom_fields > .invoice-accounting-fields,
.invoice-ledger-form .invoice-lines-tabs {
  border-bottom: 1px solid #e5e7eb;
}

.invoice-ledger-form .invoice-ledger-header-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 0.9fr) minmax(0, 2.4fr);
}

.invoice-ledger-form #invoice-companies-section,
.invoice-ledger-form #invoice-data-section > .invoice-ledger-data-row,
.invoice-ledger-form #custom_fields > .invoice-accounting-fields {
  padding: 0.32rem 0.5rem;
}

.invoice-ledger-form #invoice-companies-section {
  border-right: 1px solid #e5e7eb;
}

.invoice-ledger-form #invoice-data-section > .invoice-ledger-data-row + .invoice-ledger-data-row {
  border-top: 1px solid #eef2f7;
}

.invoice-ledger-form #invoice-data-section .invoice-ledger-data-row-main {
  grid-template-columns: minmax(6.25rem, 0.9fr) minmax(5.8rem, 0.75fr) minmax(8rem, 1.25fr) minmax(7.2rem, 1fr);
}

.invoice-ledger-form #invoice-data-section .invoice-ledger-amount-row {
  grid-template-columns: minmax(5.7rem, 0.9fr) minmax(6.1rem, 0.9fr) minmax(4rem, 0.6fr) repeat(3, minmax(5.4rem, 0.8fr));
}

.invoice-ledger-form #invoice-companies-section [data-form-company-selector-target="selectButton"],
.invoice-ledger-form #invoice-data-section input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
.invoice-ledger-form #invoice-data-section [data-form-dropdown-target="button"],
.invoice-ledger-form #invoice-export-fields-section input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
.invoice-ledger-form #invoice-export-fields-section [data-lookup-selector-target="selectButton"] {
  border-radius: 0.2rem !important;
  min-height: 1.65rem;
  padding: 0.18rem 0.45rem !important;
  font-size: 0.8125rem;
  line-height: 1.05rem;
}

.invoice-ledger-form #invoice-companies-section span[class*="uppercase"],
.invoice-ledger-form #invoice-data-section span[class*="uppercase"],
.invoice-ledger-form #custom_fields span[class*="uppercase"] {
  letter-spacing: 0;
  line-height: 0.82rem;
  text-transform: none;
}

.invoice-ledger-form #invoice-data-section .invoice-ledger-amount-row {
  background: #f8fafc;
}

.invoice-ledger-form .invoice-lines-ledger {
  display: block;
  max-width: 100%;
  width: 100%;
}

.invoice-ledger-form .invoice-lines-tabs {
  padding: 0;
}

.invoice-ledger-form .invoice-lines-tabs > div {
  border-radius: 0;
}

.invoice-ledger-form .invoice-lines-tabs button {
  min-height: 1.55rem;
}

@media (max-width: 900px) {
  .invoice-ledger-form .invoice-ledger-header-grid {
    grid-template-columns: 1fr;
  }

  .invoice-ledger-form #invoice-companies-section {
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .invoice-ledger-form #invoice-data-section .invoice-ledger-data-row-main,
  .invoice-ledger-form #invoice-data-section .invoice-ledger-amount-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@container invoice-review-panel (max-width: 42rem) {
  .invoice-ledger-form #invoice-data-section .invoice-ledger-amount-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.invoice-next-action-compact {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  margin-bottom: 0;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* Invoice icon tooltips - compact width */
.invoice-icon-tooltip [data-tooltip-target="tooltip"] {
  width: auto !important;
  min-width: auto !important;
  white-space: nowrap;
}

/* Flash message animations */
.flash-message {
  animation: flashMessage 6s forwards;
}

/* Billing overview cards - ensure borders are always visible */
.billing-overview-card {
  border: 1px solid #e5e7eb !important; /* gray-200 */
  border-radius: 0.5rem;
  background-color: white;
  transition: all 0.15s ease;
}

.billing-overview-card:hover {
  border-color: #d1d5db !important; /* gray-300 */
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

@keyframes flashMessage {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.95);
  }
  8% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  92% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.95);
  }
}

/* Verification badge - inline next to label */
.company-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.66rem;
  padding: 0;
  border-radius: 0;
  color: #dc2626;
  border: 0;
  background-color: transparent;
  font-weight: 500;
  cursor: pointer;
}

.company-role-badge:hover {
  color: #991b1b;
  text-decoration: underline;
}

.company-role-badge--person {
  color: #b45309;
}

.company-role-badge--person:hover {
  color: #92400e;
}

.company-role-badge::before {
  content: attr(data-short-label);
}

.company-role-badge svg {
  height: 0.72rem;
  width: 0.72rem;
}

/* Transition effects */
.company-field, 
.custom-field {
  transition: all 0.3s ease-in-out;
}

.default-memory-drawer-overlay {
  z-index: 55;
}

.default-memory-drawer-panel {
  z-index: 60;
}

.invoice-action-target-highlight,
#invoice-companies-section:target,
#invoice-data-section:target,
#invoice-export-fields-section:target,
#custom_fields:target,
#vat_lines_section:target,
#line_items_section:target {
  animation: invoiceActionTargetPulse 4.8s ease-out forwards;
  border-radius: 0.375rem;
}

.invoice-action-target-highlight input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
.invoice-action-target-highlight select,
.invoice-action-target-highlight textarea,
.invoice-action-target-highlight [data-form-company-selector-target="selectButton"],
.invoice-action-target-highlight [data-lookup-selector-target="selectButton"],
#invoice-companies-section:target input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
#invoice-companies-section:target select,
#invoice-companies-section:target textarea,
#invoice-companies-section:target [data-form-company-selector-target="selectButton"],
#invoice-companies-section:target [data-lookup-selector-target="selectButton"],
#invoice-data-section:target input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
#invoice-data-section:target select,
#invoice-data-section:target textarea,
#custom_fields:target input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
#custom_fields:target select,
#custom_fields:target textarea,
#custom_fields:target [data-lookup-selector-target="selectButton"],
#vat_lines_section:target input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
#vat_lines_section:target select,
#vat_lines_section:target textarea,
#vat_lines_section:target [data-lookup-selector-target="selectButton"],
#line_items_section:target input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
#line_items_section:target select,
#line_items_section:target textarea,
#line_items_section:target [data-lookup-selector-target="selectButton"] {
  animation: invoiceActionControlPulse 4.8s ease-out forwards;
}

#invoice-export-fields-section.invoice-action-target-highlight input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
#invoice-export-fields-section.invoice-action-target-highlight select,
#invoice-export-fields-section.invoice-action-target-highlight textarea {
  animation: none;
}

#invoice-export-fields-section.invoice-action-target-highlight [data-lookup-selector-target="selectButton"],
#invoice-export-fields-section:target [data-lookup-selector-target="selectButton"] {
  animation: invoiceActionControlPulse 4.8s ease-out forwards;
}

@keyframes invoiceActionTargetPulse {
  0%, 70% {
    background-color: rgb(255 251 235 / 0.28);
  }
  100% {
    background-color: transparent;
  }
}

@keyframes invoiceActionControlPulse {
  0%, 70% {
    background-color: rgb(255 251 235 / 0.78);
    border-color: rgb(251 191 36 / 0.72);
    box-shadow: inset 0 0 0 1px rgb(251 191 36 / 0.18);
  }
  100% {
    background-color: rgb(255 255 255 / 1);
    border-color: rgb(229 231 235 / 1);
    box-shadow: inset 0 0 0 1px rgb(251 191 36 / 0);
  }
}


/* Turbo frame transition animations */
turbo-frame[id="custom_fields"] {
  transition: all 0.2s ease-in-out;
}

turbo-frame[id="operation_toggle"] {
  transition: all 0.2s ease-in-out;
}

/* Custom field input animations */
.custom-field input {
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* VAT line animations - only for structural changes, not content updates */
.vat-line {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Operation type toggle animations */
.operation-toggle-btn {
  transition: all 0.2s ease-in-out;
}

/* Simple fade-in animation for content changes */
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Removed staggered animations to prevent flickering */


/* Smooth border transitions for company fields */
.seller-field,
.buyer-field {
  transition: border-color 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

/* Badge transitions */
.seller-field::after,
.buyer-field::after {
  transition: border-color 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Company field animations when operation type changes */
.operation-sales .seller-field,
.operation-purchases .buyer-field {
  animation: fadeIn 0.25s ease-out;
}

/* Badges also get fade-in animation */
.operation-sales .seller-field::after,
.operation-purchases .buyer-field::after {
  animation: fadeIn 0.25s ease-out;
}

/* Animation trigger classes */
.fadeIn {
  animation: fadeIn 0.25s ease-out;
}

/* Company field fade-in animation */
.company-field.fadeIn {
  animation: fadeIn 0.25s ease-out;
}

/* Company field badge animation */
.company-field.fadeIn::after {
  animation: fadeIn 0.25s ease-out;
}

/* Dropdown arrow for select elements */
.select-with-arrow {
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

/* Loading animations for billing tabs */
.loading-blur {
  filter: blur(2px);
  opacity: 0.5;
  pointer-events: none;
  transition: all 0.2s ease-in-out;
}

.loading-skeleton {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.skeleton-text {
  height: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
  background-color: #f3f4f6;
  border-radius: 0.25rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-text-short {
  height: 1rem;
  width: 66.666667%;
  margin-bottom: 0.5rem;
  background-color: #f3f4f6;
  border-radius: 0.25rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-card {
  height: 5rem;
  width: 100%;
  border-radius: 0.5rem;
  background-color: #f3f4f6;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-button {
  height: 2rem;
  width: 6rem;
  border-radius: 0.375rem;
  background-color: #f3f4f6;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Integration Interest Modal Styles */
.integration-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  padding: 1rem;
  animation: integrationBackdropIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.integration-modal-backdrop.hidden {
  display: none;
}

@keyframes integrationBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.integration-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: white;
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px -10px rgba(15, 23, 42, 0.25);
  animation: integrationModalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

@keyframes integrationModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 640px) {
  .integration-modal {
    padding: 40px 32px;
    max-width: calc(100vw - 32px);
  }
}

.integration-modal-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}

.integration-modal-content.hidden {
  display: none;
}

.integration-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 20px;
  color: white;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px -8px rgba(16, 185, 129, 0.4);
  animation: integrationIconIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes integrationIconIn {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.integration-modal-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  animation: integrationTextIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.integration-modal-subtitle {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 32px;
  animation: integrationTextIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes integrationTextIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.integration-modal-form {
  animation: integrationTextIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.integration-input-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.integration-input {
  width: 100%;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

.integration-input::placeholder {
  color: #94a3b8;
}

.integration-input:focus {
  background: white;
  border-color: #10b981;
  transform: translateY(-1px);
}

.integration-input-focus-ring {
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.integration-input:focus + .integration-input-focus-ring {
  opacity: 0.15;
}

.integration-submit-btn {
  width: 100%;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px -4px rgba(16, 185, 129, 0.4);
  position: relative;
  overflow: hidden;
}

.integration-submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.integration-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(16, 185, 129, 0.5);
}

.integration-submit-btn:hover::before {
  opacity: 1;
}

.integration-submit-btn:active {
  transform: translateY(0);
}

.integration-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.integration-btn-arrow {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.integration-submit-btn:hover .integration-btn-arrow {
  transform: translateX(2px);
}

.integration-modal-error {
  margin-top: 12px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.integration-modal-error.hidden {
  display: none;
}

.integration-modal-privacy {
  font-size: 13px;
  color: #94a3b8;
  margin: 16px 0 0;
  font-weight: 400;
  animation: integrationTextIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.integration-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.integration-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}

.integration-modal-close:active {
  transform: scale(0.95);
}

/* Integration Modal Success State */
.integration-success-icon {
  display: inline-flex;
  margin: 0 auto 24px;
  color: #10b981;
}

.integration-success-circle {
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
  animation: integrationDrawCircle 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes integrationDrawCircle {
  to { stroke-dashoffset: 0; }
}

.integration-success-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: integrationDrawCheck 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

@keyframes integrationDrawCheck {
  to { stroke-dashoffset: 0; }
}

/* Integration Modal Loading State */
.integration-btn-loading {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: integrationSpin 0.6s linear infinite;
}

@keyframes integrationSpin {
  to { transform: rotate(360deg); }
}

/* PDF Text Layer — invisible spans over canvas for text selection */
.pdf-text-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  line-height: 1;
  opacity: 0.3;
  z-index: 1;
}

.pdf-text-layer span {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  transition: background 0.1s ease;
}

.pdf-text-layer span::selection {
  background: rgba(59, 130, 246, 0.3);
}

.pdf-text-layer span:hover {
  background: rgba(59, 130, 246, 0.12);
  border-radius: 2px;
}

/* Custom fields - yellow background when empty to indicate missing value */
.custom-field input[type="text"]:placeholder-shown {
  background-color: #fef9c3; /* yellow-100 */
}

/* ============================================
   MODEL COMPARISON PAGE
   Clean, data-focused design
   ============================================ */

.model-comparison-page {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Header */
.mc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.mc-header-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mc-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #18181b;
  letter-spacing: -0.025em;
  margin: 0;
}

.mc-subtitle {
  font-size: 0.875rem;
  color: #71717a;
  margin: 0;
}

.mc-back-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #71717a;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.mc-back-link:hover {
  color: #18181b;
  background: #f4f4f5;
}

/* Controls */
.mc-controls {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.mc-controls-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 768px) {
  .mc-controls-inner {
    grid-template-columns: 1fr;
  }
}

.mc-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mc-control-document {
  min-width: 0;
}

.mc-document-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.mc-document-row .mc-select {
  flex: 1;
}

.mc-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #52525b;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.mc-download-btn:hover {
  color: #18181b;
  background: #f4f4f5;
  border-color: #d4d4d8;
}

.mc-download-btn.hidden {
  display: none;
}

.mc-control-models {
  min-width: 280px;
}

.mc-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mc-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: #18181b;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mc-select:hover {
  border-color: #d4d4d8;
}

.mc-select:focus {
  outline: none;
  border-color: #18181b;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

/* Model chips */
.mc-model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mc-chip {
  cursor: pointer;
}

.mc-chip-label {
  display: inline-block;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #52525b;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 2rem;
  transition: all 0.15s ease;
}

.mc-chip-label:hover {
  border-color: #a1a1aa;
}

.mc-chip input:checked + .mc-chip-label {
  color: #fff;
  background: #18181b;
  border-color: #18181b;
}

/* Run button */
.mc-run-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: #18181b;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mc-run-btn:hover:not(:disabled) {
  background: #27272a;
}

.mc-run-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mc-btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mc-spin 0.6s linear infinite;
}

@keyframes mc-spin {
  to { transform: rotate(360deg); }
}

/* Status bar */
.mc-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.625rem 0.875rem;
  background: #f4f4f5;
  border-radius: 0.5rem;
}

.mc-status.hidden {
  display: none;
}

.mc-status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #71717a;
}

.mc-status[data-type="loading"] .mc-status-indicator {
  background: #3b82f6;
  animation: mc-pulse 1s ease-in-out infinite;
}

.mc-status[data-type="success"] .mc-status-indicator {
  background: #22c55e;
}

.mc-status[data-type="error"] .mc-status-indicator {
  background: #ef4444;
}

@keyframes mc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.mc-status-text {
  font-size: 0.8125rem;
  color: #52525b;
  margin: 0;
}

/* Results */
.mc-results {
  animation: mc-fade-in 0.3s ease;
}

.mc-results.hidden {
  display: none;
}

@keyframes mc-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats grid */
.mc-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .mc-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mc-stat {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  transition: all 0.15s ease;
}

.mc-stat:hover {
  border-color: #d4d4d8;
}

.mc-stat--warning {
  background: #fffbeb;
  border-color: #fcd34d;
}

.mc-stat--success {
  background: #f0fdf4;
  border-color: #86efac;
}

.mc-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.mc-stat-icon--models {
  background: #f4f4f5;
  color: #52525b;
}

.mc-stat-icon--cost {
  background: #eff6ff;
  color: #3b82f6;
}

.mc-stat-icon--time {
  background: #faf5ff;
  color: #a855f7;
}

.mc-stat-icon--warning {
  background: #fef3c7;
  color: #f59e0b;
}

.mc-stat-icon--success {
  background: #dcfce7;
  color: #22c55e;
}

.mc-stat-content {
  min-width: 0;
}

.mc-stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #18181b;
  line-height: 1.2;
}

.mc-stat-label {
  font-size: 0.75rem;
  color: #71717a;
  margin-top: 0.125rem;
}

/* Table */
.mc-table-container {
  width: 100%;
}

.mc-table-wrapper {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  overflow: hidden;
}

.mc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mc-th {
  padding: 0.875rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  background: #fafafa;
  border-bottom: 1px solid #e4e4e7;
}

.mc-th--field {
  width: 120px;
  color: #71717a;
}

.mc-th--model {
  color: #18181b;
}

/* Section headers */
.mc-section-header td {
  padding: 0.625rem 1rem;
  background: #18181b;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mc-section-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 0.5rem;
  opacity: 0.7;
}

.mc-section-title {
  vertical-align: middle;
}

/* Table cells */
.mc-td {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #18181b;
  border-bottom: 1px solid #f4f4f5;
  vertical-align: top;
}

.mc-td--label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #71717a;
  background: #fafafa;
  width: 120px;
}

.mc-td--label-diff {
  color: #b45309;
  background: #fffbeb;
}

.mc-td--diff {
  background: #fffbeb;
  color: #92400e;
  font-weight: 500;
}

.mc-td--empty {
  color: #a1a1aa;
  font-style: italic;
}

.mc-row--diff {
  border-left: 3px solid #f59e0b;
}

.mc-row--meta .mc-td {
  background: #fafafa;
  border-bottom: 1px solid #e4e4e7;
}

/* Meta grid (performance metrics) */
.mc-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.mc-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.mc-meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: #18181b;
}

.mc-meta-value--tokens {
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.mc-meta-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* VAT lines */
.mc-vat-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f4f4f5;
}

.mc-vat-line:last-child {
  border-bottom: none;
}

.mc-vat-rate {
  font-size: 0.875rem;
  font-weight: 600;
  color: #18181b;
  min-width: 40px;
}

.mc-vat-amounts {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: #52525b;
}

.mc-vat-code {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #71717a;
  background: #f4f4f5;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  margin-left: auto;
}

/* Error card */
.mc-error-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.75rem;
}

.mc-error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fee2e2;
  border-radius: 0.5rem;
  color: #ef4444;
  flex-shrink: 0;
}

.mc-error-content {
  flex: 1;
  min-width: 0;
}

.mc-error-model {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #991b1b;
  margin: 0 0 0.25rem 0;
}

.mc-error-message {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin: 0;
}

.mc-error-duration {
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.375rem;
  display: inline-block;
}

/* Empty state */
.mc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.mc-empty-state.hidden {
  display: none;
}

.mc-empty-icon {
  color: #d4d4d8;
  margin-bottom: 1rem;
}

.mc-empty-text {
  font-size: 0.9375rem;
  color: #71717a;
  margin: 0;
}

/* Character-level diff highlighting */
.mc-char-diff {
  background: #fef08a;
  color: #854d0e;
  padding: 0.0625rem 0.125rem;
  margin: 0 -0.0625rem;
  border-radius: 2px;
  font-weight: 600;
}
