
.login-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
}

.login-btn:hover {
  background: var(--astrovia-blue-hover);
  box-shadow: var(--shadow-lg);
}

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

/* Note: form-group, form-label, form-input, select.form-input 
   moved to canonical location at line ~2460 */

/* Premium Input Section - DEPRECATED: Use .c-card which now has unified styling */
/* Kept for backwards compatibility, but .c-card now provides the same styling */
.premium-input-section {
  /* Inherits from .c-card - no overrides needed */
}

/* ============================================================
   PREMIUM CARD SYSTEM - Apple-level Aesthetics
   ============================================================ */

.premium-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-slow) var(--ease-default);
}

.premium-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-xl) 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--astrovia-blue);
  border-radius: var(--radius-2xs);
}

/* Form Select (Premium Dropdown) */
.form-select {
  width: 100%;
  padding: var(--space-sm) 40px var(--space-sm) var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-surface);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%236B7280' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  font-family: inherit;
  height: 44px;
}

.form-select:hover {
  border-color: var(--border-default);
}

.form-select:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring-md);
}

/* Form hint text */
.form-hint {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
}

.form-hint.mb-sm {
  margin-bottom: var(--space-sm);
}

/* Organization Market Enrollment Grid */
.org-markets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.org-market-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  background: var(--bg-surface);
}

.org-market-checkbox:hover {
  border-color: var(--border-medium);
  background: var(--bg-section);
}

.org-market-checkbox:has(input:checked) {
  border-color: var(--astrovia-blue);
  background: var(--info-bg);
}

.org-market-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--astrovia-blue);
  cursor: pointer;
  margin: 0;
}

.org-market-flag {
  font-size: var(--font-size-2xl);
  line-height: 1;
}

.org-market-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
}

/* Text button (link-style) */
.c-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--astrovia-blue);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  border-radius: var(--radius-sm);
}

.c-btn-text:hover {
  background: var(--info-bg);
  color: var(--astrovia-blue-hover);
}

/* Spin animation for loading states */

.spin {
  animation: spin 1s linear infinite;
}

/* Form sections with separator */
.taxos-form-section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.taxos-form-section-title {
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

/* Threshold info grid */
.threshold-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* Threshold info card */
.threshold-card {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.threshold-card--eu {
  background: var(--info-bg);
}

.threshold-card--uk {
  background: var(--feature-blue-gradient);
}

.threshold-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.threshold-card-icon {
  font-size: var(--font-size-xl);
}

.threshold-card-title {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.threshold-card-list {
  margin: 0;
  padding-left: var(--space-lg);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* VAT Calculation Expandable Section */
.taxos-calculation-details {
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  overflow: hidden;
}

.taxos-calculation-summary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all var(--duration-fast) var(--ease-default);
}

.taxos-calculation-summary:hover {
  background: var(--bg-secondary);
}

.taxos-calculation-summary svg {
  color: var(--astrovia-blue);
  flex-shrink: 0;
}

.taxos-calculation-details[open] .taxos-calculation-summary {
  border-bottom: 1px solid var(--border-light);
}

.taxos-calculation-content {
  padding: var(--space-lg);
}

.taxos-calculation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.taxos-calc-card {
  padding: var(--space-md);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: none;
}

.taxos-calc-card h5 {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.taxos-calc-card ol {
  margin: 0;
  padding-left: var(--space-lg);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.8;
}

.taxos-calc-card ol li {
  margin-bottom: var(--space-2xs);
}

/* Actions alignment */
.taxos-actions--right {
  margin-top: var(--space-md);
  text-align: right;
}

/* Accessible file input wrapper */
.file-input-group {
  position: relative;
}

.file-input-group .form-input[type="file"] {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.file-input-group .form-input[type="file"]::file-selector-button {
  padding: 6px 14px;
  margin-right: var(--space-sm);
  border: none;
  border-radius: var(--radius-full);
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.file-input-group .form-input[type="file"]::file-selector-button:hover {
  background: var(--info-bg);
  border-color: var(--astrovia-blue);
  color: var(--astrovia-blue);
}

/* Upload Zone (Premium Drag & Drop) */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  background: var(--bg-secondary);
}

.upload-zone:hover {
  border-color: var(--astrovia-blue);
  background: var(--info-bg);
}

.upload-zone.dragover {
  border-color: var(--astrovia-blue);
  background: var(--info-bg);
  border-style: solid;
}

.upload-zone svg {
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  transition: all var(--duration-fast) var(--ease-default);
}

.upload-zone:hover svg {
  color: var(--astrovia-blue);
}

.upload-text {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs) 0;
}

.upload-hint {
  font-size: var(--font-size-base);
  color: var(--text-tertiary);
  margin: 0;
}

/* Action Row (Button Container) */
.action-row {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* Content Header (Page Title) */
.content-header {
  margin-bottom: 32px;
}

.content-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.03em;
}

.content-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* Tool Content Container */
.tool-content-inner {
  max-width: 1200px;
  width: 100%;
}

/* Summary Cards (Results Grid) */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* Filter Sections */
.filter-description {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  line-height: 1.6;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
}

.filter-select {
  padding: 10px 36px 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  min-width: 180px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring-sm);
}

/* Carrier-Only Section */
.carrier-only-section {
  margin-top: 24px;
}

/* Enhanced Input Styling */
.input-with-prefix,
.input-with-suffix {
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.input-with-prefix:hover,
.input-with-suffix:hover {
  border-color: var(--border-medium);
}

.input-with-prefix:focus-within,
.input-with-suffix:focus-within {
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring-md);
}

.input-prefix,
.input-suffix {
  padding: 0 16px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-size-md);
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-spinner {
  display: inline-flex;
  align-items: center;
}

.spinner-icon {
  animation: spin 1s linear infinite;
}

/* Logout Button */
.header-content {
  text-align: center;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.logout-btn:hover {
  background: var(--error-subtle);
  border-color: var(--error-border-subtle);
  color: var(--error);
}

.logout-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.logout-btn:hover svg {
  opacity: 1;
}

/* ========================================
   FOUC PREVENTION & APP READY STATE
   ======================================== */
body:not(.app-ready) .content-view {
  display: none !important;
}

body.app-ready #dashboard-view {
  display: block;
}

.title-admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 12px;
  padding: 5px 12px;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: var(--text-on-brand);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

.content-header .content-subtitle {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 10px;
  max-width: 600px;
  letter-spacing: -0.01em;
}

/* ========================================
   USER MANAGEMENT - EXISTING USERS LIST
   Card layout matching Organizations .org-accordion pattern
   Note: .users-list with .ds-accordion-list uses accordion styling
   ======================================== */
.users-list:not(:has(.ds-accordion-list)) {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background: transparent;
  border: none;
  overflow: visible;
  box-shadow: none;
  padding-bottom: var(--space-xl);
}

/* When users-list contains accordion list, remove container styling */
.users-list:has(.ds-accordion-list) {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* User card wrapper - matches Organizations .org-accordion pattern */
.user-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  overflow: visible;
  position: relative;
  z-index: 1;
  transition: box-shadow var(--duration-normal) var(--ease-default), 
              border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              z-index 0s;
}

.user-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card-hover);
  z-index: 100;
}

.user-card:focus-within {
  box-shadow: 0 0 0 1px var(--astrovia-blue);
  border-color: var(--astrovia-blue);
}

/* Empty state for users list */
.users-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  color: var(--text-tertiary);
}

.users-empty-state svg {
  margin-bottom: var(--space-lg);
  opacity: 0.5;
  stroke: var(--empty-icon-color);
}

.users-empty-state h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--empty-title-color);
  margin: 0 0 var(--space-xs) 0;
}

.users-empty-state p {
  font-size: var(--font-size-base);
  color: var(--text-tertiary);
  margin: 0;
}

/* User row - 4-column CSS Grid layout (Apple/Stripe table style) */
.user-card .user-row,
.users-list .user-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  min-height: var(--space-4xl);
  position: relative;
  overflow: visible;
}

/* Column 1 - Identity (avatar + name + email) */
.user-row-col--identity {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
}

.user-row-col--identity .user-avatar {
  width: var(--avatar-md);
  height: var(--avatar-md);
  border-radius: var(--radius-full);
  background: var(--bg-section);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-md);
  flex-shrink: 0;
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-default);
}

.user-row-col--identity .user-avatar:hover {
  border-color: var(--border-accent);
}

.user-row-col--identity .user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-row-col--identity .user-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}

.user-row-col--identity .user-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--line-height-tight);
}

.user-row-col--identity .user-email {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--line-height-tight);
}

/* Column 2 - Access (tools + markets, stacked vertically) */
.user-row-col--access {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  position: relative;
}

.user-row-col--access .access-row {
  display: flex;
  align-items: center;
}

/* Column 3 - Meta (plan badge + status pill + last login, stacked) */
.user-row-col--meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2xs);
  text-align: right;
}

/* Plan badge and status row alignment - right edges aligned */
.user-row-col--meta .badge--plan {
  margin-bottom: 0;
  align-self: flex-end;
}

.user-row-col--meta .status-pill {
  font-size: var(--font-size-xs);
  gap: 4px;
  padding: 2px 0;
  align-self: flex-end;
  line-height: 1;
}

.user-row-col--meta .status-pill-dot {
  width: 5px;
  height: 5px;
}

.user-row-col--meta .status-pill-text {
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.user-row-col--meta .user-last-login {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  line-height: var(--line-height-tight);
}

/* Column 4 - Actions (kebab menu, right-aligned) */
.user-row-col--actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: var(--space-3xl);
}

/* Status pill - reusable pattern across app */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--text-tertiary);
  flex-shrink: 0;
}

.status-pill.status-indicator--active .status-pill-dot {
  background: var(--success);
}

.status-pill.status-indicator--pending .status-pill-dot {
  background: var(--warning);
}

.status-pill.status-indicator--suspended .status-pill-dot {
  background: var(--error);
}

.status-pill.status-indicator--inactive .status-pill-dot {
  background: var(--text-tertiary);
}

.status-pill-text {
  color: var(--text-secondary);
}

/* Remove old hover/focus states from user-row (now on .user-card) */
.user-row:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

.user-row:focus-within {
  box-shadow: none;
}

/* Unified badge base style - consistent across all User Management badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--card-surface-solid, var(--bg-secondary));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--duration-normal) var(--ease-default);
}

/* Tools • X badge with tooltip */
.badge--tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--card-surface-solid, var(--bg-secondary));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  transition: all var(--duration-normal) var(--ease-default);
}

.badge--tools:hover {
  border-color: var(--border-accent);
  background: var(--bg-primary);
}

.badge--tools::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--astrovia-blue);
}

.badge--tools.badge--tools-none {
  color: var(--text-tertiary);
  background: var(--card-surface-solid, var(--bg-secondary));
  border-color: var(--card-border);
  cursor: default;
}

.badge--tools.badge--tools-none::before {
  background: var(--text-tertiary);
  opacity: 0.5;
}

/* Ensure tooltip can overflow parent containers */
.users-list,
.user-card,
.user-card .user-row,
.admin-section {
  overflow: visible !important;
}

/* Tools tooltip popover */
.tools-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  min-width: 180px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-default);
  pointer-events: none;
}

.badge--tools:hover .tools-tooltip {
  pointer-events: auto;
}

.badge--tools:hover .tools-tooltip,
.badge--tools:focus .tools-tooltip {
  opacity: 1;
  visibility: visible;
}

.tools-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  transform: translateX(-50%) rotate(45deg);
}

.tools-tooltip-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.tools-tooltip-item:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.tools-tooltip-item i {
  color: var(--astrovia-blue);
  font-size: var(--font-size-sm);
}

/* Market badge container with grouped flags - consistent badge styling */
.market-badge-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--card-surface-solid, var(--bg-secondary));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-default);
}

.market-badge-container .market-flag {
  font-size: var(--font-size-lg);
  line-height: 1;
}

.market-badge-container.market-badge-empty {
  background: var(--card-surface-solid, var(--bg-secondary));
  border-color: var(--card-border);
  padding: 4px 10px;
}

.market-badge-container.market-badge-empty span {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

/* Market tooltip - hover/focus popover showing market details */
.market-badge-container {
  position: relative;
  cursor: pointer;
}

.market-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-width: 180px;
  box-shadow: var(--card-shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 100;
  transition: opacity var(--duration-fast) var(--ease-default), visibility var(--duration-fast) var(--ease-default);
}

.market-badge-container:hover .market-tooltip,
.market-badge-container:focus .market-tooltip,
.market-badge-container:focus-within .market-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.market-tooltip::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.market-tooltip-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
}

.market-tooltip-item:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}

.market-tooltip-note {
  margin-top: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-light);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  font-style: italic;
  text-align: center;
}

/* Legacy tool count badge - deprecated, use .badge--tools */
.badge--toolcount {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.badge--toolcount-none {
  color: var(--text-tertiary);
  background: transparent;
  border-color: var(--border-lighter);
}

/* Flags cluster - deprecated, use .market-badge-container */
.user-flags-cluster {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

.user-flag {
  font-size: var(--font-size-lg);
  line-height: 1;
  vertical-align: middle;
}

.users-list .user-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.user-avatar {
  width: 57px;
  height: 57px;
  border-radius: var(--radius-full);
  background: var(--info-gradient);
  border: 1px solid var(--avatar-border-photo, var(--neutral-200));
  box-shadow: var(--avatar-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--astrovia-blue);
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: var(--font-size-md);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-list .user-email {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.user-plan .plan-badge {
  position: static !important;
  transform: none !important;
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.user-plan .plan-badge.admin {
  background: var(--astrovia-gradient);
  color: var(--text-on-brand);
}

.user-plan .plan-badge.enterprise {
  background: var(--purple-gradient);
  color: var(--text-on-brand);
}

.user-plan .plan-badge.pro {
  background: var(--success-gradient);
  color: var(--text-on-brand);
}

.user-plan .plan-badge.essential {
  background: var(--info-gradient);
  color: var(--text-on-brand);
}

.user-plan .plan-badge.free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: none;
}

.user-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-md);
  justify-content: space-between;
}

.tool-badge {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--badge-bg);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--astrovia-blue);
  white-space: nowrap;
}

.tax-markets-separator {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border-medium);
  margin: 0 10px;
  vertical-align: middle;
}

.tax-markets-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.tax-market-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl);
  line-height: 1;
  cursor: default;
  transition: transform var(--transition-fast);
}

.tax-market-badge:hover {
  transform: scale(1.2);
}

.user-row .no-tools {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  font-style: italic;
}

.users-list .user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  min-width: auto;
  white-space: nowrap;
}

.user-meta-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.user-meta-top .plan-badge {
  position: static !important;
  transform: none !important;
  display: inline-flex;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.user-meta-top .plan-badge.admin {
  background: var(--astrovia-gradient);
  color: var(--text-on-brand);
}

.user-meta-top .plan-badge.enterprise {
  background: var(--purple-gradient);
  color: var(--text-on-brand);
}

.user-meta-top .plan-badge.pro {
  background: var(--success-gradient);
  color: var(--text-on-brand);
}

.user-meta-top .plan-badge.essential {
  background: var(--info-gradient);
  color: var(--text-on-brand);
}

.user-meta-top .plan-badge.free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: none;
}

/* User last login - tertiary text (v1.7) */
.user-last-login {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Mobile responsive for user cards - stacked layout */
@media (max-width: 768px) {
  .user-card .user-row,
  .users-list .user-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-lg);
  }
  
  .user-card {
    position: relative;
  }
  
  .user-row-col--identity {
    width: 100%;
    padding-right: var(--space-3xl);
  }
  
  .user-row-col--access {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
  
  .user-row-col--access .access-row {
    flex-shrink: 0;
  }
  
  .user-row-col--meta {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-md);
  }
  
  .user-row-col--actions {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    min-width: auto;
  }
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Subtle 3-dot menu button - low contrast */
.btn-icon--subtle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease-default);
}

.btn-icon--subtle:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.btn-icon--subtle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--astrovia-blue);
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-default);
}

.action-btn:hover {
  border-color: var(--border-accent);
  color: var(--astrovia-blue);
  background: var(--info-bg);
}

.action-btn.delete-btn:hover {
  border-color: var(--error-border);
  color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

.action-btn.view-as-btn {
  color: var(--astrovia-blue);
}

.action-btn.view-as-btn:hover {
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
  border-color: var(--astrovia-blue);
}

/* ========================================
   USER MANAGEMENT - INVITE USER FORM V2
   Premium 60/40 grid layout with org selector
   ======================================== */

.invite-user-form {
  padding-top: var(--space-md);
}

.invite-user-grid-v2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.invite-user-fields-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.invite-user-fields-v2 .form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label-optional {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring-input, 0 0 0 3px var(--focus-ring-color, hsla(217, 91%, 60%, 0.1)));
}

.form-helper-text {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-top: var(--space-xs);
}

