/* Inter font - self-hosted (no Google Font API). Weights: 400, 500, 600, 700. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-Bold.woff2') format('woff2');
}

/* CSS Variables */
:root {
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-foreground: #ffffff;
  --destructive: #ef4444;
  --card: #ffffff;
  --radius: 8px;
  --sidebar-width: 13.5rem;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--muted);
  color: var(--foreground);
  line-height: 1.5;
  font-size: 14px;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--background);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.rsifa-app .sidebar-header {
  height: 72px !important;
  padding: 0 16px 0 10px !important;
  border-bottom: 1px solid var(--border) !important;
  display: flex !important;
  align-items: center !important;
  background: var(--background) !important;
}

.rsifa-app .sidebar-logo {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100%;
}

.rsifa-app .logo-icon {
  width: 36px !important;
  height: 36px !important;
  background: transparent !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.rsifa-app .logo-icon {
  width: 32px;
  height: 32px;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rsifa-app .logo-icon .logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rsifa-app .logo-text h1 {
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: var(--foreground) !important;
  letter-spacing: -0.01em !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.rsifa-app .logo-text p {
  font-size: 10px !important;
  color: var(--muted-foreground) !important;
  line-height: 1.3 !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em !important;
  margin: 0 !important;
  opacity: 0.75;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  padding: 0 16px 8px;
}

.nav-menu {
  list-style: none;
  margin: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  color: var(--foreground);
  text-decoration: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  outline: none !important;
  border: none !important;
}

.nav-item:hover {
  background: var(--muted);
}

.nav-item:focus {
  outline: none !important;
  border: none !important;
}

.nav-item.active {
  background: var(--muted);
  color: var(--primary);
  text-decoration: none;
}

.nav-item svg {
  opacity: 0.7;
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 12px;
}

.sidebar-support-box {
  background: var(--muted);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.sidebar-support-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
  margin-bottom: 4px;
}

.sidebar-support-email {
  display: block;
  font-size: 12px;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-support-email:hover {
  color: var(--primary);
}

.sidebar-footer-separator {
  height: 1px;
  background: var(--border);
  margin-bottom: 12px;
}

/* Custom focus style for buttons and links (keep borders intact) */
button:focus,
a:focus,
.btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px var(--ring);
}

/* Toast Notifications */
.rsifa-toast-container {
  position: fixed;
  top: 32px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.rsifa-toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  animation: rsifaToastSlideIn 0.3s ease;
}

.rsifa-toast.rsifa-toast-hiding {
  animation: rsifaToastSlideOut 0.3s ease forwards;
}

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

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

.rsifa-toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-top: 2px;
}

.rsifa-toast.rsifa-toast-success .rsifa-toast-icon {
  background: #10B981;
  color: white;
}

.rsifa-toast.rsifa-toast-error .rsifa-toast-icon {
  background: var(--destructive);
  color: white;
}

.rsifa-toast.rsifa-toast-info .rsifa-toast-icon {
  background: var(--primary);
  color: white;
}

.rsifa-toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rsifa-toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.4;
}

.rsifa-toast-message {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.rsifa-toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted-foreground);
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.rsifa-toast-close:hover {
  background: var(--muted);
  color: var(--foreground);
}

.footer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--muted-foreground);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.footer-btn:hover {
  color: var(--foreground);
  background: var(--muted);
}

.version {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 12px;
}

/* Main Content */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-header {
  height: 72px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
}

.header-content h2 {
  font-size: 16px;
  font-weight: 600;
}

.header-content p {
  font-size: 13px;
  color: var(--muted-foreground);
}

.main-content {
  flex: 1;
  padding: 24px;
  max-width: 900px;
}

/* Tabs */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 20px 20px 20px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3 svg {
  flex-shrink: 0;
  color: var(--primary);
}

.card-description {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: -12px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.rsifa-support-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.1);
  transition: background 0.15s, color 0.15s;
}

.rsifa-support-link:hover {
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.18);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* margin-bottom: 16px; */
}

.card-header h3 {
  margin: 0;
}

.card-header .card-description {
  margin-top: 4px;
  margin-bottom: 0;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.table-footer {
  margin-top: 12px;
}

.footer-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.footer-actions {
  display: flex;
  gap: 8px;
}

.card-danger {
  border-color: var(--destructive);
}

.card-danger h3 svg {
  color: var(--destructive);
}

.card-danger h3 {
  color: var(--destructive);
}

.table-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Forms */
.rsifa-app .form-group {
  margin-bottom: 16px !important;
}

.rsifa-app .form-group label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-bottom: 6px !important;
  line-height: 1.5 !important;
}