.invite-user-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-section);
  margin-top: var(--space-md);
}

.invite-user-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
}

.invite-user-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--brand-primary, var(--text-primary));
}

.invite-user-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
}

.invite-user-option-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.invite-user-option-desc {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* Inline highlight for the resolved invite/admin email addresses inside
   the option labels. Renders as a soft monospace pill so the actual
   destination is unmistakable. */
.invite-user-option-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-section, #f1f5f9);
  border: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.08));
  color: var(--text-secondary);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.92em;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: baseline;
  transition: color var(--duration-fast, 150ms) var(--ease-default, ease),
              background var(--duration-fast, 150ms) var(--ease-default, ease),
              border-color var(--duration-fast, 150ms) var(--ease-default, ease);
}

.invite-user-option-pill.is-resolved {
  color: var(--text-primary);
  background: rgba(79, 109, 245, 0.06);
  border-color: rgba(79, 109, 245, 0.18);
}

.invite-user-option-title .invite-user-option-pill {
  margin-left: 4px;
}

.invite-user-actions-v2 {
  padding-top: var(--space-lg);
}

.invite-user-actions-v2 .btn-secondary-v2:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.invite-user-tools-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.tool-access-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tool-access-header .form-label {
  margin-bottom: 0;
}

.tool-access-header .form-helper-text {
  margin-top: 0;
}

.tool-access-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tool-access-row-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-lighter);
  transition: background var(--duration-fast) var(--ease-default);
  background: var(--bg-secondary);
}

.tool-access-row-v2:last-child {
  border-bottom: none;
}

.tool-access-row-v2:hover {
  background: var(--bg-tertiary);
}

.tool-access-name-v2 {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  min-width: 140px;
}

/* Segmented Control - compact toggle UI */
.segmented-control {
  display: inline-flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.segmented-control .segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--radius-md) - 2px);
  transition: all var(--duration-normal) var(--ease-default);
  white-space: nowrap;
}

.segmented-control .segment:hover:not(.active) {
  color: var(--text-secondary);
  background: var(--hover-overlay);
}

.segmented-control .segment.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.segmented-control .segment.active[data-value="full"] {
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
}

/* Segmented Control with Radio Inputs (for forms) */
.segmented-control:has(.segmented-option) {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.segmented-control .segmented-option {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-default);
  white-space: nowrap;
  margin: 0;
}

.segmented-control .segmented-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.segmented-control .segmented-option .segmented-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.segmented-control .segmented-option:hover:not(:has(input:checked)) {
  color: var(--text-primary);
  background: var(--hover-overlay);
}

.segmented-control .segmented-option:has(input:checked) {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.segmented-control .segmented-option:has(input[value="full"]:checked) {
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
}

.segmented-control .segmented-option:has(input:focus-visible) {
  box-shadow: 0 0 0 2px var(--astrovia-blue-light);
}

/* Tool access row with 20px vertical spacing */
.tool-access-row-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-lg);
  border-bottom: 1px solid var(--border-lighter);
  transition: background var(--duration-fast) var(--ease-default);
}

/* Legacy support */
.invite-user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.invite-user-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.invite-user-tools .tool-access-list {
  margin-top: var(--space-sm);
}

.invite-user-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-lighter);
}

/* Users utility bar - search and refresh */
.users-utility-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input-wrapper .form-input {
  padding-left: 36px;
  width: 200px;
}

.form-input-sm {
  height: 34px;
  font-size: var(--font-size-sm);
  padding-top: 6px;
  padding-bottom: 6px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  height: 34px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* Card subtitle styling */
.card-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: var(--space-xs);
  line-height: 1.4;
}

/* User actions dropdown menu */
.user-actions-menu {
  position: relative;
  display: inline-flex;
}

.user-actions-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--duration-fast) var(--ease-default);
}

.user-actions-menu.open .user-actions-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-actions-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
  text-align: left;
}

.user-actions-dropdown-item:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.user-actions-dropdown-item:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.user-actions-dropdown-item:hover {
  background: var(--bg-section);
}

.user-actions-dropdown-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.user-actions-dropdown-item--danger {
  color: var(--error);
}

.user-actions-dropdown-item--danger svg {
  color: var(--error);
}

.user-actions-dropdown-item--danger:hover {
  background: var(--error-tint);
}

/* Admin-only "Resend invite to admin (Astrovia)" preview action.
   Visually subordinate to the regular "Resend invite" but clearly marked
   as an internal/admin tool via the (Astrovia) tag. */
.user-actions-dropdown-item--admin {
  color: var(--text-secondary);
}
.user-actions-dropdown-item--admin svg {
  color: var(--text-tertiary);
}
.user-actions-dropdown-item--admin:hover {
  background: rgba(79, 109, 245, 0.06);
  color: var(--text-primary);
}
.user-actions-dropdown-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(79, 109, 245, 0.10);
  border: 1px solid rgba(79, 109, 245, 0.22);
  color: var(--text-secondary);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  vertical-align: baseline;
}
.user-actions-dropdown-item--admin:hover .user-actions-dropdown-tag {
  color: var(--text-primary);
}

.user-actions-dropdown-divider {
  height: 1px;
  background: var(--border-lighter);
  margin: 4px 0;
}

/* Responsive: Stack invite form on smaller screens */
@media (max-width: 900px) {
  .invite-user-grid-v2 {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .tool-access-row-v2 {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  .tool-access-controls {
    flex-wrap: wrap;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .invite-user-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .users-utility-bar {
    flex-wrap: wrap;
  }
  
  .search-input-wrapper .form-input {
    width: 100%;
  }
}

/* ========================================
   PROFILE PICTURE UPLOAD COMPONENT
   Apple-level polish for user avatar uploads
   ======================================== */
.profile-picture-upload {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.profile-picture-preview {
  width: 77px;
  height: 77px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 2px dashed var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-default);
  flex-shrink: 0;
}

.profile-picture-preview i {
  font-size: var(--font-size-3xl);
  color: var(--text-tertiary);
}

.profile-picture-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-preview.has-image {
  border: 2px solid var(--border-default);
}

.profile-picture-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.btn-text-sm {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--astrovia-blue);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.btn-text-sm:hover {
  background: var(--astrovia-blue-light);
}

.btn-text-sm i {
  font-size: var(--font-size-lg);
}

.btn-text-danger {
  color: var(--error);
}

.btn-text-danger:hover {
  background: var(--error-tint);
}

/* Large profile picture for Edit User modal */
.profile-picture-upload-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.profile-picture-preview-lg {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.profile-picture-preview-lg i {
  font-size: var(--font-size-4xl);
  color: var(--text-tertiary);
}

.profile-picture-preview-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-preview-lg.has-image {
  border-color: var(--astrovia-blue);
}

.profile-picture-actions-lg {
  display: flex;
  gap: var(--space-sm);
}

/* ========================================
   EDIT USER MODAL V2 - Spacious Apple Layout
   ======================================== */
.edit-user-modal-v2 {
  max-width: 640px;
  width: 100%;
}

.edit-user-modal-v2 .modal-body {
  padding: var(--space-xl) var(--space-2xl);
}

.edit-user-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.edit-user-profile-section {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-sm);
}

.edit-user-form-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.edit-user-form-grid .form-group {
  margin-bottom: 0;
}

.edit-user-form-grid .form-input:disabled {
  background: var(--bg-secondary);
  cursor: not-allowed;
  color: var(--text-secondary);
}

.form-label-hint {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
}

.edit-user-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .edit-user-row-2col {
    grid-template-columns: 1fr;
  }
}

.input-with-button {
  display: flex;
  gap: var(--space-xs);
}

.input-with-button .form-input {
  flex: 1;
}

.btn-input-append {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-default);
}

.btn-input-append:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.edit-user-tool-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

/* Spacious tool access list for modals */
.tool-access-list-spacious {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tool-access-list-spacious .tool-access-row-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-secondary);
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border-lighter);
  gap: var(--space-lg);
}

.tool-access-list-spacious .tool-access-row-v2:last-child {
  border-bottom: none;
}

.tool-access-list-spacious .tool-access-row-v2:hover {
  background: var(--bg-white);
}

.tool-access-list-spacious .segmented-control {
  min-width: 220px;
  flex-shrink: 0;
}

/* ========================================
   IMPERSONATION / VIEW AS CLIENT BANNER
   ======================================== */

.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, var(--astrovia-blue) 0%, var(--blue-700) 100%);
  color: var(--text-on-brand);
  padding: 12px 24px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(26, 95, 180, 0.3);
}

.impersonation-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: 1400px;
  width: 100%;
}

.impersonation-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-base);
  font-weight: 500;
}

.impersonation-info svg {
  flex-shrink: 0;
}

.impersonation-label {
  opacity: 0.9;
}

.impersonation-target {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}

.impersonation-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  color: var(--text-on-brand);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.impersonation-exit-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

.impersonation-exit-btn svg {
  flex-shrink: 0;
}

/* Push down the main app when impersonation is active */
body.impersonation-active {
  padding-top: 52px;
}

body.impersonation-active .sidebar {
  position: fixed;
  top: 52px;
  left: 0;
  height: calc(100vh - 52px);
  z-index: 100;
}

body.impersonation-active .app-layout {
  padding-left: var(--sidebar-width);
}

body.impersonation-active .app-layout:has(.sidebar.is-collapsed) {
  padding-left: var(--sidebar-collapsed-width);
}

body.impersonation-active .header {
  top: 52px;
}

@media (max-width: 768px) {
  .impersonation-banner {
    padding: 10px 16px;
  }
  
  .impersonation-banner-content {
    flex-direction: column;
    gap: 12px;
  }
  
  .impersonation-info {
    font-size: var(--font-size-sm);
  }
  
  body.impersonation-active {
    padding-top: 100px;
  }
  
  body.impersonation-active .sidebar {
    position: fixed;
    top: 100px;
    left: 0;
    height: calc(100vh - 100px);
    z-index: 100;
  }
  
  body.impersonation-active .app-layout {
    padding-left: var(--sidebar-width);
  }
}

.user-actions .admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: var(--text-on-brand);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 36px;
  box-sizing: border-box;
}

/* ========================================
   TOOL VIEW LAYOUT FIX
   Remove legacy spacing causing gap at top
   ======================================== */
#profitability-calc-view,
#duty-tax-view,
#landed-cost-view,
#vat-mapper-view {
  padding-top: 0;
}

#profitability-calc-view .content-header,
#duty-tax-view .content-header,
#landed-cost-view .content-header,
#vat-mapper-view .content-header {
  margin-top: 0;
  padding-top: 0;
}

#profitability-calc-view .tool-content-inner,
#duty-tax-view .tool-content-inner,
#landed-cost-view .tool-content-inner,
#vat-mapper-view .tool-content-inner {
  padding-top: 0;
  margin-top: 0;
}

/* Remove min-height from tool wrappers inside content-view */
.content-view .c-shell,
.content-view .lc-shell {
  min-height: auto;
  padding-top: 0;
}

/* Reset first child margins in content views */
.content-view > *:first-child,
.content-view .content-header,
.content-view .tool-content-inner > *:first-child {
  margin-top: 0;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS - USERS LIST (tablet)
   ======================================== */
@media (max-width: 1100px) and (min-width: 769px) {
  .user-card .user-row,
  .users-list .user-row {
    grid-template-columns: minmax(180px, 2fr) minmax(140px, 1.5fr) minmax(120px, 1.5fr) auto;
    gap: var(--space-md);
  }
  
  .user-row-col--access {
    flex-direction: column;
    gap: var(--space-2xs);
  }
  
  .user-row-col--meta {
    gap: var(--space-2xs);
  }
}

/* ========================================
   CRITICAL FIX: Tool View Top Gap Override
   Target specific views with !important to ensure override
   ======================================== */
#profitability-calc-view,
#duty-tax-view,
#landed-cost-view,
#vat-mapper-view {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#profitability-calc-view > .content-header,
#duty-tax-view > .content-header,
#landed-cost-view > .content-header,
#vat-mapper-view > .content-header {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#profitability-calc-view .c-shell,
#duty-tax-view .c-shell,
#landed-cost-view .c-shell,
#vat-mapper-view .c-shell,
#profitability-calc-view .lc-shell,
#duty-tax-view .lc-shell,
#landed-cost-view .lc-shell,
#vat-mapper-view .lc-shell {
  min-height: auto !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  align-items: flex-start !important;
  display: block !important;
}

/* Ensure tool content starts at top */
#profitability-calc-tool,
#duty-tax-tool,
.tool-content-inner {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Remove any vertical centering from main content */
.main-content {
  display: block !important;
  align-items: flex-start !important;
}

/* ========================================
   PROFITABILITY CALCULATOR INPUT STYLES
   ======================================== */

/* Hide number input spinners for cleaner look */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ========================================
   PROFITABILITY CALCULATOR CARDS
   Layout-stable cards that prevent shift during recalculation
   ======================================== */
.prof-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  min-height: var(--prof-card-min-height);
}

.prof-scenario-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: var(--prof-card-min-height);
  contain: layout style;
  overflow: hidden;
}

/* Smooth transition for card content during updates */
.prof-scenario-card > * {
  transition: opacity var(--duration-fast) var(--ease-out);
}

/* During loading, hide new content briefly to prevent flash */
.prof-scenario-card.updating > * {
  opacity: 0;
}

.prof-scenario-card.reveal > * {
  opacity: 1;
}

@media (max-width: 900px) {
  .prof-cards-container {
    grid-template-columns: 1fr;
  }
}

/* Profitability Calculator - scenario card header */
.prof-scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.prof-scenario-title {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.prof-strategy-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.prof-strategy-badge--current {
  background: var(--astrovia-blue);
  border: 1px solid transparent;
}

.prof-strategy-badge--alt {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
}

.prof-strategy-badge__label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prof-strategy-badge--current .prof-strategy-badge__label {
  color: var(--text-on-brand);
}

.prof-strategy-badge--alt .prof-strategy-badge__label {
  color: var(--text-tertiary);
}

/* Order Value Section */
.prof-order-section {
  margin-bottom: 14px;
}

.prof-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prof-order-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prof-section-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prof-section-sublabel {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 4px;
}

.prof-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prof-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.prof-input-prefix {
  position: absolute;
  left: 12px;
  color: var(--astrovia-blue);
  font-size: var(--font-size-base);
  font-weight: 600;
  pointer-events: none;
}

.prof-input-prefix--muted {
  left: 10px;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

/* ============================================================
   PROFITABILITY CALCULATOR - FORM INPUT SECTION
   Compact layout, token-based, responsive, dark mode ready
   ============================================================ */
.prof-form-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-card);
}

.prof-form-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 var(--space-md) 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.prof-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md) var(--space-lg);
}

.prof-form-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.prof-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.prof-form-label {
  font-size: var(--font-size-sm);
  font-weight: 550;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.prof-form-sublabel {
  font-weight: 400;
  color: var(--text-tertiary);
  display: block;
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.3;
}

.prof-form-input-wrap {
  position: relative;
}

.prof-form-currency-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--font-size-sm);
  pointer-events: none;
  line-height: 1;
}

.prof-form-input {
  width: 100%;
  background-color: var(--bg-section);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 var(--space-md) 0 38px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  height: 38px;
  line-height: 38px;
  font-family: inherit;
  transition: border-color var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
  box-sizing: border-box;
}

.prof-form-input--narrow-prefix {
  padding-left: 34px;
}

.prof-form-input:hover {
  border-color: var(--border-strong);
}

.prof-form-input:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring);
  background-color: var(--bg-surface);
}

.prof-form-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.prof-form-select {
  width: 100%;
  background-color: var(--bg-section);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 36px 0 var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  height: 38px;
  line-height: 38px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
  box-sizing: border-box;
}

.prof-form-select:hover {
  border-color: var(--border-strong);
}

.prof-form-select:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring);
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231F51F6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.prof-form-actions {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
}

.theme-dark .prof-form-section {
  background-color: var(--bg-surface);
  border-color: var(--border-card);
  box-shadow: none;
}

.theme-dark .prof-form-input {
  background-color: var(--bg-section);
  border-color: var(--border-card);
  color: var(--text-primary);
}

.theme-dark .prof-form-select {
  background-color: var(--bg-section);
  border-color: var(--border-card);
  color: var(--text-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.theme-dark .prof-form-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--astrovia-blue);
}

.theme-dark .prof-form-select:focus {
  background-color: var(--bg-surface);
  border-color: var(--astrovia-blue);
}

@media (max-width: 900px) {
  .prof-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .prof-form-section {
    padding: var(--space-md);
  }
  
  .prof-form-grid,
  .prof-form-grid--2col {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .prof-form-title {
    font-size: var(--font-size-sm);
  }
}

/* ============================================================
   PROFITABILITY CALCULATOR - ACCORDION/INFO SECTION
   ============================================================ */
.prof-accordion-callout {
  background: var(--bg-section);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--info-border-strong);
}

.prof-accordion-heading {
  font-weight: 600;
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--astrovia-blue);
}

.prof-accordion-heading--lg {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-sm);
}

.prof-accordion-note {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-section);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  border-left: 3px solid var(--info-border-strong);
  line-height: 1.5;
}

.prof-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prof-threshold-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-size-xs);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-card);
}

.prof-threshold-table thead tr {
  background: var(--bg-section);
}

.prof-threshold-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-card);
}

.prof-threshold-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
}

.prof-threshold-table tbody tr:last-child {
  border-bottom: none;
}

.prof-table-label {
  margin-bottom: 4px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--font-size-xs);
}

.prof-table-details {
  font-size: var(--font-size-xs);
  line-height: 1.6;
  color: var(--text-secondary);
}

.prof-table-details div {
  margin-bottom: 2px;
}

.prof-table-details div:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .prof-threshold-table {
    font-size: var(--font-size-xs);
  }
  
  .prof-threshold-table th,
  .prof-threshold-table td {
    padding: var(--space-xs) var(--space-sm);
  }
}

.prof-order-input {
  width: 110px;
  box-sizing: border-box;
  padding: 10px 10px 10px 36px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-lg);
  font-weight: 700;
  text-align: right;
  background: var(--bg-surface);
  color: var(--astrovia-blue);
  transition: all var(--duration-normal);
  box-shadow: var(--shadow-xs);
}

.prof-order-input:focus {
  box-shadow: var(--focus-ring-input);
  outline: none;
}

.prof-dual-hint {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-tertiary);
}

/* Passthrough toggle */
.prof-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-lighter);
}

.prof-toggle-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.prof-toggle-sublabel {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.prof-toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.prof-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.prof-toggle-track {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--neutral-border, var(--border-default));
  transition: var(--duration-slow);
  border-radius: var(--radius-full);
}

.prof-toggle-thumb {
  position: absolute;
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: var(--neutral-0);
  transition: var(--duration-slow);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
}

/* Costs section */
.prof-costs-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.prof-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-lighter);
}

.prof-cost-row--compact {
  padding: 6px 0;
}

.prof-cost-row--no-border {
  border-bottom: none;
}

.prof-cost-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prof-cost-name {
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.prof-cost-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}

.prof-cost-input {
  width: 90px;
  padding: 8px 10px 8px 38px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  text-align: right;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all var(--duration-normal);
  box-shadow: var(--shadow-xs);
}

.prof-cost-input:focus {
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring-input);
  outline: none;
}

.prof-fee-label {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

.prof-fee-value {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  font-feature-settings: 'tnum';
  letter-spacing: -0.01em;
}

.prof-duty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.prof-duty-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.prof-passthrough-badge {
  color: var(--success);
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 3px 8px;
  background: var(--success-tint);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: opacity var(--duration-normal) var(--ease-default), transform var(--duration-normal) var(--ease-default);
}

.prof-passthrough-badge--hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.prof-passthrough-value {
  font-size: var(--font-size-base);
  font-feature-settings: 'tnum';
  letter-spacing: -0.01em;
  transition: opacity var(--duration-normal) var(--ease-default);
}

.prof-passthrough-value--struck {
  text-decoration: line-through;
  opacity: 0.5;
  color: var(--text-tertiary);
}

/* Profit summary box */
.prof-profit-section {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.prof-profit-box {
  background: var(--bg-section);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid var(--border-card);
  transition: opacity var(--duration-fast) var(--ease-default);
}

.prof-profit-box--loss {
  border-color: var(--error-border);
}

.prof-profit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.prof-profit-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prof-profit-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  letter-spacing: -0.01em;
}

.prof-status-badge {
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.prof-status-badge--profit {
  color: var(--success);
  background: var(--success-tint);
  border: 1px solid var(--success-border);
}

.prof-status-badge--loss {
  color: var(--error);
  background: var(--error-tint);
  border: 1px solid var(--error-border);
}

.prof-gross-profit {
  font-size: var(--font-size-xl);
  font-weight: 700;
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  letter-spacing: -0.02em;
  transition: opacity var(--duration-fast) var(--ease-default);
}

.prof-margin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-lighter);
}

.prof-margin-label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}

.prof-margin-value {
  font-size: var(--font-size-lg);
  font-weight: 600;
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
  letter-spacing: -0.01em;
}

/* Currency chip badge */
.prof-currency-chip {
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: 500;
  padding: 3px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  margin-left: 6px;
}

/* Region info bar */
.prof-region-bar {
  background: var(--bg-section);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-card);
}

.prof-region-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.prof-region-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.prof-region-value {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 900px) {
  .prof-region-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .prof-region-grid {
    grid-template-columns: 1fr;
  }
}

/* Dual currency info banner */
.prof-info-banner {
  background: var(--info-bg);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  border-left: 3px solid var(--astrovia-blue);
}

.prof-info-banner__title {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.prof-info-banner__text {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

.prof-info-banner__nested {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  border-left: 2px solid var(--astrovia-blue);
}

.prof-info-banner--alt {
  background: var(--info-bg);
  border-left: 3px solid var(--astrovia-blue);
}

/* Recommendation section */
.prof-recommendation {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

.prof-recommendation__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.prof-recommendation__icon {
  width: 40px;
  height: 40px;
  background: var(--success-tint);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.prof-recommendation__kicker {
  font-size: 11px;
  color: var(--success-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.prof-recommendation__title {
  font-weight: 650;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  letter-spacing: -0.02em;
}

.prof-recommendation__stats {
  background: var(--bg-section);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border-card);
}

.prof-recommendation__stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.prof-recommendation__stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.prof-recommendation__stat-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--success);
}

.prof-recommendation__message {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.prof-recommendation__details {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

@keyframes profLoadingSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

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

@keyframes profValueReveal {
  from { opacity: 0.4; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.prof-card-animate {
  animation: profCardFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.prof-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  z-index: 10;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-default), transform var(--duration-normal) var(--ease-default);
}

.prof-card-overlay.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.prof-loading-bar {
  width: 50%;
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.prof-loading-progress {
  height: 100%;
  width: 30%;
  background: var(--astrovia-blue);
  border-radius: var(--radius-full);
  animation: profLoadingSlide 1s ease-in-out infinite;
}

.prof-card-values-fade {
  transition: opacity var(--duration-instant) ease-out;
}

.prof-card-values-fade.dimmed {
  opacity: 0.4;
}

.prof-value-reveal {
  animation: profValueReveal 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.theme-dark .prof-card-overlay {
  background: rgba(15, 15, 17, 0.65);
}

.theme-dark .prof-scenario-card {
  border: 1px solid var(--border-card);
}

/* ========================================
   SUBSCRIPTION SECTION STYLES
   ======================================== */

.subscription-status {
  margin-bottom: 24px;
}

.subscription-active-badge {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--info-bg);
  border: none;
  border-radius: var(--radius-md);
}

.subscription-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--astrovia-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-brand);
  flex-shrink: 0;
}

.subscription-badge-icon.success {
  background: var(--astrovia-gradient);
}

.subscription-badge-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.subscription-plan-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--astrovia-blue);
}

.subscription-plan-status {
  font-size: var(--font-size-sm);
  color: var(--astrovia-blue);
}

.subscription-manage-btn {
  flex-shrink: 0;
}

.subscription-inactive-notice {
  padding: var(--space-md) var(--space-lg);
  background: var(--indicator-subtle-bg);
  border: none;
  border-radius: var(--radius-md);
  text-align: center;
}

.subscription-inactive-notice p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

/* Subscription Plans Container - Proper Spacing */
.subscription-plans {
  margin-top: var(--space-lg);
}

/* Promo Code Section - Clean Styling */
.promo-code-section {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: none;
  margin-bottom: var(--space-lg);
}

.promo-code-section__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.promo-code-section__label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.promo-code-section__input-group {
  display: flex;
  gap: var(--space-xs);
  flex: 1;
  min-width: 200px;
}

.promo-code-section__input {
  flex: 1;
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  padding: var(--space-xs) var(--space-sm);
}

.promo-code-section__result {
  margin-top: var(--space-sm);
}

.subscription-error {
  padding: var(--space-md) var(--space-lg);
  background: var(--error-bg-solid);
  border: none;
  border-radius: var(--radius-md);
  text-align: center;
}

.subscription-error p {
  margin: 0;
  color: var(--error-dark);
  font-size: var(--font-size-sm);
}

/* Subscription Tabs - Apple-style compact */
.subscription-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.subscription-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.subscription-tab:hover {
  color: var(--text-primary);
}

.subscription-tab.active {
  background: var(--bg-white);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.subscription-tab-content {
  display: block;
}

.subscription-tab-content.hidden {
  display: none;
}

/* Current Plan Card Styles */
.current-plan-card {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.current-plan-card--free {
  background: var(--bg-secondary);
}

.current-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.current-plan-features {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.current-plan-features-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.current-plan-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
}

.current-plan-features-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.current-plan-features-list li.more-features {
  color: var(--text-secondary);
  font-style: italic;
}

.current-plan-cta {
  margin-top: var(--space-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.no-upgrade-options {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

/* Subscription Plans Grid - Compact */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.plan-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all var(--duration-normal) var(--ease-default);
}

.plan-card:hover {
  border-color: var(--astrovia-blue-border);
  box-shadow: var(--shadow-sm);
}

.plan-card.featured {
  border: 2px solid var(--astrovia-blue);
  background: var(--info-bg);
  box-shadow: var(--focus-ring);
}

/* Non-featured cards get tonal backgrounds */
.plan-card:not(.featured) {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.plan-card .plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: var(--text-on-brand);
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-lg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Plan badges in store cards - inline positioning */
.shopify-stores-container .plan-badge,
.admin-card .plan-badge,
.users-list .plan-badge {
  position: static;
  transform: none;
  display: inline-flex;
  padding: 3px 8px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Hyphenated badge variants for store cards */
.plan-badge-free,
.plan-badge.free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: none;
}

.plan-badge-pro,
.plan-badge.pro {
  background: var(--success-gradient);
  color: var(--text-on-brand);
}

.plan-badge-active {
  background: var(--info-bg);
  color: var(--astrovia-blue);
  border: none;
}

.plan-badge-enterprise,
.plan-badge.enterprise {
  background: var(--purple-gradient);
  color: var(--text-on-brand);
}

.plan-badge-pending,
.plan-badge.pending {
  background: var(--warning-bg);
  color: var(--warning-dark);
  border: none;
}

.plan-name {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
  text-align: center;
}

.plan-price {
  text-align: center;
  margin-bottom: var(--space-md);
}

.plan-amount {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--astrovia-blue);
  font-variant-numeric: tabular-nums;
}

.plan-interval {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
}

.plan-description {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 var(--space-5) 0;
  line-height: 1.5;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md) 0;
  flex: 1;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.plan-features li svg {
  color: var(--success);
  flex-shrink: 0;
}

/* Collapsible Features - Show only 3 initially */
.plan-features--collapsed li:nth-child(n+4) {
  display: none;
}

.plan-features--expanded li {
  display: flex;
}

.plan-features-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  background: transparent;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.plan-features-toggle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--astrovia-blue-border);
}

.plan-features-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--duration-normal) var(--ease-default);
}

.plan-features-toggle.expanded svg {
  transform: rotate(180deg);
}

.plan-subscribe-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.plan-card.featured .plan-subscribe-btn {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .plans-grid {
    grid-template-columns: 1fr;
  }
  
  .subscription-active-badge {
    flex-direction: column;
    text-align: center;
  }
  
  .subscription-badge-text {
    align-items: center;
  }
}

/* ========================================
   SUBSCRIPTION PLANS GRID - New Layout
   ======================================== */
.subscription-plans-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.subscription-plan-card {
  position: relative;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all var(--duration-normal);
}

.subscription-plan-card:hover {
  border-color: var(--astrovia-blue);
  box-shadow: var(--shadow-md);
}

.subscription-plan-card.recommended {
  border-color: var(--astrovia-blue);
  background: var(--info-bg);
}

.subscription-plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--astrovia-blue);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscription-plan-name {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.subscription-plan-price {
  margin-bottom: 16px;
}

.subscription-plan-amount {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--astrovia-blue);
}

.subscription-plan-period {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

.subscription-plan-gst {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.subscription-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  flex: 1;
}

.subscription-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

.subscription-plan-features li svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.subscription-plan-spacer {
  flex: 1;
}

.subscription-plan-btn {
  width: 100%;
  margin-top: auto;
}

/* Managed Status View (for managed orgs in subscription section) */
.subscription-managed-status {
  background: var(--bg-surface-subtle);
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
}

.subscription-managed-header {
  margin-bottom: 16px;
}

.subscription-managed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-success-bg);
  border: none;
  color: var(--badge-success-text);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: var(--badge-letter-spacing);
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.subscription-managed-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.subscription-managed-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.subscription-managed-price {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.subscription-managed-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

.subscription-managed-features li {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  padding: 3px 0 3px 14px;
  position: relative;
}

.subscription-managed-features li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--astrovia-blue);
}

.subscription-managed-cta {
  display: flex;
  justify-content: flex-end;
}

/* Managed Services Banner (in upgrade options tab) */
.subscription-managed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface-subtle);
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 4px;
}

.subscription-managed-banner-content {
  flex: 1;
}

.subscription-managed-banner-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.subscription-managed-banner-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin: 0 0 6px 0;
}

.subscription-managed-banner-price {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

@media (max-width: 500px) {
  .subscription-managed-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .subscription-managed-banner button {
    width: 100%;
  }
}

/* ========================================
   LOCKED TOOL STATES
   ======================================== */

.sidebar-nav-item.locked-tool {
  opacity: 0.65;
  position: relative;
}

.sidebar-nav-item.locked-tool:hover {
  opacity: 0.8;
}

.nav-lock-icon {
  margin-left: auto;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}

.tool-selector-card.locked-tool {
  opacity: 0.75;
}

.tool-selector-card.locked-tool:hover {
  opacity: 0.85;
}

.card-lock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-subtle);
  z-index: 5;
}

.card-lock-badge svg {
  flex-shrink: 0;
}

.locked-tool-overlay {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

@media (max-width: 900px) {
  .locked-tool-overlay {
    left: 0;
  }
}

.locked-tool-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.locked-tool-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.locked-tool-content h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.locked-tool-content p {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.upgrade-plan-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: var(--text-on-brand);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal);
  box-shadow: 0 4px 12px var(--astrovia-blue-border);
}

.upgrade-plan-btn:hover {
  box-shadow: 0 6px 20px var(--nexus-approaching-border);
}

.upgrade-plan-btn svg {
  flex-shrink: 0;
}

.under-dev-overlay {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

@media (max-width: 900px) {
  .under-dev-overlay {
    left: 0;
  }
}

.under-dev-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.under-dev-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  background: var(--info-bg);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--astrovia-blue);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.under-dev-content h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.under-dev-content p {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   UPGRADE MODAL
   ======================================== */

.upgrade-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-slow);
}

.upgrade-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.upgrade-modal {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95) translateY(20px);
  transition: all var(--duration-slow);
}

.upgrade-modal-backdrop.active .upgrade-modal {
  transform: scale(1) translateY(0);
}

.upgrade-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.upgrade-modal-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.upgrade-modal-subtitle {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  margin-top: 4px;
}

.upgrade-modal-close {
  background: var(--bg-secondary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--duration-normal);
}

.upgrade-modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.upgrade-modal-plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .upgrade-modal-plans {
    grid-template-columns: 1fr;
  }
}

.upgrade-plan-card {
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--duration-normal);
  position: relative;
}

.upgrade-plan-card:hover {
  border-color: var(--astrovia-blue);
  box-shadow: var(--shadow-md);
}

.upgrade-plan-card.current {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.04);
}

.upgrade-plan-card.recommended {
  border-color: var(--astrovia-blue);
  background: var(--info-bg);
}

.upgrade-plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upgrade-plan-name {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.upgrade-plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 20px;
}

.upgrade-plan-amount {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.upgrade-plan-period {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
}

.upgrade-plan-gst {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.upgrade-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.upgrade-plan-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-lighter);
}

.upgrade-plan-features li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.upgrade-plan-features li:first-child {
  padding-top: 0;
}

.upgrade-plan-features li svg {
  flex-shrink: 0;
}

.upgrade-plan-card .upgrade-plan-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal);
}

.upgrade-plan-card .upgrade-plan-btn:hover {
  background: var(--astrovia-blue-hover);
}

.upgrade-plan-spacer {
  flex: 1;
}

.upgrade-plan-card {
  display: flex;
  flex-direction: column;
}

/* Managed Services Section - Premium, infrastructural, founder-led */
.upgrade-modal-managed {
  margin-top: 20px;
  padding-top: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.managed-services-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  box-shadow: 0 1px 2px var(--hover-overlay);
}

.managed-services-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.managed-services-subtitle {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--text-tertiary);
  margin: 0 0 14px 0;
  line-height: 1.4;
}