.label-sm {
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground) !important;
}

/* Input fields - ensure WordPress doesn't override */
.rsifa-app .input,
.rsifa-app .select,
.rsifa-app .textarea,
.rsifa-app input[type="text"],
.rsifa-app input[type="email"],
.rsifa-app input[type="password"],
.rsifa-app input[type="number"],
.rsifa-app select,
.rsifa-app textarea {
  width: 100%;
  padding: 8px 12px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  box-shadow: none !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.rsifa-app .input:focus,
.rsifa-app .select:focus,
.rsifa-app .textarea:focus,
.rsifa-app input[type="text"]:focus,
.rsifa-app input[type="email"]:focus,
.rsifa-app input[type="password"]:focus,
.rsifa-app input[type="number"]:focus,
.rsifa-app select:focus,
.rsifa-app textarea:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.rsifa-app .select,
.rsifa-app select {
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  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='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  padding-right: 32px !important;
}

.rsifa-app .select:disabled,
.rsifa-app select:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.select-sm {
  padding: 6px 10px;
  padding-right: 28px;
  font-size: 12px;
}

.rsifa-app .textarea,
.rsifa-app textarea {
  resize: vertical !important;
  min-height: 80px !important;
}

.rsifa-app .form-hint {
  font-size: 12px !important;
  color: var(--muted-foreground) !important;
  margin-top: 4px !important;
  line-height: 1.5 !important;
}

.rsifa-app .form-help-text {
  font-size: 12px !important;
  color: var(--muted-foreground) !important;
  margin-top: 6px !important;
  line-height: 1.5 !important;
}

/* Table select wrapper - for Create New Table button */
.rsifa-table-select-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.rsifa-table-select-wrapper .select {
  flex: 1;
}

.rsifa-create-table-btn {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1;
}

.rsifa-create-table-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.rsifa-create-table-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rsifa-app .form-actions {
  display: flex !important;
  gap: 8px !important;
  margin-top: 20px !important;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: #4f46e5;
  color: var(--primary-foreground);
  text-decoration: none;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--muted);
}

.btn-danger {
  background: var(--destructive);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted-foreground);
  transition: background 0.15s, color 0.15s;
}

.btn-icon:hover {
  background: var(--muted);
  color: var(--foreground);
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
}

.btn-icon.btn-danger:hover {
  color: var(--destructive);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--muted);
  border-radius: 20px;
  transition: 0.2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider:before {
  transform: translateX(16px);
}

.switch-sm {
  width: 32px;
  height: 18px;
}

.switch-sm .slider:before {
  height: 14px;
  width: 14px;
}

.switch-sm input:checked + .slider:before {
  transform: translateX(14px);
}

/* Toggle Label */
.rsifa-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.rsifa-toggle-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  flex: 1;
}

.rsifa-toggle-label:hover .rsifa-toggle-text {
  color: var(--primary);
}

/* Tables */
.table-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

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

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

/* Connections table: column widths so long names don't break layout */
.data-table th.w-16 { width: 64px; }
.data-table th.rsifa-col-form { width: 35%; }
.data-table th.rsifa-col-dest { width: 35%; }
.data-table th.rsifa-col-actions { width: 100px; }

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

/* Form name: truncate long text with ellipsis */
.data-table td.rsifa-col-form-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Destination: two labeled lines (Base / Table) with coloured tags */
.data-table td.rsifa-col-dest {
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  vertical-align: middle;
}

.rsifa-dest-block {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.rsifa-dest-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rsifa-dest-tag {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 4px;
}

.rsifa-dest-tag-base {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}

.rsifa-dest-tag-table {
  background: rgba(100, 116, 139, 0.15);
  color: var(--muted-foreground);
}

.rsifa-dest-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--foreground);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(241, 245, 249, 0.5);
}

.w-10 { width: 40px; }
.w-16 { width: 64px; }
.w-20 { width: 80px; }

/* Form connections: keep action buttons in a horizontal row */
.rsifa-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.rsifa-conn-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rsifa-conn-edit svg {
  flex-shrink: 0;
}
.text-muted { color: var(--muted-foreground); }
.font-medium { font-weight: 500; }
.font-mono { font-family: ui-monospace, monospace; font-size: 12px; }