.managed-services-price {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px 0;
}

.managed-services-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}

.managed-services-features {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.managed-services-features li {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  padding: 3px 0;
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}

.managed-services-features li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
}

.managed-services-btn {
  display: inline-block;
  background: transparent;
  color: var(--astrovia-blue);
  border: 1px solid var(--astrovia-blue);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal);
  white-space: nowrap;
  flex-shrink: 0;
}

.managed-services-btn:hover {
  background: var(--astrovia-blue);
  color: white;
}

/* Managed Plan Status View (for managed orgs) */
.upgrade-modal-managed-view {
  max-width: 520px;
}

.managed-plan-status {
  padding: 24px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.managed-plan-status-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.managed-plan-status-info {
  flex: 1;
}

.managed-plan-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-success-bg);
  border: none;
  color: var(--badge-success-text);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: var(--badge-letter-spacing);
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.managed-plan-status-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.managed-plan-status-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.managed-plan-status-price {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.managed-plan-status-mark {
  flex-shrink: 0;
  opacity: 0.8;
}

.managed-plan-status-features {
  list-style: none;
  padding: 0;
  margin: 20px 0 24px 0;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

.managed-plan-status-features li {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  padding: 4px 0 4px 16px;
  position: relative;
}

.managed-plan-status-features li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--astrovia-blue);
}

.managed-plan-status-cta {
  display: flex;
  justify-content: flex-end;
}

.managed-plan-status-cta .upgrade-plan-btn {
  padding: 12px 24px;
}

/* ========================================
   DELETE USER MODAL - Design System Aligned
   ======================================== */
.delete-modal-content {
  max-width: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.delete-modal-body {
  text-align: center;
  padding: 32px 32px 24px;
}

.delete-icon-circle {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  background: var(--error-subtle);
  border: 1px solid var(--error-border-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error);
}

.delete-modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.delete-modal-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-md);
  margin: 0 0 4px 0;
  line-height: 1.5;
}

.delete-modal-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-md);
  margin: 0 0 16px 0;
}

.delete-modal-warning {
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  margin: 0;
  line-height: 1.5;
}

.delete-modal-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 32px 28px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-lighter);
}

.delete-modal-btn-cancel {
  padding: 12px 28px;
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.delete-modal-btn-cancel:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.delete-modal-btn-delete {
  padding: 12px 28px;
  background: var(--error);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-on-brand);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  box-shadow: 0 2px 8px var(--error-border-subtle);
}

.delete-modal-btn-delete:hover {
  background: var(--error-dark);
  box-shadow: 0 4px 12px var(--error-border-subtle);
}

/* ========================================
   USER ROW - Fixed Actions Column Alignment
   ======================================== */
.users-list .user-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  align-items: center;
  position: relative;
}

.user-actions .admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: var(--text-on-brand);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 36px;
  box-sizing: border-box;
  min-width: 72px;
}

/* ========================================
   LOGOUT CONFIRMATION MODAL
   ======================================== */

.logout-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.logout-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.logout-modal {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: all var(--duration-normal) var(--ease-default);
}

.logout-modal-backdrop.active .logout-modal {
  transform: scale(1) translateY(0);
}

.logout-modal-icon {
  width: 77px;
  height: 77px;
  margin: 0 auto 20px;
  background: var(--error-bg);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error);
}

.logout-modal-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.logout-modal-text {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.logout-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.logout-modal-cancel {
  padding: 12px 24px;
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.logout-modal-cancel:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.logout-modal-confirm {
  padding: 12px 24px;
  background: var(--error);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-on-brand);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.logout-modal-confirm:hover {
  background: var(--error-dark);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.logout-modal-confirm:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Action button spacer for admin row alignment */
.action-btn-spacer {
  width: 36px;
  height: 36px;
  display: inline-block;
}

/* ========================================
   SHOPIFY INTEGRATION - ANIMATIONS
   ======================================== */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.sync-notification {
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn .spin-animation {
  animation: spin 1s linear infinite;
}

/* Shopify integration badge - Phase 6: Subtle, informational, not alerting */
.shopify-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: transparent;
  color: var(--brand-shopify-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

/* Data source toggle styles */
.data-source-toggle label:hover {
  background: rgba(22, 163, 74, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin: -4px -8px;
}

/* ========================================
   TAX OS STYLES
   ======================================== */

/* Region badges */
.region-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: 0.5px;
}

.region-badge.region-uk {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
}

.region-badge.region-eu {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
}

.region-badge.region-usa {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
}

/* Small button styles */
.c-btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  border: none;
}

.c-btn-small.c-btn-primary {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: var(--text-on-brand);
}

.c-btn-small.c-btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-700) 100%);
}

.c-btn-small.c-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
}

.c-btn-small.c-btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.c-btn-small.c-btn-danger {
  background: var(--error-tint);
  color: var(--error);
  border: none;
}

.c-btn-small.c-btn-danger:hover {
  background: var(--error-bg);
  border-color: var(--error-border);
}

/* Tax report item styling (legacy) */
.tax-report-item {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration-fast) var(--ease-default);
}

.tax-report-item:last-child {
  border-bottom: none;
}

.tax-report-item:hover {
  background: var(--bg-secondary);
}

/* Enhanced Tax Report Cards */
#admin-tax-reports-list.users-list {
  background: transparent;
  border: none;
  box-shadow: none;
}

.tax-report-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  transition: all var(--duration-normal) var(--ease-default);
}

.tax-report-card:hover {
  border-color: var(--astrovia-blue);
  box-shadow: 0 4px 12px var(--astrovia-blue-subtle);
}

.tax-report-card-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.tax-report-flag {
  font-size: var(--font-size-4xl);
  line-height: 1;
}

.tax-report-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tax-report-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tax-report-region {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.tax-report-period {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
}

.tax-report-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
}

.tax-report-client {
  color: var(--text-secondary);
}

.tax-report-amount {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.tax-report-date {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.tax-report-notes {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  font-style: italic;
}

.tax-report-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tax-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

/* PDF download - Use download-badge pattern */
.tax-report-btn.pdf {
  background: var(--status-rose-bg);
  color: var(--text-primary);
  border: 1px solid var(--status-rose-border);
}

.tax-report-btn.pdf:hover {
  background: var(--info-bg);
  color: var(--astrovia-blue);
  border-color: var(--astrovia-blue);
}

/* CSV/Excel download - Use download-badge pattern */
.tax-report-btn.csv {
  background: var(--spreadsheet-green-bg);
  color: var(--text-primary);
  border: 1px solid var(--spreadsheet-green-border);
}

.tax-report-btn.csv:hover {
  background: var(--info-bg);
  color: var(--astrovia-blue);
  border-color: var(--astrovia-blue);
}

/* Delete button - Neutral circular button with red hover */
.tax-report-btn.delete {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: none;
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
}

.tax-report-btn.delete:hover {
  background: var(--status-rose-bg);
  color: var(--status-rose-text);
  border-color: var(--status-rose-border);
}

/* Success message styling */
.success-message {
  padding: var(--space-sm) var(--space-md);
  background: var(--success-bg);
  color: var(--success-dark);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  border: none;
}

/* ========================================
   DESIGN AESTHETICS STYLES
   ======================================== */

.design-icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.design-icon-card {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--duration-normal) var(--ease-default);
}

.design-icon-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px var(--info-bg);
}

.design-icon-card.is-custom {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--green-50) 0%, var(--bg-surface-subtle) 100%);
}

.design-icon-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.design-icon-preview {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-section) 0%, var(--neutral-150) 100%);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.design-icon-preview svg {
  width: 24px;
  height: 24px;
}

.design-icon-info {
  flex: 1;
}

.design-icon-name {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.design-icon-tab {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.design-icon-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: 0.5px;
}

.design-icon-status.status-default {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.design-icon-status.status-custom {
  background: var(--success-bg);
  color: var(--success-dark);
}

.design-icon-editor {
  margin-top: 12px;
}

.design-icon-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--duration-fast) var(--ease-default);
  background: var(--bg-primary);
}

.design-icon-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.design-icon-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.design-icon-actions .c-btn-small {
  flex: 1;
}

.design-icon-updated {
  font-size: var(--font-size-2xs);
  color: var(--text-tertiary);
  margin-top: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.design-icon-updated svg {
  width: var(--space-sm);
  height: var(--space-sm);
}

/* ========================================
   SEGMENTED CONTROL TABS (Modern Tab Pattern)
   Use .taxos-tabs-container and .taxos-tab for all tabbed interfaces
   See DESIGN_SYSTEM.md for usage guidelines
   ======================================== */

/* Shopify logo styling for tab icons */
.tab-shopify-logo {
  width: 16px;
  height: 16px;
}

.tab-shopify-logo .shopify-bag-stroke {
  stroke: currentColor;
  transition: stroke var(--duration-fast) var(--ease-default);
}
.taxos-tabs-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  display: inline-flex;
  gap: 2px;
  margin-bottom: var(--space-xl);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.06);
}

.taxos-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-2) var(--space-5);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) cubic-bezier(0.22,1,0.36,1);
  position: relative;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 36px;
}

.taxos-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-surface-subtle);
}

.taxos-tab:not(.active):active {
  transform: scale(0.97);
}

.taxos-tab.active {
  background: var(--bg-surface);
  color: var(--astrovia-blue);
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-card);
  transform: none;
}

.taxos-tab svg {
  width: var(--space-md);
  height: var(--space-md);
  opacity: 0.5;
  transition: opacity var(--duration-fast) var(--ease-default),
              stroke var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}

.taxos-tab:hover svg {
  opacity: 0.7;
}

.taxos-tab.active svg {
  opacity: 1;
  stroke: var(--astrovia-blue);
}

.taxos-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.taxos-content-card:last-child {
  margin-bottom: 0;
}

.taxos-content-header {
  padding: var(--space-xl) var(--space-xl);
  border-bottom: 1px solid var(--border-lighter);
  background: transparent;
}

.taxos-content-header p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  margin: 0;
}

.taxos-content-body {
  padding: var(--space-xl);
}

.taxos-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  .taxos-tabs-container {
    flex-wrap: wrap;
    width: 100%;
  }
  
  .taxos-tab {
    flex: 1;
    justify-content: center;
    min-width: 140px;
  }
  
  .taxos-form-grid {
    grid-template-columns: 1fr;
  }
}

.taxos-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.taxos-form-field .form-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.taxos-form-field .form-select,
.taxos-form-field .form-input {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-default);
  height: 44px;
}

.taxos-form-field .form-select:hover,
.taxos-form-field .form-input:hover {
  border-color: var(--border-medium);
}

.taxos-form-field .form-select:focus,
.taxos-form-field .form-input:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring);
}

.taxos-actions {
  display: flex;
  gap: var(--space-sm);
  padding-top: var(--space-xs);
}

.taxos-actions .c-btn-primary,
.taxos-actions .c-btn-secondary {
  padding: 12px 24px;
  font-size: var(--font-size-md);
}

/* Generate Report Layout - Premium 2-Column Design */
.generate-report-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 900px) {
  .generate-report-layout {
    grid-template-columns: 1fr;
  }
}

/* New single-column layout with horizontal action bar */
.generate-report-layout-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Action bar - Apple-level centered stacked layout */
.generate-action-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-lg);
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-xl);
  text-align: center;
}

.action-bar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--astrovia-blue-subtle);
  color: var(--astrovia-blue);
  margin-bottom: var(--space-xs);
}

.action-bar-heading {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.action-bar-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  max-width: 400px;
}

.action-bar-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.action-bar-status .error-message,
.action-bar-status .info-message {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.action-bar-status .error-message {
  background: var(--status-rose-bg);
  color: var(--status-rose-text);
  border: 1px solid var(--status-rose-border);
}

.action-bar-status .info-message {
  background: var(--info-bg);
  color: var(--info-text, var(--astrovia-blue));
  border: none;
}

.action-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 14px 40px;
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-top: var(--space-md);
}

/* Responsive: full-width button on mobile */
@media (max-width: 768px) {
  .action-bar-btn {
    width: 100%;
  }
}

.generate-report-config {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.generate-config-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 600px) {
  .generate-config-row {
    grid-template-columns: 1fr;
  }
}

.generate-config-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.generate-config-field .form-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.generate-config-field .form-select {
  padding: 12px 14px;
  font-size: var(--font-size-sm);
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-default);
}

.generate-config-field .form-select:hover {
  border-color: var(--border-medium);
}

.generate-config-field .form-select:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring);
}

.generate-file-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.generate-file-section .form-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.generate-file-upload {
  position: relative;
}

.generate-file-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 24px 20px;
  background: var(--bg-section);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default), background var(--duration-fast) var(--ease-default);
}

.generate-file-zone:hover {
  border-color: var(--blue-300);
  background: var(--blue-50);
}

.generate-file-zone.has-file {
  border-style: solid;
  border-color: var(--blue-500);
  background: var(--blue-50);
}

.generate-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  border: none;
  color: var(--blue-500);
}

.generate-file-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.generate-file-name {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generate-file-name.selected {
  color: var(--astrovia-blue);
  font-weight: 500;
}

/* Blue dashed border variant for upload zone */
.generate-file-zone-blue {
  border: 1px dashed var(--astrovia-blue);
}

.generate-file-zone-blue:hover {
  border-color: var(--astrovia-blue);
  background: var(--astrovia-blue-subtle, var(--astrovia-blue-subtle));
}

/* Default indicator for toggle */
.toggle-default {
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Region Toggle Buttons with Flags */
.region-toggle-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.region-toggle-section .form-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.region-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (max-width: 500px) {
  .region-toggle-group {
    grid-template-columns: 1fr;
  }
}

.region-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default), background var(--duration-fast) var(--ease-default);
  text-align: left;
}

.region-toggle-btn:hover {
  border-color: var(--blue-300);
  background: var(--blue-50);
}

.region-toggle-btn:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: var(--focus-ring-sm);
}

.region-toggle-btn[aria-pressed="true"] {
  border-color: var(--blue-500);
  background: var(--blue-50);
}

.region-toggle-btn[aria-pressed="true"] .region-name {
  color: var(--blue-500);
}

.region-flag {
  font-size: var(--font-size-2xl);
  line-height: 1;
}

.region-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.region-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--duration-fast) var(--ease-default);
}

.region-threshold {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

/* VAT Info - Expandable Apple-style Details */
.vat-info-details {
  margin-top: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  border: none;
  overflow: hidden;
  transition: box-shadow var(--duration-slow) var(--ease-default),
              border-color var(--duration-normal) var(--ease-default);
}

.vat-info-details:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-subtle-hover);
}

.vat-info-details[open] {
  box-shadow: var(--shadow-card);
}

.vat-info-summary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  list-style: none;
  transition: all var(--duration-fast) var(--ease-default);
}

.vat-info-summary::-webkit-details-marker {
  display: none;
}

.vat-info-summary:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.vat-info-summary svg:first-child {
  flex-shrink: 0;
  opacity: 0.6;
}

.vat-info-summary span {
  flex: 1;
}

.vat-info-chevron {
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-default);
  opacity: 0.5;
}

.vat-info-details[open] .vat-info-chevron {
  transform: rotate(180deg);
}

.vat-info-content {
  padding: 0 var(--space-lg) var(--space-lg) var(--space-lg);
  animation: vatInfoFadeIn 0.2s ease;
}

@keyframes vatInfoFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.vat-info-key-rule {
  padding: var(--space-md);
  background: var(--info-bg);
  border-left: 3px solid var(--astrovia-blue);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.vat-info-key-rule strong {
  color: var(--text-primary);
}

.vat-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

@media (max-width: 600px) {
  .vat-info-grid {
    grid-template-columns: 1fr;
  }
}

.vat-info-card {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.vat-info-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

.vat-info-flag {
  font-size: var(--font-size-2xl);
  line-height: 1;
}

.vat-info-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.vat-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.vat-info-list li {
  padding: 4px 0;
  line-height: 1.4;
}

.vat-info-list li strong {
  color: var(--text-primary);
}

.vat-info-rates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.vat-info-rates-label {
  font-weight: 500;
  color: var(--text-secondary);
}

/* VAT Info Card - Enhanced Styles */
.vat-info-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-xs) 0;
  padding: 0 !important;
  list-style: none;
}

.vat-info-example {
  background: var(--bg-secondary);
  padding: var(--space-xs) var(--space-sm) !important;
  border-radius: var(--radius-sm);
  margin-top: var(--space-xs);
  font-style: normal;
}

.vat-info-example em {
  color: var(--text-tertiary);
  font-style: normal;
  font-weight: 500;
}

.vat-info-card-footer {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.vat-info-tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-xs);
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
  border: none;
  background: var(--bg-white);
  color: var(--text-secondary);
}

.vat-info-tag-below {
  background: var(--blue-50);
  border-color: var(--blue-200);
  color: var(--text-brand);
}

.vat-info-tag-above {
  background: var(--bg-section);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

/* VAT Info Process Strip - Refined */
.vat-info-process {
  margin-top: var(--space-xl);
  padding: var(--space-xl) var(--space-lg);
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px var(--hover-overlay);
}

.vat-info-process-header {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--space-xl);
  text-align: center;
}

.vat-info-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-md);
}

.vat-info-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  max-width: 140px;
  padding: var(--space-sm);
}

.vat-step-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--text-brand);
  color: white;
  font-weight: 600;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  box-shadow: 0 2px 8px var(--astrovia-blue-border);
}

.vat-step-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.vat-step-desc {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
}

.vat-info-step-arrow {
  color: var(--text-brand);
  font-size: var(--font-size-xl);
  margin-top: 12px;
  flex-shrink: 0;
  font-weight: 500;
}

@media (max-width: 600px) {
  .vat-info-steps {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }
  
  .vat-info-step {
    max-width: 200px;
  }
  
  .vat-info-step-arrow {
    transform: rotate(90deg);
    margin: 0;
  }
}

/* Threshold Option - Modern Toggle */
.threshold-option-inline {
  display: flex;
  justify-content: center;
  padding: var(--space-md) 0;
  margin-top: var(--space-sm);
}

/* Threshold Option - Centered Layout */
.threshold-option-centered {
  display: flex;
  justify-content: center;
  padding: var(--space-lg) 0;
  margin-top: var(--space-md);
}

.checkbox-container-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.checkbox-container-centered .toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-container-centered .toggle-track {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  transition: background var(--duration-normal) var(--ease-default);
}

.checkbox-container-centered .toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--bg-white);
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform var(--duration-normal) var(--ease-default);
}

.checkbox-container-centered .toggle-input:checked + .toggle-track {
  background: var(--astrovia-blue);
}

.checkbox-container-centered .toggle-input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.checkbox-container-centered:hover .toggle-track {
  background: var(--text-tertiary);
}

.checkbox-container-centered .toggle-input:checked + .toggle-track:hover {
  background: var(--blue-600);
}

.checkbox-container-centered .toggle-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

/* Output Mode Segmented Control */
.output-mode-section {
  margin-top: var(--space-md);
}

.output-mode-segmented {
  display: flex;
  background: var(--bg-section);
  border-radius: var(--radius-lg);
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border-subtle);
}

.output-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  position: relative;
}

.output-mode-btn.active {
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px var(--hover-overlay);
}

.output-mode-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
}

.output-mode-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  transition: color var(--duration-normal) var(--ease-default);
  line-height: 1.3;
}

.output-mode-btn.active .output-mode-label {
  color: var(--text-primary);
}

.output-mode-desc {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--text-tertiary);
  transition: color var(--duration-normal) var(--ease-default);
  line-height: 1.2;
}

.output-mode-btn.active .output-mode-desc {
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .output-mode-segmented {
    flex-direction: column;
  }
}

/* Output Mode Info Disclosure */
.output-mode-info {
  margin-top: 10px;
}

.output-mode-info-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color var(--duration-normal) var(--ease-default);
  text-align: left;
  line-height: 1.4;
}

.output-mode-info-trigger:hover {
  color: var(--text-secondary);
}

.output-mode-info-chevron {
  margin-left: auto;
  transition: transform var(--duration-normal) var(--ease-default);
}

.output-mode-info-trigger[aria-expanded="true"] .output-mode-info-chevron {
  transform: rotate(180deg);
}

.output-mode-info-content {
  display: none;
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.output-mode-info-content.is-open {
  display: block;
  animation: outputInfoFadeIn 0.2s ease;
}

@keyframes outputInfoFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.output-mode-info-card {
  padding: 12px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.output-mode-info-card:last-child {
  margin-bottom: 0;
}

.output-mode-info-heading {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}

.output-mode-info-text {
  font-size: var(--font-size-sm);
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 6px 0;
}

.output-mode-info-text:last-child {
  margin-bottom: 0;
}

.output-mode-info-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.output-mode-info-note {
  font-size: var(--font-size-xs);
  line-height: 1.5;
  color: var(--text-tertiary);
  margin: 8px 0 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-style: italic;
}

.output-mode-info-summary {
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.output-mode-info-summary .output-mode-info-text {
  margin: 0;
  font-weight: 500;
  color: var(--text-primary);
}

/* Tax OS Toggle Row - Compact Side by Side Layout */
.taxos-toggle-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
  margin-top: var(--space-sm);
}

.taxos-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-default);
}

.taxos-toggle:hover {
  background: var(--bg-secondary);
}

.taxos-toggle .toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.taxos-toggle .toggle-track {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  transition: background var(--duration-normal) var(--ease-default);
  flex-shrink: 0;
}

.taxos-toggle .toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--bg-white);
  border-radius: var(--radius-full);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: transform var(--duration-normal) var(--ease-default);
}

.taxos-toggle .toggle-input:checked + .toggle-track {
  background: var(--astrovia-blue);
}

.taxos-toggle .toggle-input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.taxos-toggle:hover .toggle-track {
  background: var(--text-tertiary);
}

.taxos-toggle .toggle-input:checked + .toggle-track:hover {
  background: var(--blue-600);
}

.taxos-toggle-text {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .taxos-toggle-row {
    flex-direction: column;
    gap: var(--space-md);
    align-items: stretch;
  }
  
  .taxos-toggle {
    justify-content: center;
  }
}

/* Exclude Orders Button */
.taxos-exclude-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  margin-left: var(--space-md);
}

.taxos-exclude-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

.taxos-exclude-btn i {
  font-size: var(--font-size-lg);
}

.taxos-exclude-badge {
  background: var(--astrovia-blue);
  color: white;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* Exclude Orders Modal Styles */
.exclude-orders-hint {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.exclude-orders-format {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
}

.exclude-orders-format .format-label {
  color: var(--text-tertiary);
}

.exclude-orders-format code {
  font-family: var(--font-mono);
  background: var(--bg-white);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

.exclude-orders-textarea {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  resize: vertical;
  min-height: 160px;
  transition: border-color var(--duration-fast) var(--ease-default);
}

.exclude-orders-textarea:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: 0 0 0 3px rgba(59, 85, 205, 0.1);
}

.exclude-orders-textarea::placeholder {
  color: var(--text-tertiary);
  opacity: 0.7;
}

.exclude-orders-feedback {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.exclude-orders-feedback.feedback-success {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  color: var(--status-success);
}

.exclude-orders-feedback.feedback-info {
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  color: var(--blue-700);
}

.checkbox-container-modern {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  padding: var(--space-xs) 0;
}

.checkbox-container-modern input {
  display: none;
}

.checkbox-toggle {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-default);
}

.checkbox-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--bg-white);
  border-radius: var(--radius-full);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all var(--duration-fast) var(--ease-default);
}

.checkbox-container-modern input:checked + .checkbox-toggle {
  background: var(--astrovia-blue);
}

.checkbox-container-modern input:checked + .checkbox-toggle::after {
  left: 20px;
}

.checkbox-container-modern:hover .checkbox-toggle {
  background: var(--text-tertiary);
}

.checkbox-container-modern input:checked + .checkbox-toggle:hover {
  background: var(--blue-600);
}

.checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.checkbox-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.checkbox-desc {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* VAT Results Actions - Centered */
.vat-results-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  margin-bottom: var(--space-md);
}

.vat-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 48px;
  font-size: var(--font-size-md);
  font-weight: 600;
  border-radius: var(--radius-lg);
}

.vat-clear-btn {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  padding: var(--space-xs) var(--space-md);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-default);
}

.vat-clear-btn:hover {
  color: var(--text-secondary);
}

/* Confirmation Modal */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.confirm-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.confirm-modal {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform var(--duration-normal) var(--ease-default);
}

.confirm-modal-overlay.active .confirm-modal {
  transform: scale(1);
}

.confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--warning-bg);
  color: var(--warning-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.confirm-modal-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

.confirm-modal-message {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg);
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

.confirm-modal-actions .c-btn-primary {
  background: var(--error);
  border-color: var(--error);
}

.confirm-modal-actions .c-btn-primary:hover {
  background: var(--status-error);
}

/* Clean Action Section */
.generate-action-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-lg);
}

.generate-action-section .error-message,
.generate-action-section .info-message {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  text-align: center;
  max-width: 100%;
}

.generate-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 48px;
  font-size: var(--font-size-md);
  font-weight: 600;
  border-radius: var(--radius-lg);
}

@media (max-width: 500px) {
  .generate-btn-primary {
    width: 100%;
  }
}

/* Legacy - keep for backwards compatibility */
.generate-option-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius-md);
  text-align: center;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  position: relative;
  padding-left: 28px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-checkmark {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  background: var(--bg-white);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-xs);
  transition: all var(--duration-fast) var(--ease-default);
}

.checkbox-container:hover .checkbox-checkmark {
  border-color: var(--astrovia-blue);
}

.checkbox-container input:checked ~ .checkbox-checkmark {
  background: var(--astrovia-blue);
  border-color: var(--astrovia-blue);
}

.checkbox-checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkbox-checkmark:after {
  display: block;
}

.generate-report-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-secondary) 100%);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.action-card-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--astrovia-blue-subtle);
  color: var(--astrovia-blue);
}

.action-card-heading {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.action-card-text {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.action-submit-btn {
  width: 100%;
  max-width: 100%;
  padding: 14px 24px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-top: var(--space-sm);
  box-sizing: border-box;
}

.generate-report-action-card .error-message,
.generate-report-action-card .success-message {
  width: 100%;
  text-align: left;
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
}

.generate-report-action-card .error-message {
  background: var(--status-rose-bg);
  color: var(--status-rose-text);
  border: 1px solid var(--status-rose-border);
}

#generate-error {
  background: var(--status-rose-bg);
  color: var(--status-rose-text);
  border: 1px solid var(--status-rose-border);
}

/* Market Enrollment Grid */
.market-enrollment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

@media (max-width: 900px) {
  .market-enrollment-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .market-enrollment-grid {
    grid-template-columns: 1fr;
  }
}

.market-enrollment-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: all var(--duration-fast) var(--ease-default);
}

.market-enrollment-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
  background: var(--card-interactive-hover-bg);
}

/* Enrolled cards - no fill change, toggle state shows enrollment */
.market-enrollment-card.enrolled {
  /* Keep same styling as non-enrolled - toggle indicates state */
}

.market-enrollment-card .market-flag {
  font-size: var(--font-size-3xl);
  line-height: 1;
}

.market-enrollment-card .market-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.market-enrollment-card .market-name {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

.market-enrollment-card .market-desc {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.market-flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-lg);
}

/* ========================================
   HS CODE CLASSIFIER STYLES
   Quick search pills and result cards
   ======================================== */
.quick-search-pill {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
}

.quick-search-pill:hover {
  background: linear-gradient(135deg, var(--info-bg), var(--purple-50));
  border-color: var(--astrovia-blue);
  color: var(--astrovia-blue);
}

.hs-suggestion-card {
  padding: var(--space-lg) var(--space-xl);
  background: var(--card-surface);
  border: none;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  transition: all var(--duration-normal) var(--ease-default);
}

.hs-suggestion-card:hover {
  border-color: var(--astrovia-blue);
  box-shadow: 0 4px 12px var(--astrovia-blue-subtle);
}

.hs-code-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.hs-code-hs6 {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius-xs);
  border: none;
}

.hs-region-label {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--info-bg);
  color: var(--astrovia-blue);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hs-duty-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--success-bg);
  color: var(--success-dark);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
}

.hs-duty-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--success-bg);
  color: var(--success);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--radius-xs);
  margin-left: 8px;
}

.hs-official-result {
  padding: var(--space-md) var(--space-lg);
  background: var(--card-surface);
  border: none;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transition: all var(--duration-fast) var(--ease-default);
}

.hs-official-result:hover {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
}

.hs-code-mono {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: 600;
  min-width: 120px;
  flex-shrink: 0;
}

.hs-result-description {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.hs-result-duty {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--success-bg);
  color: var(--success-dark);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  flex-shrink: 0;
}

.hs-result-duty.free {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

/* ========================================
   INTEGRATIONS EMPTY STATE
   Enhanced design following Design System
   ======================================== */
.integrations-empty-state {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  max-width: 560px;
  margin: 0;
  box-shadow: var(--card-shadow);
}

.integrations-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-lg);
  background: var(--empty-icon-bg);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--empty-icon-color);
}

.integrations-empty-icon svg {
  width: 36px;
  height: 36px;
  shape-rendering: geometricPrecision;
  stroke-width: 1.5;
}

.integrations-empty-title {
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--empty-title-color);
  letter-spacing: -0.02em;
}

.integrations-empty-text {
  color: var(--text-secondary);
  margin: 0 0 var(--space-2xl) 0;
  font-size: var(--font-size-base);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

.integrations-empty-btn {
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--font-size-base);
  box-shadow: var(--shadow-btn-primary);
}

.integrations-empty-btn:hover {
  box-shadow: var(--shadow-btn-primary-hover);
}

/* ========================================
   ORG INTEGRATIONS EMPTY STATE
   ======================================== */
.integ-org-body {
  padding: 0;
}

.integ-org-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
}

.integ-org-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  background: var(--info-bg);
  color: var(--astrovia-blue);
}

.integ-org-icon-circle--blue {
  background: var(--info-bg);
  color: var(--astrovia-blue);
}

.integ-org-icon-circle--info {
  background: var(--bg-section);
  color: var(--text-secondary);
}

.integ-org-icon-circle--sm {
  width: 48px;
  height: 48px;
  margin-bottom: 0;
}

.integ-org-title {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.integ-org-desc {
  margin: 0 0 var(--space-2xl) 0;
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  max-width: 360px;
  line-height: 1.5;
}

.integ-org-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.integ-org-contact-text {
  text-align: center;
}

.integ-org-contact-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-2xs);
}

.integ-org-contact-sub {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.integ-org-contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--astrovia-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.integ-org-contact-link:hover {
  text-decoration: underline;
}

/* ========================================
   USER INTEGRATIONS TAB - Enhanced Design
   ======================================== */
.user-integration-accordion {
  border-bottom: 1px solid var(--border-lighter);
  transition: all var(--duration-normal) var(--ease-default);
}

.user-integration-accordion:last-child {
  border-bottom: none;
}

.user-integration-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  cursor: pointer;
  transition: background var(--duration-normal) var(--ease-default);
}

.user-integration-header:hover {
  background: var(--bg-secondary);
}

.user-integration-content-tab {
  padding: 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-lighter);
}

.user-integration-store-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border-card);
  transition: all var(--duration-normal) var(--ease-default);
}

.user-integration-store-card:last-child {
  margin-bottom: 0;
}

.user-integration-store-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card-hover);
}

.user-integration-store-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.user-integration-store-domain {
  font-weight: 600;
  font-size: var(--font-size-md);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-integration-store-meta {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

.user-integration-store-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-integration-no-stores {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.user-integration-no-stores p {
  color: var(--text-tertiary);
  font-size: var(--font-size-base);
  margin: 0;
}

/* Action buttons for integrations */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  color: var(--text-secondary);
}

.action-btn:hover {
  border-color: var(--astrovia-blue);
  color: var(--astrovia-blue);
  background: var(--info-bg);
}

.action-btn-primary {
  background: var(--blue-100);
  border-color: transparent;
  color: var(--astrovia-blue);
}

.action-btn-primary:hover {
  background: var(--blue-200);
  border-color: var(--astrovia-blue);
}

.action-btn-secondary {
  background: var(--astrovia-blue);
  border-color: var(--astrovia-blue);
  color: white;
}

.action-btn-secondary:hover {
  background: var(--blue-600);
  border-color: var(--blue-600);
}

.action-btn-danger {
  color: var(--text-tertiary);
}

.action-btn-danger:hover {
  background: var(--error-bg-solid);
  border-color: var(--error);
  color: var(--error);
}

/* ========================================
   AUTHENTICATION PAGES
   Login & Signup - Apple-Level Design
   Award-winning aesthetics with glass morphism
   ======================================== */

/* Auth Container Layout - Animated mesh gradient background */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: #F8FAFC;
  position: relative;
  overflow: hidden;
}

.auth-container::before,
.auth-container::after {
  display: none;
}

.auth-card {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 48px 44px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  z-index: 1;
  animation: card-entrance 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes card-entrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
  }
}

.auth-card.auth-card-wide {
  max-width: 560px;
}