.form-name-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.form-name-cell .font-medium {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-name-cell .badge-subtle {
  flex-shrink: 0;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
}

.badge-subtle {
  background: var(--muted);
  color: var(--muted-foreground);
}

.badge-success {
  background: var(--success, rgba(16, 185, 129, 0.15));
  color: var(--success-foreground, #059669);
}

/* API Configuration connection status */
.rsifa-connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}

.rsifa-connection-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rsifa-connection-status--connected {
  background: var(--success, rgba(16, 185, 129, 0.15));
  color: var(--success-foreground, #059669);
}

.rsifa-connection-status--connected .rsifa-connection-status-dot {
  background: #059669;
}

.rsifa-connection-status--disconnected {
  background: var(--muted);
  color: var(--muted-foreground);
}

.rsifa-connection-status--disconnected .rsifa-connection-status-dot {
  background: var(--muted-foreground);
}

.rsifa-connection-status--checking .rsifa-connection-status-dot {
  background: var(--primary);
  animation: rsifa-pulse 1s ease-in-out infinite;
}

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

.rsifa-api-card-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.rsifa-disconnect-btn {
  color: var(--muted-foreground);
  padding: 6px;
  border-radius: 6px;
}

.rsifa-disconnect-btn:hover {
  color: var(--destructive);
  background: rgba(239, 68, 68, 0.1);
}

.rsifa-disconnect-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
}

/* Supported form builders list */
.rsifa-supported-forms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.rsifa-supported-form-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.rsifa-form-builder-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--muted);
  color: var(--primary);
}

.rsifa-form-builder-icon-wrap .rsifa-form-builder-icon {
  width: 18px;
  height: 18px;
}

.rsifa-supported-form-item .rsifa-form-name {
  font-weight: 500;
  color: var(--foreground);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.status-success .status-dot {
  background: #16a34a;
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--destructive);
}

.status-error .status-dot {
  background: var(--destructive);
}

.status-pending {
  background: var(--muted);
  color: var(--muted-foreground);
}

.status-pending .status-dot {
  background: var(--muted-foreground);
}

/* Dropdown */
.btn-icon {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 160px;
  z-index: 1000;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--foreground);
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-menu a:hover {
  background: var(--muted);
}

.dropdown-menu a.text-danger {
  color: var(--destructive);
}

/* Expandable Rows */
.expandable-row {
  cursor: pointer;
}

.expand-icon {
  display: inline-block;
  transition: transform 0.2s;
  color: var(--muted-foreground);
  font-size: 10px;
}

.expandable-row.expanded .expand-icon {
  transform: rotate(90deg);
}

.expanded-content td {
  background: var(--muted);
  padding: 16px !important;
}

.expanded-data {
  font-size: 13px;
}

.expanded-data .font-medium {
  margin-bottom: 8px;
}

.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.error-message {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--destructive);
  border-radius: var(--radius);
  font-size: 12px;
}

.rsifa-retry-note {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: var(--radius);
  font-size: 12px;
}

.rsifa-excluded-fields {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
}

.rsifa-excluded-fields ul {
  margin: 6px 0 0 0;
  padding-left: 20px;
}

.rsifa-excluded-fields li {
  margin-bottom: 4px;
}

.rsifa-excluded-field-name {
  font-weight: 600;
}

.rsifa-excluded-field-reason {
  color: var(--muted-foreground);
  font-size: 11px;
}

/* Filters Bar */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
}

.search-input .input,
.search-input input[type="text"] {
  padding: 8px 12px 8px 36px !important;
}

/* Mapping Editor */
/* Mapping form grid 2x2 */
.rsifa-app .mapping-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.rsifa-app .form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Field mappings table header */
.rsifa-app .mapping-table-header {
  display: grid;
  grid-template-columns: 1fr 40px 1fr 40px;
  gap: 12px;
  padding: 12px 16px;
  background: var(--muted);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.rsifa-app .mapping-header-col {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

/* Align header labels with 4-column mapping grid:
 * first label spans "form field" + arrow column,
 * second label spans "airtable column" + actions column.
 */
.rsifa-app .mapping-table-header .mapping-header-col:first-child {
  grid-column: 1 / span 2;
}

.rsifa-app .mapping-table-header .mapping-header-col:last-child {
  grid-column: 3 / span 2;
}

/* Mapping row */
.rsifa-app .mapping-row {
  display: grid;
  grid-template-columns: 1fr 40px 1fr 40px;
  gap: 12px;
  padding: 8px 16px;
  align-items: center;
  border-radius: var(--radius);
  transition: background 0.15s;
  margin-bottom: 8px;
}

.rsifa-app .mapping-row:hover {
  background: var(--muted);
}

.rsifa-app .mapping-col {
  display: flex;
  align-items: center;
}

.rsifa-app .mapping-col-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 4px;
}

.rsifa-app .mapping-col select,
.rsifa-app .mapping-col input {
  width: 100%;
}

.rsifa-app .rsifa-create-column-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: #2563eb;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.rsifa-app .rsifa-create-column-link svg {
  width: 12px;
  height: 12px;
}

.rsifa-app .rsifa-create-column-link:hover {
  text-decoration: underline;
}

.rsifa-app .rsifa-create-table-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: #2563eb;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.rsifa-app .rsifa-create-table-link svg {
  width: 12px;
  height: 12px;
}

.rsifa-app .rsifa-create-table-link:hover {
  text-decoration: underline;
}

.rsifa-app .mapping-col-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  font-size: 16px;
}

.rsifa-app .mapping-col-action {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rsifa-app .mapping-col-action button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.rsifa-app .mapping-col-action button:hover {
  background: var(--destructive);
  border-color: var(--destructive);
  color: white;
}

.rsifa-app .mapping-col-action button svg {
  width: 16px;
  height: 16px;
}

/* Card header for field mappings */
.rsifa-app .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.rsifa-app .card-header h3 {
  margin: 0;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}

.pricing-card-featured {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
}

.pricing-header {
  text-align: center;
  margin-bottom: 24px;
}

.pricing-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 36px;
  font-weight: 700;
}

.pricing-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.pricing-features {
  list-style: none;
  margin-bottom: 24px;
}

.pricing-features li {
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* Settings */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

.setting-info h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  line-height: 1.3;
}

.setting-info p {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.4;
  margin: 0;
}

/* Modals - Scoped properly */
.modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10000 !important;
}

.modal.show {
  display: flex !important;
}

.modal-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
}

.modal-content {
  position: relative !important;
  background: var(--background) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
  width: 100% !important;
  max-width: 420px !important;
  max-height: 90vh !important;
  overflow: auto !important;
  animation: modalIn 0.2s ease !important;
  z-index: 10001 !important;
}

.modal-lg {
  max-width: 560px !important;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 20px !important;
  border-bottom: 1px solid var(--border) !important;
}

.modal-header h3 {
  font-size: 16px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  color: var(--foreground) !important;
  line-height: 1.4 !important;
}

.modal-close {
  background: none !important;
  border: none !important;
  font-size: 24px !important;
  color: var(--muted-foreground) !important;
  cursor: pointer !important;
  line-height: 1 !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  transition: all 0.15s !important;
  padding: 0 !important;
}

.modal-close:hover {
  color: var(--foreground) !important;
  background: var(--muted) !important;
}

.modal-body {
  padding: 20px !important;
}

.modal-body .form-group {
  margin-bottom: 16px !important;
}

.modal-body .form-group:last-child {
  margin-bottom: 0 !important;
}

.modal-footer {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  padding: 16px 20px !important;
  border-top: 1px solid var(--border) !important;
}

.modal-footer .btn {
  margin: 0 !important;
}

/* Ensure modal buttons are styled correctly */
.modal .btn,
.modal button.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: var(--radius) !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  border: 1px solid transparent !important;
  line-height: 1.5 !important;
}

.modal .btn-primary {
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-color: var(--primary) !important;
}

.modal .btn-primary:hover {
  background: #5558e3 !important;
  border-color: #5558e3 !important;
}

.modal .btn-outline {
  background: transparent !important;
  color: var(--foreground) !important;
  border-color: var(--border) !important;
}

.modal .btn-outline:hover {
  background: var(--muted) !important;
}

/* Ensure modal form elements are styled */
.modal .form-group {
  margin-bottom: 16px !important;
}

.modal .form-group label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-bottom: 6px !important;
  color: var(--foreground) !important;
  line-height: 1.5 !important;
}

.modal .input,
.modal .select,
.modal .textarea,
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="password"],
.modal select,
.modal textarea {
  width: 100% !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  box-shadow: none !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.modal .input:focus,
.modal .select:focus,
.modal .textarea:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.modal select {
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  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='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  padding-right: 32px !important;
}

.modal .textarea {
  resize: vertical !important;
  min-height: 80px !important;
}

.connection-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  color: var(--muted-foreground);
}

.arrow-line {
  width: 40px;
  height: 1px;
  background: var(--border);
}

.arrow-icon {
  font-size: 16px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 56px 40px;
  color: var(--muted-foreground);
  background: var(--muted);
  border-radius: 12px;
  margin-top: 20px;
}

.empty-state h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  max-width: 420px;
}

.empty-state svg {
  opacity: 0.35;
  color: var(--muted-foreground);
}