/* Auth Logo Section - Premium spacing */
.auth-logo-section {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.auth-logo-img {
  height: 40px;
  width: auto;
}

.auth-logo-subtitle {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.65;
}

.auth-form-container {
  background: #F8FAFC;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 28px 24px 24px 24px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 580px) {
  .auth-card {
    padding: 36px 28px;
    max-width: calc(100% - 32px);
  }
  
  .auth-form-container {
    padding: 24px 20px 20px 20px;
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 24px 16px;
  }
  
  .auth-card {
    padding: 32px 24px;
    border-radius: 14px;
    max-width: 100%;
  }
  
  .auth-form-container {
    padding: 20px 16px 16px 16px;
  }
  
  .auth-title {
    font-size: var(--font-size-3xl);
  }
  
  .auth-subtitle {
    font-size: var(--font-size-md);
  }
}

@media (max-width: 360px) {
  .auth-card {
    padding: 28px 20px;
  }
  
  .auth-form-container {
    padding: 20px 16px 16px 16px;
  }
}

/* Auth Header - Premium typography */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-title {
  font-size: var(--font-size-3xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px 0;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.auth-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* Auth Form Elements - Spacious and refined */
.auth-form {
  text-align: left;
}

.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-group.has-icon {
  position: relative;
}

.auth-form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.auth-form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 8px;
  font-size: var(--font-size-md);
  color: var(--text-primary);
  background: #FFFFFF;
  transition: all var(--duration-normal) var(--ease-default);
  font-family: inherit;
}

.auth-form-input:hover {
  border-color: var(--border-strong);
}

.auth-form-input:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.auth-form-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Password field with toggle */
.auth-password-wrapper {
  position: relative;
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-default);
  z-index: 10;
}

.auth-password-toggle:hover {
  background: var(--hover-overlay);
  color: var(--text-primary);
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
}

/* Password field with toggle - App version */
.password-input-wrapper {
  position: relative;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-default);
  z-index: 10;
}

.password-toggle-btn:hover {
  background: var(--hover-overlay);
  color: var(--text-primary);
}

.password-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* Auth Error Message */
.auth-error {
  background: var(--error-tint);
  color: var(--error-dark);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: var(--font-size-base);
  margin-bottom: 20px;
  text-align: center;
  display: none;
  border: none;
}

.auth-error.visible {
  display: block;
}

/* Auth Success Message */
.auth-success {
  background: var(--success-tint);
  color: var(--success);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: var(--font-size-base);
  margin-bottom: 20px;
  text-align: center;
  display: none;
  border: 1px solid var(--success-border-strong);
}

.auth-success.visible {
  display: block;
}

/* Auth Primary Button */
.auth-btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: var(--blue-500);
  color: var(--text-on-brand);
  border: none;
  border-radius: 10px;
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.auth-btn-primary::after {
  display: none;
}

.auth-btn-primary:hover:not(:disabled) {
  background: var(--blue-600);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.auth-btn-primary:active:not(:disabled) {
  background: var(--blue-600);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.15);
}

.auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Auth Secondary Button */
.auth-btn-secondary {
  width: 100%;
  padding: 14px 24px;
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.auth-btn-secondary:hover:not(:disabled) {
  border-color: var(--astrovia-blue);
  color: var(--astrovia-blue);
  background: var(--info-bg);
}

/* Auth Surface Button - Refined secondary action button */
.auth-btn-surface {
  width: 100%;
  padding: 14px 24px;
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: 0 1px 2px var(--hover-overlay);
  letter-spacing: -0.01em;
}

.auth-btn-surface:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.auth-btn-surface:active:not(:disabled) {
  background: var(--border-lighter);
  transform: scale(0.99);
}

.auth-btn-surface:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Auth Link - Refined typography */
.auth-link-section {
  text-align: center;
  margin-top: 24px;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

.auth-link-section a {
  color: var(--astrovia-blue);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--duration-normal) var(--ease-default);
}

.auth-link-section a:hover {
  color: var(--astrovia-blue-hover);
  text-decoration: underline;
}

/* Auth Divider - Refined separator */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-divider-text {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Auth OAuth Hint - Subtle helper text */
.auth-oauth-hint {
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* Auth Spinner */
.auth-spinner {
  animation: spin 1s linear infinite;
  display: none;
}

.auth-spinner.visible {
  display: inline-block;
}

/* ========================================
   SIGNUP SPECIFIC STYLES
   Multi-step signup flow
   ======================================== */

/* Progress Steps */
.auth-progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 0;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.auth-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-step-number {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 700;
  background: var(--bg-white);
  color: var(--text-tertiary);
  border: 1.5px solid var(--border-light);
  transition: all var(--duration-slow) var(--ease-default);
}

.auth-step.active .auth-step-number {
  background: var(--astrovia-blue);
  border-color: var(--astrovia-blue);
  color: var(--text-on-brand);
}

.auth-step.completed .auth-step-number {
  background: var(--astrovia-blue);
  border-color: var(--astrovia-blue);
  color: var(--text-on-brand);
}

.auth-step-label {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  font-weight: 500;
}

.auth-step.active .auth-step-label {
  color: var(--text-primary);
  font-weight: 600;
}

.auth-step.completed .auth-step-label {
  color: var(--astrovia-blue);
}

.auth-step-connector {
  width: 32px;
  height: 2px;
  background: var(--border-light);
  margin: 0 12px;
}

.auth-step-connector.completed {
  background: var(--astrovia-blue);
}

/* Step Content */
.auth-step-content {
  display: none;
}

.auth-step-content.active {
  display: block;
}

/* Plans Container for Signup */
.auth-plans-container {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: 48px;
  padding-top: 32px;
  max-width: 1200px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

/* Plan Cards */
.auth-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.auth-plan-card {
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-default);
  position: relative;
}

.auth-plan-card:hover {
  border-color: var(--astrovia-blue);
  box-shadow: var(--shadow-md);
}

.auth-plan-card.selected {
  border-color: var(--astrovia-blue);
  background: var(--info-bg);
  box-shadow: var(--focus-ring-lg), var(--shadow-md);
}

.auth-plan-card.popular {
  border-color: var(--astrovia-blue);
}

.auth-plan-card.popular::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
  font-size: var(--font-size-xs);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-lg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-plan-name {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-plan-price {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--astrovia-blue);
  margin-bottom: 4px;
}

.auth-plan-period {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.auth-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-plan-features li {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-plan-features li svg {
  color: var(--astrovia-blue);
  flex-shrink: 0;
}

/* Info Box in Auth */
.auth-info-box {
  background: var(--info-bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-info-box svg {
  color: var(--astrovia-blue);
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-info-box p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Two-Factor Auth Section */
.auth-2fa-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 20px;
}

.auth-2fa-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-2fa-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.auth-2fa-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: var(--font-size-3xl);
  font-weight: 700;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  transition: all var(--duration-normal) var(--ease-default);
  padding: 0;
  line-height: 56px;
  -moz-appearance: textfield;
}

.auth-2fa-input::-webkit-outer-spin-button,
.auth-2fa-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.auth-2fa-input:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring-input);
}

/* Auth Tagline */
.auth-tagline {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* ========================================
   SIGNUP PLANS SECTION
   Pricing cards and plan selection
   ======================================== */

/* Plans Container - Glass morphism to match auth card */
.signup-plans-container {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-2xl);
  padding: 48px;
  padding-top: 32px;
  max-width: 1200px;
  width: 100%;
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 2px 4px rgba(0, 0, 0, 0.02),
    0 4px 8px rgba(0, 0, 0, 0.02),
    0 8px 16px rgba(0, 0, 0, 0.03),
    0 16px 32px rgba(0, 0, 0, 0.04),
    0 32px 64px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: visible;
  position: relative;
  z-index: 1;
  animation: card-entrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .signup-plans-container {
    animation: none;
  }
}

/* Plans Grid */
.signup-plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
  padding-top: 8px;
}

/* 3-column layout for 3 plans */
.signup-plans-grid.signup-plans-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1200px) {
  .signup-plans-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .signup-plans-grid.signup-plans-grid-3 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 700px;
  }
}

/* Plan Tagline - subtle category label */
.signup-plan-tagline {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px 0;
  min-height: 18px;
}

@media (max-width: 700px) {
  .signup-plans-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .signup-plans-grid.signup-plans-grid-3 {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
  
  .signup-plans-container {
    padding: 32px 24px;
    border-radius: var(--radius-2xl);
  }
}

@media (max-width: 480px) {
  .signup-plans-container {
    padding: 24px 16px;
    border-radius: var(--radius-xl);
  }
  
  .signup-plan-card {
    padding: 28px 24px 24px;
    border-radius: var(--radius-lg);
    min-height: auto;
  }
}

/* Plan Card - Premium glass effect */
.signup-plan-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  padding: 36px 32px 32px;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  position: relative;
  overflow: visible;
  min-height: 420px;
  margin-top: 16px;
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.04);
}

.signup-plan-card:hover {
  border-color: var(--astrovia-blue);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.04);
}

.signup-plan-card.selected {
  border-color: var(--astrovia-blue);
  background: rgba(248, 250, 255, 0.95);
  box-shadow: 
    0 0 0 2px rgba(37, 99, 235, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

.signup-plan-card.recommended:not(.another-selected) {
  border-color: var(--astrovia-blue);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.05);
}

.signup-plan-card.recommended.another-selected:not(.selected) {
  border-color: rgba(226, 232, 240, 0.8);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.04);
}

.signup-plan-card.recommended.selected,
.signup-plan-card.recommended:not(.another-selected):hover {
  border-color: var(--astrovia-blue);
  box-shadow: 
    0 0 0 2px rgba(37, 99, 235, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .signup-plan-card:hover {
    transform: none;
  }
}

/* Plan Badge - Subtle pill badges */
.signup-plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-section);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--border-subtle);
}

/* Most Popular - Blue accent */
.signup-plan-badge.popular {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border: none;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Recommended - Elegant dark navy with sophisticated gold */
.signup-plan-badge.recommended {
  background: linear-gradient(135deg, var(--neutral-800) 0%, var(--neutral-950) 100%);
  color: var(--status-warning);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 
    0 0 0 2px rgba(212, 175, 55, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Legacy premium class fallback */
.signup-plan-badge.premium {
  background: linear-gradient(135deg, var(--neutral-800) 0%, var(--neutral-950) 100%);
  color: var(--status-warning);
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: 
    0 0 0 2px rgba(251, 191, 36, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Plan Name */
.signup-plan-name {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Plan Price */
.signup-plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 16px;
}

.signup-plan-currency {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--text-primary);
}

.signup-plan-amount {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.signup-plan-period {
  font-size: var(--font-size-base);
  color: var(--text-tertiary);
}

.signup-plan-free-label {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--astrovia-blue);
  letter-spacing: -0.02em;
}

/* Plan Description */
.signup-plan-description {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
  min-height: 44px;
}

/* Plan Features */
.signup-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.signup-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.5;
  min-height: 44px;
}

.signup-plan-features li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.signup-plan-features li:first-child {
  padding-top: 0;
}

.signup-plan-features li svg {
  flex-shrink: 0;
}

.signup-plan-features .feature-check {
  color: var(--astrovia-blue);
}

.signup-plan-features .feature-lock {
  color: var(--text-tertiary);
}

/* Plan Select Indicator */
.signup-plan-select-indicator {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease-default);
}

.signup-plan-card.selected .signup-plan-select-indicator {
  background: var(--astrovia-blue);
  border-color: var(--astrovia-blue);
}

/* Back Button */
.signup-back-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 20px;
  transition: color var(--duration-normal) var(--ease-default);
}

.signup-back-btn:hover {
  color: var(--text-primary);
}

/* Terms Text */
.signup-terms-text {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}

.signup-terms-text a {
  color: var(--astrovia-blue);
  text-decoration: none;
  cursor: pointer;
}

.signup-terms-text a:hover {
  text-decoration: underline;
}

/* Modal Overlay */
.auth-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal-overlay.active {
  display: flex;
}

.auth-modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-light);
}

.auth-modal-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

.auth-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease-default);
}

.auth-modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.auth-modal-body {
  padding: 28px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.auth-modal-body h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 12px;
}

.auth-modal-body h3:first-child {
  margin-top: 0;
}

.auth-modal-body p, 
.auth-modal-body li {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.auth-modal-body ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.auth-modal-body li {
  margin-bottom: 8px;
}

/* Password Requirements */
.auth-password-requirements {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* ========================================
   DESIGN SYSTEM UTILITY CLASSES
   Reusable patterns for consistent styling
   ======================================== */

/* Info/Collapsible Sections - Used in Data Mapper and Profitability Calculator */
.ds-info-section,
.vat-info-section {
  margin-bottom: 32px;
  border: none;
  border-radius: var(--radius-accordion);
  padding: 0;
  overflow: hidden;
  background: var(--bg-white);
  box-shadow: var(--shadow-xs);
}

.ds-info-section summary,
.vat-info-section summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  user-select: none;
  padding: 20px 24px;
  background: var(--card-surface);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration-fast) var(--ease-default);
}

.ds-info-section summary:hover,
.vat-info-section summary:hover {
  background: var(--card-surface-hover);
}

.ds-info-section .ds-info-content {
  padding: 24px;
  color: var(--text-primary);
  line-height: 1.7;
  font-size: var(--font-size-md);
}

/* Info Box - Highlighted callout */
.ds-info-box {
  background: var(--bg-secondary);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border-left: 4px solid var(--astrovia-blue);
}

.ds-info-box.info {
  background: var(--info-bg);
  border-color: var(--astrovia-blue);
}

.ds-info-box.warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
}

.ds-info-box.error {
  background: var(--error-tint);
  border-left-color: var(--error);
}

.ds-info-box.success {
  background: var(--success-tint);
  border-left-color: var(--success);
}

/* Code/Formula Box */
.ds-code-box {
  background: var(--bg-secondary);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  color: var(--astrovia-blue);
  margin-bottom: 8px;
}

.ds-code-box.highlight {
  background: var(--info-bg);
  border: 2px solid var(--astrovia-blue);
  font-weight: 700;
}

/* Section Title in tool content */
.ds-section-title {
  font-weight: 600;
  margin: 0 0 12px 0;
  font-size: var(--font-size-md);
  color: var(--text-primary);
}

/* Section Text */
.ds-section-text {
  margin: 0 0 8px 0;
  color: var(--text-secondary);
}

/* Section List */
.ds-section-list {
  margin: 12px 0 0 20px;
  padding: 0;
  color: var(--text-secondary);
}

.ds-section-list li {
  margin-bottom: 6px;
}

.ds-section-list li:last-child {
  margin-bottom: 0;
}

/* Tool Card Patterns */
.ds-tool-card {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.ds-tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}

/* Result Card - for calculation results */
.ds-result-card {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.ds-result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
}

.ds-result-card.success::before {
  background: var(--success);
}

.ds-result-card.warning::before {
  background: var(--warning);
}

.ds-result-card.error::before {
  background: var(--error);
}

/* Input Group Styling */
.ds-input-group {
  margin-bottom: 20px;
}

.ds-input-label {
  display: block;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.ds-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  background: var(--bg-white);
  transition: all var(--duration-normal) var(--ease-default);
  font-family: inherit;
}

.ds-input:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring-input);
}

.ds-input::placeholder {
  color: var(--text-tertiary);
}

/* Select Styling */
.ds-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  background: var(--bg-white);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.ds-select:focus {
  outline: none;
  border-color: var(--astrovia-blue);
  box-shadow: var(--focus-ring-input);
}

/* Button Styles */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  font-family: inherit;
  border: none;
}

.ds-btn-primary {
  background: var(--astrovia-blue);
  color: var(--text-on-brand);
}

.ds-btn-primary:hover:not(:disabled) {
  background: var(--astrovia-blue-hover);
  box-shadow: var(--shadow-btn-primary);
}

.ds-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ds-btn-secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.ds-btn-secondary:hover:not(:disabled) {
  border-color: var(--astrovia-blue);
  color: var(--astrovia-blue);
  background: var(--info-bg);
}

.ds-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.ds-btn-ghost:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Table Styles */
.ds-table-wrapper {
  overflow-x: auto;
  border: none;
  border-radius: var(--radius-md);
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-base);
}

.ds-table th {
  background: var(--table-header-gradient);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}

.ds-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-lighter);
  color: var(--text-secondary);
}

.ds-table tr:last-child td {
  border-bottom: none;
}

.ds-table tr:hover td {
  background: var(--bg-secondary);
}

/* Badge/Tag Styles */
.ds-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--badge-height);
  padding: var(--badge-padding);
  border-radius: var(--badge-radius);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  text-transform: uppercase;
  letter-spacing: var(--badge-letter-spacing);
  white-space: nowrap;
  border: 1px solid transparent;
}

.ds-badge-primary {
  background: var(--badge-info-bg);
  color: var(--badge-info-text);
  border: none;
}

.ds-badge-success {
  background: var(--badge-success-bg);
  color: var(--badge-success-text);
  border: none;
}

.ds-badge-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.ds-badge-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: var(--error-border);
}

/* BEM variant aliases */
.ds-badge--info {
  background: var(--badge-info-bg);
  color: var(--badge-info-text);
  border: none;
}

.ds-badge--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.ds-badge--success {
  background: var(--badge-success-bg);
  color: var(--badge-success-text);
  border: none;
}