/* Card Header with Actions */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  margin-top: 16px;
  padding-bottom: 12px;
  /* border-bottom: 1px solid var(--border); */
}

.card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.rsifa-toggle-view {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rsifa-toggle-view:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.rsifa-toggle-view:hover svg {
  stroke: var(--primary-foreground);
}

/* Bases Grid */
.rsifa-bases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.rsifa-base-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.rsifa-base-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.rsifa-base-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  /* margin-bottom: 12px; */
}

.rsifa-base-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}

.rsifa-base-icon svg {
  width: 20px;
  height: 20px;
}

.rsifa-base-info {
  flex: 1;
  min-width: 0;
}

.rsifa-base-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--foreground);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rsifa-base-id {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 11px;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.rsifa-base-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.rsifa-base-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.rsifa-base-stat svg {
  width: 14px;
  height: 14px;
}

.rsifa-base-stat-value {
  font-weight: 600;
  color: var(--foreground);
}

.rsifa-base-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.rsifa-base-action-btn {
  flex: 1;
  padding: 6px 12px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.rsifa-base-action-btn:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.rsifa-base-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #10b981;
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Base Tables Section */
.rsifa-base-tables {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.rsifa-base-tables-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #e9d5ff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  user-select: none;
  position: relative;
}

.rsifa-base-tables-header:hover {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-color: #c7d2fe;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

.rsifa-base-tables-header svg:first-child {
  color: var(--primary);
}

.rsifa-base-tables-header span {
  flex: 1;
}

.rsifa-base-tables-header::after {
  content: 'Click to expand';
  font-size: 10px;
  font-weight: 400;
  color: var(--primary);
  opacity: 0.7;
  margin-right: 8px;
  transition: opacity 0.2s ease;
}

.rsifa-base-tables-header:hover::after {
  opacity: 1;
}

.rsifa-expand-icon {
  transition: transform 0.2s ease;
  color: var(--primary);
  flex-shrink: 0;
}

.rsifa-expand-icon.rsifa-expanded {
  transform: rotate(180deg);
}

.rsifa-base-tables-header:hover .rsifa-expand-icon:not(.rsifa-expanded) {
  animation: rsifa-pulse 1s ease-in-out infinite;
}

@keyframes rsifa-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.rsifa-base-tables-header:hover .rsifa-expand-icon.rsifa-expanded {
  animation: none;
}

.rsifa-base-tables-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rsifa-table-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.rsifa-table-item:hover {
  background: var(--muted);
  border-color: var(--primary);
}

.rsifa-table-item.rsifa-table-item-selected {
  background: #ede9fe;
  border-color: var(--primary);
}

.rsifa-table-item svg:first-child {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.rsifa-table-name {
  flex: 1;
  font-size: 13px;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rsifa-table-use-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  opacity: 0;
}

.rsifa-table-item:hover .rsifa-table-use-btn {
  opacity: 1;
}

.rsifa-table-use-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.rsifa-table-use-btn:hover svg {
  stroke: var(--primary-foreground);
}

.rsifa-table-use-btn svg {
  width: 12px;
  height: 12px;
  color: var(--muted-foreground);
}

.rsifa-base-empty-tables {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--muted);
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-style: italic;
}

/* Pricing Page Styles */
.pricing-header-section {
  text-align: center;
  margin-bottom: 48px;
}

.pricing-header-section h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 12px;
}

.pricing-subtitle {
  font-size: 16px;
  color: var(--muted-foreground);
  margin: 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 64px;
}

.pricing-grid-two {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.pricing-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 26px 24px 22px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  transform: translateY(-4px);
}

.pricing-card-featured {
  border-color: #111827;
  border-width: 1px;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.22);
  transform: translateY(-4px);
  background: #ffffff;
}

.pricing-card-featured:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.pricing-grid-two .pricing-card-featured .pricing-header h3 {
  color: var(--primary);
}

.pricing-badge {
  display: inline-block;
  padding-bottom: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #9ca3af;
}

.pricing-badge-free {
  color: #9ca3af;
}

.pricing-badge-popular {
  color: #111827;
}

.pricing-badge-enterprise {
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.pricing-header {
  text-align: left;
  margin-top: 20px;
  margin-bottom: 24px;
}

.pricing-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 16px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px;
  margin-bottom: 12px;
}

.price-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.price-period {
  font-size: 13px;
  color: var(--muted-foreground);
  font-weight: 500;
}

.pricing-description {
  font-size: 13px;
  color: var(--muted-foreground);
  margin: 0;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child {
  border-bottom: none;
}

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

.pricing-features li:not(.pricing-feature-disabled) svg {
  color: #10b981;
}

.pricing-feature-disabled {
  opacity: 0.5;
}

.pricing-feature-disabled svg {
  color: var(--muted-foreground);
}

.pricing-features li span {
  font-size: 14px;
  color: var(--foreground);
  line-height: 1.5;
}

.pricing-card .btn-full {
  margin-top: auto;
  border-radius: 999px;
}

/* Make pricing primary buttons match the reference (dark pill) without affecting the rest of the plugin */
.pricing-card .btn-primary {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.pricing-card .btn-primary:hover {
  background: #000000;
  border-color: #000000;
}

.pricing-guarantee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 13px;
  color: #10b981;
  font-weight: 500;
}

.pricing-guarantee svg {
  color: #10b981;
  flex-shrink: 0;
}

/* Pricing Comparison Section */
.pricing-comparison-section {
  margin-bottom: 64px;
  text-align: center;
}

.pricing-comparison-section h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 40px;
}

.pricing-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-comparison-item {
  text-align: center;
  padding: 32px 24px;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.pricing-comparison-item:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  transform: translateY(-4px);
}

.pricing-comparison-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.pricing-comparison-icon svg {
  color: #ffffff;
  stroke-width: 2.5;
}

.pricing-comparison-item h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 12px;
}