/* Empty State */
.ds-empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-tertiary);
}

.ds-empty-state svg {
  margin-bottom: var(--space-lg);
  opacity: 0.5;
  color: var(--empty-icon-color);
}

.ds-empty-state h3 {
  color: var(--empty-title-color);
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-xl);
}

.ds-empty-state p {
  margin: 0;
  font-size: var(--font-size-base);
}

/* Grid Layouts */
.ds-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ds-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ds-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .ds-grid-2,
  .ds-grid-3,
  .ds-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Spacing Utilities */
.ds-mb-sm { margin-bottom: 8px; }
.ds-mb-md { margin-bottom: 16px; }
.ds-mb-lg { margin-bottom: 24px; }
.ds-mb-xl { margin-bottom: 32px; }

.ds-mt-sm { margin-top: 8px; }
.ds-mt-md { margin-top: 16px; }
.ds-mt-lg { margin-top: 24px; }
.ds-mt-xl { margin-top: 32px; }

.ds-p-sm { padding: 8px; }
.ds-p-md { padding: 16px; }
.ds-p-lg { padding: 24px; }
.ds-p-xl { padding: 32px; }

@media (max-width: 480px) {
  .auth-logo-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .auth-logo-divider {
    display: none;
  }
  
  .auth-step-label {
    display: none;
  }
  
  .auth-step-connector {
    width: 24px;
  }
}

/* ========================================
   MARKETS VIEW - Customer Tax Markets Hub
   ======================================== */

/* Markets Summary KPIs */
.markets-summary {
  margin-bottom: 24px;
}

/* Markets Grid */
.markets-kpi-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 12px;
}

.markets-kpi-section .markets-kpi-grid {
  margin-bottom: 0;
  padding-bottom: 0;
}

.markets-grid-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.markets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

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

@media (max-width: 600px) {
  .markets-grid {
    grid-template-columns: 1fr;
  }
}

/* Market Card - Phase 4: Consistent hover affordances */
.market-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default);
}

.market-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--card-shadow-hover);
}

.market-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.market-card-flag {
  font-size: var(--font-size-4xl);
  line-height: 1;
}

.market-card-info {
  flex: 1;
}

.market-card-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.market-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: none;
}

.market-status-pill.active {
  background: var(--badge-success-bg);
  color: var(--badge-success-text);
  border: none;
}

.market-status-pill.pending {
  background: var(--warning-bg-solid);
  color: var(--warning-dark);
  border: none;
}

.market-status-pill.suspended {
  background: var(--error-bg-solid);
  color: var(--error-dark);
  border: none;
}

/* Task B: Market card stats - flat rows, subtle divider instead of nested tiles */
.market-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-muted);
}

/* Task B: Market card stat - simplified flat layout */
.market-card-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}

.market-card-stat-label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.market-card-stat-value {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.market-card-arrow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--space-md);
  color: var(--text-tertiary);
  transition: all var(--duration-normal) var(--ease-default);
}

.market-card:hover .market-card-arrow {
  color: var(--astrovia-blue);
  transform: translateX(4px);
}

/* Market Detail Panel */
.market-detail-panel {
  margin-top: var(--space-xl);
}

.market-detail-header {
  margin-bottom: var(--space-xl);
}

.market-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-md);
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  margin-bottom: var(--space-md);
}

.market-back-btn:hover {
  border-color: var(--astrovia-blue);
  color: var(--astrovia-blue);
  background: var(--info-bg);
}

.market-detail-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.market-detail-flag {
  font-size: var(--font-size-4xl);
  line-height: 1;
}

.market-detail-title h3 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Market Metrics Row */
.market-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  .market-metrics-row {
    grid-template-columns: 1fr;
  }
}

.market-metric-card {
  padding: var(--space-5) var(--space-xl);
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.market-metric-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.market-metric-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Market Reports Section */
.market-reports-section {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-1);
}

.market-reports-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Market Report Item */
.market-report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-default);
}

.market-report-item:hover {
  border-color: var(--astrovia-blue);
  background: var(--info-bg);
  box-shadow: 0 2px 6px var(--astrovia-blue-subtle);
}

.market-report-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.market-report-month {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.market-report-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.market-report-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.market-report-meta-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.market-report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.market-download-btn:hover {
  border-color: var(--astrovia-blue);
  color: var(--astrovia-blue);
  background: var(--info-bg);
}

.market-download-btn svg {
  width: 14px;
  height: 14px;
}

/* Coming Soon Markets */
.markets-coming-soon {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-section);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-md);
}

.markets-coming-soon-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.markets-coming-soon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coming-soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ========================================
   MARKETS LIVE DASHBOARD
   ======================================== */

/* Control Bar - Unified, Aligned */
.markets-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.markets-control-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.markets-control-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.ds-select--compact {
  height: 36px;
  padding: 0 var(--space-md);
  font-size: var(--font-size-sm);
  min-width: 160px;
}

.markets-timestamp {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.markets-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.markets-refresh-btn:hover {
  border-color: var(--astrovia-blue);
  color: var(--astrovia-blue);
  background: var(--astrovia-blue-subtle);
}

.markets-refresh-btn:active {
  transform: scale(0.96);
}

/* Task E: KPI Cards Grid - Clear section separation */
.markets-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: var(--space-md);
  padding-bottom: 0;
}

/* KPI Cards - Borderless Pattern (shadow-only, no border)
   Per Single-Surface Card Law: KPI summary cards use shadow for depth,
   data/market cards retain subtle borders for structural separation */
/* KPI Cards - Unified Hover Pattern (matches analytics-metric-card)
   Per Phase B: All interactive KPI cards use canonical hover behavior */
.markets-kpi-card {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
}

.markets-kpi-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover);
}

.markets-kpi-card:focus-visible {
  outline: none;
  border-color: var(--card-interactive-hover-border);
  box-shadow: var(--focus-ring);
}

.markets-kpi-card-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.markets-kpi-card-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* Task A: Removed --primary variant - all KPI cards have equal visual weight */
/* No special emphasis on any KPI card - user interaction drives selection */

.markets-period-indicator {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

@media (max-width: 1200px) {
  .markets-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .markets-kpi-card:nth-child(4),
  .markets-kpi-card:nth-child(5) {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .markets-control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }
  .markets-control-left {
    flex-wrap: wrap;
  }
  .markets-control-right {
    justify-content: space-between;
  }
  .markets-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Removed --primary span - all cards equal */
  .markets-kpi-card-value {
    font-size: var(--font-size-xl);
  }
}

/* Markets Filter Toggle */
.markets-filter-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  white-space: nowrap;
}

.markets-filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-white);
}

.markets-filter-btn.active {
  background: var(--bg-white);
  color: var(--astrovia-blue);
  box-shadow: var(--shadow-card);
}

/* Markets Overview Grid - Dashboard-matching compact cards */
.markets-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.mo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  box-shadow: none;
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default);
}

.mo-card:hover {
  border-color: var(--border-hover);
  box-shadow: none;
}

.mo-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mo-card-flag {
  font-size: var(--font-size-xl);
  line-height: 1;
  flex-shrink: 0;
}

.mo-card-name {
  flex: 1;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mo-card-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.mo-status--active {
  background: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-50);
}

.mo-status--amber {
  background: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-50);
}

.mo-status--neutral {
  background: var(--text-quaternary);
  box-shadow: 0 0 0 3px var(--bg-surface-subtle);
}

.mo-card-label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .markets-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Markets Live Grid - Consistent Card Layout (legacy) */
.markets-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* Live Market Card - Normalized Height */
.market-live-card {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-normal) var(--ease-standard),
              border-color 200ms var(--ease-standard);
}

.market-live-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover);
}

/* Task C: NOT ENROLLED cards - valid state, not disabled appearance */
.market-live-card.not-enrolled {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
}

.market-live-card.not-enrolled:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover);
}

/* Status Badges - Unified Success Tokens */
.market-status-badge.enrolled {
  background: var(--badge-success-bg) !important;
  color: var(--badge-success-text) !important;
  border: none !important;
}

/* NOT ENROLLED badge - Neutral style */
.market-status-badge.not_enrolled {
  background: var(--badge-neutral-bg) !important;
  color: var(--badge-neutral-text) !important;
  border: none !important;
}

.market-live-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  background: transparent;
}

.market-live-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.market-live-card-flag {
  font-size: var(--font-size-3xl);
  line-height: 1;
}

.market-live-card-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.market-live-card-badges {
  display: flex;
  gap: 6px;
}

.market-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--badge-height);
  padding: var(--badge-padding);
  border-radius: var(--badge-radius);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: var(--badge-letter-spacing);
  white-space: nowrap;
  border: none;
}

/* FILED - Blue theme for clear distinction from ACTIVE */
.market-status-badge.filed { 
  background: var(--astrovia-blue-light-bg); 
  color: var(--astrovia-blue); 
  border: none;
}
.market-status-badge.not_filed { 
  background: var(--status-rose-bg); 
  color: var(--status-rose-text); 
  border: none;
}
.market-status-badge.in_progress { 
  background: var(--info-bg); 
  color: var(--astrovia-blue); 
  border: none;
}
.market-status-badge.awaiting_data { 
  background: var(--warning-bg-solid); 
  color: var(--warning-dark); 
  border: none;
}
.market-status-badge.paid { 
  background: var(--badge-success-bg) !important; 
  color: var(--badge-success-text) !important; 
  border: none !important;
}
.market-status-badge.pending { 
  background: var(--badge-pending-bg); 
  color: var(--badge-pending-text); 
  border: none;
}
.market-status-badge.overdue { 
  background: var(--error-bg-solid); 
  color: var(--error-dark); 
  border: none;
}

.market-status-badge.demo-data { 
  background: var(--neutral-bg);
  color: var(--text-secondary);
  border: none;
}

.market-risk-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.market-risk-dot.green { background: var(--success); }
.market-risk-dot.amber { background: var(--warning); }
.market-risk-dot.red { background: var(--error); }

/* ==========================================================================
   SOURCE BADGES - Nexus Threshold Update Sources
   Used in Nexus Updates tab to display source credibility without competitor names.
   Three types: Official government, Reference doc, Admin override
   ========================================================================== */

.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  margin-right: var(--space-xs);
}

.source-badge:last-child {
  margin-right: 0;
}

/* Official Government - Blue theme for highest credibility */
.source-badge.official_government {
  background: var(--astrovia-blue-light-bg);
  color: var(--astrovia-blue);
  border-color: var(--astrovia-blue-border);
}

/* Reference Doc - Neutral gray for third-party references */
.source-badge.reference_doc {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

/* Admin Override - Subtle amber/warning for manual edits */
.source-badge.admin_override {
  background: var(--warning-bg-solid);
  color: var(--warning-dark);
  border-color: var(--warning-border);
}

/* Container for multiple source badges */
.source-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

/* ========================================
   ADMIN SOURCE DETAIL DRAWER
   Apple/Linear/Notion-style sliding drawer
   ======================================== */

/* Drawer overlay */
.source-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.08);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms var(--ease-default), visibility 240ms var(--ease-default);
}

.source-detail-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Drawer container */
.source-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100%;
  background: var(--bg-white);
  border-left: 1px solid var(--border-subtle);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 240ms ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(16, 24, 40, 0.06);
}

.source-detail-drawer.active {
  transform: translateX(0);
}

/* Drawer header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-white);
}

.drawer-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.drawer-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  font-size: var(--font-size-xl);
}

.drawer-close-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Drawer body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

/* Drawer section */
.drawer-section {
  margin-bottom: var(--space-xl);
}

.drawer-section:last-child {
  margin-bottom: 0;
}

.drawer-section-title {
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.drawer-section-content {
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

/* Source list (admin-only raw sources) */
.source-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.source-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.source-list-item .source-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
}

.source-list-item .source-indicator.fallback {
  background: var(--warning);
}

.source-list-item .source-indicator.failed {
  background: var(--error);
}

/* JSON code block */
.drawer-code-block {
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre;
  overflow-x: auto;
}

.drawer-code-block .json-key {
  color: var(--blue-600);
}

.drawer-code-block .json-string {
  color: var(--blue-800);
}

.drawer-code-block .json-number {
  color: var(--blue-600);
}

.drawer-code-block .json-boolean {
  color: var(--error-icon);
}

.drawer-code-block .json-null {
  color: var(--neutral-500);
}

/* Metadata grid */
.drawer-metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.drawer-metadata-item {
  padding: var(--space-sm);
  background: var(--bg-white);
  border-radius: var(--radius-sm);
}

.drawer-metadata-label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.drawer-metadata-value {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.drawer-metadata-value.success {
  color: var(--success);
}

.drawer-metadata-value.warning {
  color: var(--warning);
}

.drawer-metadata-value.error {
  color: var(--error);
}

/* Status flags */
.drawer-status-flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.drawer-status-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.drawer-status-flag.active {
  background: var(--success-bg-solid);
  color: var(--success-dark);
}

.drawer-status-flag.inactive {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

.drawer-status-flag.warning {
  background: var(--warning-bg-solid);
  color: var(--warning-dark);
}

/* Admin notes section */
.drawer-admin-notes {
  background: var(--warning-bg-solid);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--warning-dark);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

/* Drawer footer */
.drawer-footer {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border-light);
  background: var(--bg-white);
}

.drawer-footer .c-btn-secondary {
  width: 100%;
}

/* View button in table */
.c-btn-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 12px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.c-btn-view:hover {
  background: var(--astrovia-blue-light-bg);
  color: var(--astrovia-blue);
  border-color: var(--astrovia-blue-border);
}

/* ========================================
   MARKET CARD METRICS - FLAT ROWS, NO PILLS
   Surface taxonomy: flat inside card surface
   ======================================== */
.market-live-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  flex: 1;
  padding-top: var(--space-sm);
}

/* FIXED: Removed pill disease - no background, no radius */
.market-live-metric {
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
}

.market-live-metric-label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.market-live-metric-value {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* No highlight class - all metrics equal weight */

/* Market Card Footer - Minimal */
.market-live-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  margin-top: auto;
  background: transparent;
}

.market-auto-badges {
  display: flex;
  gap: var(--space-xs);
}

.auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.auto-badge.enabled {
  color: var(--success);
}

/* ========================================
   MARKETS SEGMENTED CONTROL (Filled Blue Style)
   ======================================== */

.markets-segmented-control {
  display: inline-flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 4px;
  margin-bottom: var(--space-lg);
}

.markets-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--radius-lg) - 2px);
  transition: all var(--duration-normal) var(--ease-default);
  white-space: nowrap;
}

.markets-segment:hover:not(.active) {
  color: var(--text-primary);
  background: var(--hover-overlay);
}

.markets-segment.active {
  background: var(--astrovia-blue);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--astrovia-blue-border);
}

.markets-segment svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.markets-segment.active svg {
  opacity: 1;
}

/* ========================================
   IOSS COUNTRY BREAKDOWN
   ======================================== */

.ioss-summary-banner {
  background: var(--bg-white);
  border: none;
  border-top: 3px solid var(--blue-700);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
}

.ioss-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.ioss-summary-title {
  display: flex;
  align-items: center;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.ioss-number-badge {
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-md);
}

.ioss-number-badge code {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.ioss-summary-kpis {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.ioss-kpi {
  text-align: center;
  min-width: 90px;
}

.ioss-kpi-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.ioss-kpi-label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.ioss-kpi.variance-negative .ioss-kpi-value {
  color: var(--status-rose-text);
}

.ioss-country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.ioss-country-card {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: all var(--duration-normal) var(--ease-default);
}

.ioss-country-card:hover {
  border-color: var(--astrovia-blue);
  box-shadow: var(--shadow-sm);
}

.ioss-country-card.status-error {
  border-left: 3px solid var(--status-rose-border);
}

.ioss-country-card.status-warning {
  border-left: 3px solid var(--warning);
}

.ioss-country-card.status-info {
  border-left: 3px solid var(--info);
}

.ioss-country-card.status-ok {
  border-left: 3px solid var(--success);
}

.ioss-country-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

.ioss-country-flag {
  font-size: var(--font-size-2xl);
}

.ioss-country-name {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.ioss-vat-rate-badge {
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 2px 8px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.ioss-country-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.ioss-country-metric {
  text-align: center;
  padding: var(--space-xs);
}

.ioss-metric-label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.ioss-metric-value {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.ioss-country-footer {
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}

.ioss-variance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-xs);
}

.ioss-variance-label {
  color: var(--text-tertiary);
}

.ioss-variance-value {
  font-weight: 600;
}

.ioss-variance.positive .ioss-variance-value {
  color: var(--success);
}

.ioss-variance.negative .ioss-variance-value {
  color: var(--status-rose-text);
}

/* ========================================
   DUTY REPORTS (HS Code Integration)
   ======================================== */

.duty-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.duty-coverage-card,
.duty-estimate-card {
  padding: var(--space-lg);
}

.duty-coverage-header,
.duty-estimate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.duty-coverage-title,
.duty-estimate-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.duty-coverage-stats {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
}

.duty-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.duty-stat-value {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.duty-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  text-align: center;
}

.duty-estimate-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--astrovia-blue);
}

.duty-estimate-sub {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

.duty-table {
  font-size: var(--font-size-sm);
}

.duty-table code.hs-code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
}

.duty-table .duty-desc {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .duty-summary-cards {
    grid-template-columns: 1fr;
  }
  .duty-coverage-stats {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .ioss-summary-kpis {
    gap: var(--space-md);
  }
  .ioss-kpi {
    min-width: 70px;
  }
  .ioss-country-grid {
    grid-template-columns: 1fr;
  }
}

/* Market Card Variance Row */
.market-variance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) var(--space-sm);
  margin: var(--space-sm) 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
}