.pricing-comparison-item p {
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0;
}

/* Pricing FAQ Section */
.pricing-faq-section {
  background: var(--muted);
  border-radius: 12px;
  padding: 48px;
  margin-bottom: 48px;
}

.pricing-faq-section h3 {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 40px;
  color: var(--foreground);
}

.pricing-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.pricing-faq-item h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 12px;
}

.pricing-faq-item p {
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0;
}

/* Pricing Footer Section */
.pricing-footer-section {
  text-align: center;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 48px 32px;
}

.pricing-footer-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 12px;
}

.pricing-footer-section p {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-bottom: 24px;
}

.pricing-footer-section .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Responsive Pricing */
@media (max-width: 1024px) {
  .pricing-card-featured {
    transform: scale(1);
  }
  
  .pricing-card-featured:hover {
    transform: translateY(-4px);
  }
}

@media (max-width: 768px) {
  .pricing-header-section h2 {
    font-size: 24px;
  }
  
  .pricing-grid,
  .pricing-grid-two {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 100%;
  }
  
  .pricing-card {
    padding: 24px;
  }
  
  .pricing-card-featured {
    transform: scale(1);
  }
  
  .price-amount {
    font-size: 40px;
  }
  
  .pricing-faq-section {
    padding: 32px 24px;
  }
  
  .pricing-comparison-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .pricing-comparison-section h3 {
    font-size: 22px;
  }
  
  .pricing-faq-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .pricing-footer-section {
    padding: 32px 24px;
  }
}

/* RSIFA New Pricing Layout (reference-style hero + two cards) */
.rsifa-pricing-page {
  padding-top: 0;
}

.rsifa-pricing-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px 32px;
  width: 100%;
}

.rsifa-pricing-hero {
  text-align: center;
  margin-bottom: 40px;
}

.rsifa-pricing-hero h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
  margin-bottom: 12px;
}

.rsifa-pricing-hero p {
  font-size: 15px;
  color: var(--muted-foreground);
  max-width: 520px;
  margin: 0 auto;
}

.rsifa-pricing-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.rsifa-pricing-card {
  background: var(--card);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
}

.rsifa-pricing-card--featured {
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.2);
}

.rsifa-pricing-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-block;
  align-self: center;
}

.rsifa-pricing-card-label--current {
  background: var(--muted);
  color: var(--muted-foreground);
}

.rsifa-pricing-card-label--featured {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}

.rsifa-pricing-card-inner {
  background: var(--card);
  border-radius: 18px;
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rsifa-pricing-plan-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 4px;
}

.rsifa-pricing-plan-meta {
  font-size: 13px;
  color: var(--muted-foreground);
  margin: 0 0 16px;
}

.rsifa-pricing-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 14px;
}

.rsifa-pricing-price-amount {
  font-size: 30px;
  font-weight: 700;
  color: var(--foreground);
}

.rsifa-pricing-price-period {
  font-size: 13px;
  color: var(--muted-foreground);
}

.rsifa-pricing-features {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  font-size: 13px;
  color: var(--muted-foreground);
  flex: 1;
}

.rsifa-pricing-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.rsifa-pricing-features li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted-foreground);
  flex-shrink: 0;
}

.rsifa-pricing-cta {
  width: 100%;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  margin-top: auto;
}

.rsifa-pricing-card--featured .rsifa-pricing-cta.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.rsifa-pricing-card--featured .rsifa-pricing-cta.btn-primary:hover {
  background: #4f46e5;
  border-color: #4f46e5;
}

.rsifa-pricing-overview {
  max-width: 900px;
  margin: 16px auto 0;
}

.rsifa-pricing-overview-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}

.rsifa-pricing-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rsifa-pricing-overview-table thead th {
  text-align: left;
  padding: 10px 0;
  font-weight: 500;
  color: var(--muted-foreground);
}

.rsifa-pricing-overview-heading {
  font-weight: 500;
  color: var(--muted-foreground);
}

.rsifa-pricing-overview-table tbody td {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--foreground);
}

.rsifa-pricing-overview-table tbody td:first-child {
  color: var(--muted-foreground);
  font-weight: 500;
}

.rsifa-pricing-overview-icon {
  text-align: center;
  font-size: 11px;
}

.rsifa-pricing-overview-icon--check {
  color: var(--foreground);
}

.rsifa-pricing-overview-icon--dash {
  color: var(--muted-foreground);
}

@media (max-width: 768px) {
  .rsifa-pricing-cards {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .rsifa-pricing-hero h2 {
    font-size: 24px;
  }
}

/* Loading State for Bases */
.rsifa-bases-loading {
  text-align: center;
  padding: 40px;
  color: var(--muted-foreground);
}

.rsifa-bases-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: rsifa-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* Button Loading States */
.rsifa-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: rsifa-spin 0.6s linear infinite;
  flex-shrink: 0;
  vertical-align: middle;
}

.rsifa-btn-loading {
  position: relative;
  cursor: not-allowed !important;
  opacity: 0.95;
  pointer-events: none;
}

.rsifa-btn-loading:hover {
  transform: none !important;
}

.rsifa-btn-loading > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* For buttons that might be primary or outline */
.btn.rsifa-btn-loading,
.btn-primary.rsifa-btn-loading {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

.btn-outline.rsifa-btn-loading {
  background: var(--muted) !important;
  border-color: var(--border) !important;
}

.btn-outline.rsifa-btn-loading .rsifa-spinner {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: var(--foreground);
}

.rsifa-btn-success {
  background: #10b981 !important;
  border-color: #10b981 !important;
  cursor: default !important;
  pointer-events: none;
}

.rsifa-btn-success:hover {
  background: #10b981 !important;
  border-color: #10b981 !important;
  transform: none !important;
  box-shadow: none !important;
}

.rsifa-btn-success > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* Inline spinner for loading text blocks (e.g. field mappings) */
.rsifa-inline-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(148, 163, 184, 0.4); /* slate-400-ish */
  border-top-color: rgba(148, 163, 184, 1);
  border-radius: 50%;
  animation: rsifa-spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.rsifa-btn-success svg {
  animation: rsifa-check-scale 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  flex-shrink: 0;
}

@keyframes rsifa-check-scale {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Ensure buttons maintain consistent height */
.btn.rsifa-btn-loading,
.btn.rsifa-btn-success {
  min-height: auto;
  white-space: nowrap;
}

/* Small button variants */
.btn-sm.rsifa-btn-loading .rsifa-spinner,
.btn-sm.rsifa-btn-success svg {
  width: 12px;
  height: 12px;
}

/* Bases List Alternative (for compact view) */
.rsifa-bases-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rsifa-bases-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--background);
  transition: all 0.2s ease;
}

.rsifa-bases-list-item:hover {
  border-color: var(--primary);
  background: var(--muted);
}

.rsifa-bases-list-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.rsifa-bases-list-item-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-foreground);
}

.rsifa-bases-list-item-icon svg {
  width: 16px;
  height: 16px;
}

.rsifa-bases-list-item-name {
  font-weight: 500;
  color: var(--foreground);
}