.market-variance-label {
  color: var(--text-tertiary);
}

.market-variance-value {
  font-weight: 600;
  color: var(--text-secondary);
}

.market-variance-row.variance-over .market-variance-value {
  color: var(--status-rose-text);
}

.market-variance-row.variance-under .market-variance-value {
  color: var(--success);
}

/* ========================================
   US NEXUS EXPOSURE MAP
   ======================================== */

.nexus-summary-banner {
  background: var(--bg-white);
  border: none;
  border-top: 3px solid var(--astrovia-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.nexus-summary-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.nexus-summary-title svg {
  color: var(--astrovia-blue);
}

.nexus-period-badge {
  font-size: var(--font-size-xs);
  font-weight: 500;
  padding: 4px 10px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
}

.nexus-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.nexus-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.nexus-legend-item strong {
  color: var(--text-primary);
  font-weight: 600;
  margin-left: 4px;
}

.nexus-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.nexus-dot.no-exposure,
.nexus-dot.no_exposure { background: var(--nexus-no-exposure); }
.nexus-dot.approaching { 
  background: var(--nexus-approaching);
  border: 1px solid var(--nexus-approaching-border);
  box-shadow: none;
}
.nexus-dot.obligated { 
  background: var(--nexus-obligated); 
  border: 1px solid var(--nexus-obligated-border);
  box-shadow: none;
}
.nexus-dot.registered { 
  background: var(--nexus-registered); 
  border: 1px solid var(--nexus-registered-border);
  box-shadow: none;
}
.nexus-dot.activated { 
  background: var(--nexus-activated);
  border: 1px solid rgba(167, 139, 250, 0.4);
}
.nexus-dot.no-sales-tax,
.nexus-dot.no_sales_tax { 
  background: var(--nexus-no-sales-tax); 
  border: 2px dashed var(--border-light); 
  box-sizing: border-box; 
}

.nexus-map-container {
  position: relative;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  overflow: visible;
  padding: var(--space-lg);
}

.us-map-svg {
  width: 100%;
  max-width: 880px;
  height: auto;
  margin: 0 auto;
}

.us-map-svg path.state {
  fill: var(--nexus-no-exposure);
  stroke: var(--bg-white);
  stroke-width: 1.5;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  vector-effect: non-scaling-stroke;
}

/* Obligated, approaching, registered - same as selected on hover */
.us-map-svg path.state.obligated:hover,
.us-map-svg path.state.approaching:hover,
.us-map-svg path.state.registered:hover {
  filter: saturate(1.5) contrast(1.12);
}

/* No-exposure and no-sales-tax - subtle blue-grey on hover (same as selected) */
.us-map-svg path.state.no-exposure:hover,
.us-map-svg path.state.no_exposure:hover,
.us-map-svg path.state.no-sales-tax:hover,
.us-map-svg path.state.no_sales_tax:hover {
  fill: var(--nexus-hover, var(--bg-surface-subtle));
  filter: none;
  stroke: var(--bg-white);
  stroke-width: 1.5;
}

.us-map-svg path.state.no-exposure,
.us-map-svg path.state.no_exposure { fill: var(--nexus-no-exposure); }
.us-map-svg path.state.approaching { 
  fill: var(--nexus-approaching); 
  stroke: var(--nexus-approaching-border);
  stroke-width: 1;
}
.us-map-svg path.state.obligated { 
  fill: var(--nexus-obligated); 
  stroke: var(--nexus-obligated-border);
  stroke-width: 1;
}
.us-map-svg path.state.registered { fill: var(--nexus-registered); }
.us-map-svg path.state.activated { fill: var(--nexus-activated); }
.us-map-svg path.state.no-sales-tax,
.us-map-svg path.state.no_sales_tax { fill: var(--nexus-no-sales-tax); }
/* Selected state - only enhance fill for active status states */
.us-map-svg path.state.obligated.selected,
.us-map-svg path.state.approaching.selected,
.us-map-svg path.state.registered.selected { 
  filter: saturate(1.5) contrast(1.12);
}

/* No-exposure and no-sales-tax states get subtle blue-grey fill when selected, no border */
.us-map-svg path.state.no-exposure.selected,
.us-map-svg path.state.no_exposure.selected,
.us-map-svg path.state.no-sales-tax.selected,
.us-map-svg path.state.no_sales_tax.selected {
  fill: var(--neutral-200);
}

/* Map Tooltip - Apple-grade compact card */
.nexus-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  min-width: 220px;
  max-width: 280px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--duration-fast) var(--ease-default), transform var(--duration-fast) var(--ease-default);
}

.nexus-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.nexus-tooltip-title {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nexus-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  padding: var(--space-xs) 0;
  gap: var(--space-lg);
  line-height: 1.4;
}

.nexus-tooltip-row span:first-child {
  flex-shrink: 0;
}

.nexus-tooltip-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
}

/* State Drawer */
.nexus-drawer {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  bottom: var(--space-md);
  width: 320px;
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 50;
  overflow-y: auto;
}

.nexus-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.nexus-drawer-header h4 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.nexus-drawer-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.nexus-drawer-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nexus-drawer-body {
  padding: var(--space-lg);
}

.nexus-drawer-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-lg);
  border: 1px solid transparent;
}

.nexus-drawer-status.no_exposure, 
.nexus-drawer-status.no-exposure { 
  background: var(--bg-tertiary); 
  color: var(--text-secondary); 
  border-color: var(--border-light);
}
.nexus-drawer-status.approaching { 
  background: var(--warning-bg-solid); 
  color: var(--warning-dark); 
  border-color: var(--warning-border);
}
.nexus-drawer-status.obligated { 
  background: var(--error-bg-solid); 
  color: var(--error-dark); 
  border-color: var(--error-border-medium);
}
.nexus-drawer-status.registered { 
  background: var(--success-bg-solid); 
  color: var(--success-dark); 
  border-color: var(--success-border);
}
.nexus-drawer-status.no_sales_tax,
.nexus-drawer-status.no-sales-tax { 
  background: var(--bg-tertiary); 
  color: var(--text-tertiary); 
  border-color: var(--border-light);
  border-style: dashed;
}

.nexus-drawer-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.nexus-metric {
  padding: var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.nexus-metric-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.nexus-metric-value {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
}

.nexus-drawer-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.nexus-progress-item {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
}

.nexus-progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.nexus-progress-fill {
  height: 100%;
  background: var(--astrovia-blue);
  border-radius: var(--radius-lg);
  transition: width var(--duration-slow) var(--ease-default);
}

.nexus-progress-fill.warning { background: var(--warning); }
.nexus-progress-fill.danger { background: var(--error); }

/* Nexus Drawer Action Button */
.nexus-drawer-action {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.nexus-register-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 12px 16px;
  background: var(--error);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-instant) var(--ease-default);
}

.nexus-register-btn:hover {
  background: var(--status-error);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.nexus-register-btn svg {
  flex-shrink: 0;
}

/* Nexus Table */
.nexus-table-section {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.nexus-table th {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.nexus-table td {
  padding: 12px 16px;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--border-light);
}

.nexus-table tbody tr:hover {
  background: var(--bg-secondary);
}

.nexus-table .status-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================================
   TAX FILINGS WORKSPACE
   ======================================== */

.filings-main-content {
  width: 100%;
}

.filings-workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-lg);
  min-height: 500px;
}

@media (max-width: 900px) {
  .filings-workspace {
    grid-template-columns: 1fr;
  }
}

/* Region Sidebar */
.filings-region-sidebar {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.filings-region-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-lighter);
  background: var(--bg-secondary);
}

.filings-region-header h3 {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filings-region-list {
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.filings-region-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  text-align: left;
  width: 100%;
}

.filings-region-item:hover {
  background: var(--bg-tertiary);
}

.filings-region-item.active {
  background: var(--astrovia-blue-subtle);
}

.filings-region-item.active .filings-region-item-name {
  color: var(--astrovia-blue);
  font-weight: 600;
}

.filings-region-item-flag {
  font-size: var(--font-size-3xl);
  line-height: 1;
}

.filings-region-item-info {
  flex: 1;
  min-width: 0;
}

.filings-region-item-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.filings-region-item-type {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.filings-region-item-badge {
  padding: 2px 8px;
  background: var(--success-bg-solid);
  color: var(--success);
  border: none;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-lg);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filings-region-item-badge.pending {
  background: var(--warning-bg-solid);
  color: var(--warning);
  border: none;
}

.filings-empty-regions {
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-tertiary);
}

.filings-empty-regions i {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.filings-empty-regions p {
  margin: 0 0 var(--space-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.filings-empty-regions span {
  font-size: var(--font-size-sm);
}

/* Detail Pane */
.filings-detail-pane {
  background: var(--bg-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  min-height: 400px;
}

.filings-prompt-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 350px;
  text-align: center;
  color: var(--text-tertiary);
}

.filings-prompt-icon {
  width: 77px;
  height: 77px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.filings-prompt-icon i {
  font-size: var(--font-size-3xl);
  color: var(--text-tertiary);
}

.filings-prompt-state h3 {
  margin: 0 0 var(--space-xs);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-secondary);
}

.filings-prompt-state p {
  margin: 0;
  font-size: var(--font-size-sm);
}

/* Region Detail Header */
.filings-region-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-lighter);
  margin-bottom: var(--space-lg);
}

.filings-region-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.filings-region-flag {
  font-size: var(--font-size-4xl);
  line-height: 1;
}

.filings-region-info h2 {
  margin: 0 0 4px;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

.filings-region-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--success-bg-solid);
  color: var(--success);
  border: none;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-lg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filings-region-status.pending {
  background: var(--warning-bg-solid);
  color: var(--warning);
  border: none;
}

/* Month Strip */
.filings-month-strip {
  display: flex;
  gap: 6px;
  padding: var(--space-md) 0;
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

.filings-month-pill {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  white-space: nowrap;
}

.filings-month-pill:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}

.filings-month-pill.active {
  background: var(--astrovia-blue);
  border-color: var(--astrovia-blue);
  color: var(--text-on-brand);
}

.filings-month-pill.has-filing {
  position: relative;
  padding-right: 28px; /* Extra space for the indicator dot */
}

.filings-month-pill.has-filing::after {
  content: '';
  position: absolute;
  top: 50%;
  right: var(--space-sm);
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 2px var(--bg-secondary);
}

.filings-month-pill.active.has-filing::after {
  background: var(--text-on-brand);
  box-shadow: 0 0 0 2px var(--astrovia-blue);
}

/* Documents Panel */
.filings-documents-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.filings-documents-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.filings-documents-header h3 {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
}

.filings-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 12px;
  background: var(--astrovia-blue-light-bg);
  color: var(--astrovia-blue);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid var(--astrovia-blue-border);
}

.filings-status-badge.pending {
  background: var(--warning-bg-solid);
  color: var(--warning-dark);
  border-color: var(--warning-border);
}

.filings-status-badge.active {
  background: var(--success-bg-solid);
  color: var(--success-dark);
  border-color: var(--success-border);
}

/* Billing Status Badges - Tax Reports & Markets (Unified with status-pill) */
.billing-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 12px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.billing-status-badge.paid {
  background: var(--badge-success-bg);
  color: var(--badge-success-text);
  border: none;
}

.billing-status-badge.paid::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--success);
}

.billing-status-badge.pending-payment {
  background: var(--badge-warning-bg) !important;
  color: var(--badge-warning-text) !important;
  border: none !important;
}

.billing-status-badge.pending-payment::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--badge-warning-text);
}

.billing-status-badge.overdue {
  background: var(--error-bg-solid);
  color: var(--error-dark);
  border-color: var(--error-border-medium);
}

.billing-status-badge.overdue::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--error);
}

.billing-status-badge.processing {
  background: var(--info-bg);
  color: var(--astrovia-blue);
  border-color: var(--blue-200);
}

.billing-status-badge.processing::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--astrovia-blue);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

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

.billing-status-badge.auto-pay {
  background: var(--purple-50);
  color: var(--purple-500);
  border-color: var(--purple-200);
}

.billing-status-badge.auto-pay::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--purple-500);
}

/* Auto-pay toggle in admin */
.autopay-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.autopay-toggle-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.autopay-toggle-switch {
  position: relative;
  width: var(--toggle-width);
  height: var(--toggle-height);
  background: var(--toggle-bg-off);
  border-radius: var(--radius-toggle);
  transition: background var(--duration-fast) var(--ease-default);
}

.autopay-toggle-switch::after {
  content: '';
  position: absolute;
  top: var(--toggle-knob-offset);
  left: var(--toggle-knob-offset);
  width: var(--toggle-knob-size);
  height: var(--toggle-knob-size);
  background: var(--bg-surface);
  border-radius: var(--radius-toggle);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration-fast) var(--ease-default);
}

.autopay-toggle.active .autopay-toggle-switch {
  background: var(--success-500);
}

.autopay-toggle.active .autopay-toggle-switch::after {
  transform: translateX(calc(var(--toggle-width) - var(--toggle-knob-size) - var(--toggle-knob-offset) * 2));
}

.filings-select-month-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-tertiary);
}

.filings-select-month-prompt i {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.filings-select-month-prompt p {
  margin: 0;
  font-size: var(--font-size-sm);
}

/* Document Cards */
.filings-document-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.filings-document-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-default);
}

.filings-document-card:hover {
  border-color: var(--astrovia-blue-border);
  box-shadow: var(--shadow-subtle-hover);
}

.filings-document-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.filings-document-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl);
}

.filings-document-icon.excel {
  background: var(--success-bg);
  color: var(--success-dark);
}

.filings-document-icon.pdf {
  background: var(--error-bg);
  color: var(--error-dark);
}

.filings-document-meta h4 {
  margin: 0 0 2px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.filings-document-meta span {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.filings-document-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--astrovia-blue);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-on-brand);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.filings-document-download:hover {
  background: var(--astrovia-blue-hover);
}

.filings-document-download i {
  font-size: var(--font-size-lg);
}

/* No Filing State */
.filings-no-documents {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-tertiary);
}

.filings-no-documents i {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.filings-no-documents h4 {
  margin: 0 0 var(--space-xs);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-secondary);
}

.filings-no-documents p {
  margin: 0;
  font-size: var(--font-size-sm);
}

/* ========================================
   ORGANIZATION MANAGEMENT STYLES
   ======================================== */

.organizations-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  /* No border - accordion items have their own borders */
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

/* Organization Accordion Pattern - Clean, borderless design */
.org-accordion {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-default), background var(--duration-fast) var(--ease-default);
  border: 1px solid var(--border-subtle);
}

.org-accordion:hover {
  background: var(--bg-section);
}

.org-accordion.expanded {
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.org-accordion-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
  border-radius: var(--radius-lg);
}

.org-accordion-header:hover {
  background: var(--hover-overlay);
}

.org-accordion-header:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--astrovia-blue);
}

.org-accordion-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform var(--duration-normal) var(--ease-default);
}

.org-accordion.expanded .org-accordion-chevron {
  transform: rotate(90deg);
}

.org-accordion-body {
  max-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border-top: 0;
  transition: max-height var(--duration-slow) var(--ease-default);
}

.org-accordion.expanded .org-accordion-body {
  max-height: 500px;
  border-top: 1px solid var(--border-light);
}

.org-accordion-body-inner {
  padding: var(--space-md) var(--space-lg);
}

.org-members-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  animation: orgMembersFadeIn 0.3s ease-out;
}

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

/* Skeleton loader for org members */
.org-members-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.org-member-skeleton {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
}

.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-tertiary) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-text {
  height: 12px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-tertiary) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-text.skeleton-name {
  width: 120px;
  height: 14px;
  margin-bottom: 4px;
}

.skeleton-text.skeleton-email {
  width: 160px;
}

.skeleton-text.skeleton-role {
  width: 50px;
  margin-left: auto;
}

@keyframes skeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.org-member-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--card-surface);
  border-radius: var(--radius-md);
}

.org-member-row .member-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  border: 1px solid var(--avatar-border-photo, var(--neutral-200));
  box-shadow: var(--avatar-shadow);
}