.rsifa-bases-list-item-id {
  font-family: monospace;
  font-size: 11px;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.rsifa-bases-list-tables {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.rsifa-table-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #ede9fe;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: #5b21b6;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.rsifa-table-pill:hover {
  background: #ddd6fe;
  border-color: #a5b4fc;
}

.rsifa-table-pill-more {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .main-wrapper {
    margin-left: 0;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .rsifa-app .mapping-table-header,
  .rsifa-app .mapping-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .rsifa-bases-grid {
    grid-template-columns: 1fr;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .card-header > div:last-child {
    width: 100%;
    justify-content: flex-end;
  }
  
  .rsifa-base-actions {
    flex-direction: column;
  }
  
  .rsifa-base-action-btn {
    width: 100%;
  }
  
  .rsifa-bases-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .rsifa-bases-list-item > div:last-child {
    width: 100%;
    justify-content: space-between;
  }
  
  .rsifa-table-pill {
    max-width: 100%;
  }
}
/**
 * Scoped overrides so Integration for Airtable UI stays inside WordPress admin content area.
 * Prefix: RSIFA
 */

/* Hide WordPress and other plugin notices on all our plugin pages (body class added via admin_body_class filter) */
.rsifa-admin-page .notice,
.rsifa-admin-page .update-nag,
.rsifa-admin-page .updated,
.rsifa-admin-page .error {
  display: none !important;
}

/* Inline notices inside plugin cards (used for free-plan limits, etc.) */
.rsifa-inline-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.rsifa-inline-notice-info {
  background: var(--muted, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--muted-foreground, #475569);
}

.rsifa-inline-notice-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--primary, #6366f1);
}

.rsifa-inline-notice-icon svg {
  display: block;
}

.rsifa-inline-notice-body p {
  margin: 0;
}

.rsifa-inline-notice-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.rsifa-inline-notice-actions {
  flex-shrink: 0;
}

.rsifa-inline-notice-actions .btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

/* Contain the app inside the plugin's content area (no full-screen breakout) */
.rsifa-app.wrap {
  margin: 0px 0px 0px -18px;
  padding: 0;
  /* max-width: 100%; */
}

.rsifa-app .app-container {
  margin: 0;
  min-height: calc(100vh - 32px - 60px);
  max-height: calc(100vh - 32px - 60px);
  display: flex;
  flex-wrap: nowrap;
  background: var(--muted, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Sidebar: in-flow column, not fixed to viewport */
.rsifa-app .sidebar {
  position: static;
  top: auto;
  left: auto;
  height: auto;
  width: 12rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.rsifa-app .sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

/* Main content: takes remaining space; min-height: 0 lets flex child shrink so overflow scroll works */
.rsifa-app .main-wrapper {
  margin-left: 0;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rsifa-app .main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-width: none !important;
  width: 100%;
}

/* Airtable tab: 75% main + 25% sidebar for supported forms */
.rsifa-airtable-layout {
  display: grid;
  grid-template-columns: 60% 1fr;
  gap: 12px;
  padding-top: 0;
}

.rsifa-airtable-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 0;
}

.rsifa-airtable-main > .card:first-child {
  margin-top: 0;
}

.rsifa-airtable-sidebar {
  min-width: 0;
  position: sticky;
  top: 24px;
  padding-top: 0;
}

.rsifa-airtable-sidebar > .card {
  width: 100% !important;
  margin-top: 0;
}

.rsifa-airtable-sidebar .rsifa-supported-forms {
  flex-direction: column;
  gap: 10px;
}

.rsifa-airtable-sidebar .rsifa-supported-form-item {
  flex-wrap: wrap;
}

.rsifa-request-integration {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.rsifa-request-integration-text {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: var(--muted-foreground);
}

.rsifa-request-integration .btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 1024px) {
  .rsifa-airtable-layout {
    grid-template-columns: 1fr;
  }

  .rsifa-airtable-sidebar {
    position: static;
  }
}

/* Set comfortable card width (main content cards only) */
.rsifa-airtable-main .card {
  max-width: none !important;
  width: 100% !important;
}

.rsifa-app .card {
  max-width: none !important;
  width: 100%;
}

/* Ensure header doesn't stretch full width in a weird way */
.rsifa-app .main-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Header actions */
.rsifa-app .header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.rsifa-app .header-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.rsifa-app .header-actions .btn svg {
  width: 16px;
  height: 16px;
}

/* Reduce spacing between header title and description */
.rsifa-app .header-content h2 {
  margin-bottom: 2px;
}

.rsifa-app .header-content p {
  margin-top: 0;
}

/* Reduce spacing in sidebar header logo text */
.rsifa-app .logo-text h1 {
  margin-bottom: 2px;
}

.rsifa-app .logo-text p {
  margin-top: 0;
}

@media (max-width: 782px) {
  .rsifa-app .app-container {
    flex-direction: column;
    min-height: calc(100vh - 46px - 40px);
    max-height: calc(100vh - 46px - 40px);
  }
  .rsifa-app .sidebar {
    width: 100%;
    max-height: 200px;
  }
  .rsifa-app .sidebar-nav {
    overflow-y: auto;
  }
  .rsifa-app .main-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .rsifa-app .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .rsifa-app .header-actions .btn .btn-text {
    display: none;
  }
}
}
