/* Filevine Document Viewer - Sidebar Styles */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #34a853;
  --warning: #fbbc04;
  --error: #ea4335;
  --gray-100: #f8f9fa;
  --gray-200: #e8eaed;
  --gray-300: #dadce0;
  --gray-500: #9aa0a6;
  --gray-700: #5f6368;
  --gray-900: #202124;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--gray-900);
  background: white;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-100);
  flex-shrink: 0;
}

/* Tab Navigation */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  background: white;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: white;
}

/* Session Info Panel */
.session-info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.session-current {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.session-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.session-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.session-details {
  flex: 1;
  min-width: 0;
}

.session-user-email {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-org-name {
  font-size: 11px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.session-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

.session-toggle:active {
  background: rgba(255, 255, 255, 0.25);
}

.session-toggle .toggle-icon {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.session-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

.session-badge {
  background: #ea4335;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

/* Active Sessions List */
.active-sessions-list {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
}

.active-sessions-list.expanded {
  max-height: 400px;
  opacity: 1;
}

.active-sessions-list.hidden {
  margin-top: 0;
  padding-top: 0;
}

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

.sessions-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.icon-btn-small {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 3px;
  padding: 4px 8px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.icon-btn-small:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sessions-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding: 2px;
}

.sessions-loading {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  opacity: 0.8;
}

.session-item {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(2px);
}

.session-item.current {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
  position: relative;
}

.session-item.current::after {
  content: '✓';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
}

.session-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.session-item-details {
  flex: 1;
  min-width: 0;
}

.session-item-org {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-item-email {
  font-size: 10px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-item-tab {
  font-size: 9px;
  opacity: 0.7;
  margin-top: 2px;
}

.sessions-empty {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  opacity: 0.7;
}

/* Tab Content */
.tab-content-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-content {
  display: none;
  height: 100%;
  overflow: auto;
}

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

/* Customs Editor Specific Styles */
.customs-container {
  margin-top: 20px;
  padding: 16px;
  background: var(--gray-100);
  border-radius: 8px;
  min-height: 200px;
}

/* Custom Field Form */
.custom-field-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--gray-900);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-family);
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.hint-text {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.form-actions button {
  flex: 1;
}

/* Result Display */
.field-result {
  margin-top: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

.result-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--gray-900);
}

.result-content {
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.result-content pre {
  background: var(--gray-100);
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
}

.result-success {
  color: var(--success);
  font-weight: 500;
  margin-bottom: 12px;
}

.result-error {
  color: var(--error);
  font-weight: 500;
  margin-bottom: 12px;
}

/* AI Builder Styles */
.ai-builder-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-builder-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-progress {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.progress-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.progress-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 6px;
  border-left: 3px solid transparent;
}

.progress-step.pending {
  border-left-color: var(--gray-300);
}

.progress-step.processing {
  border-left-color: var(--primary);
  background: var(--primary-light);
}

.progress-step.success {
  border-left-color: var(--success);
  background: #f0fdf4;
}

.progress-step.error {
  border-left-color: var(--error);
  background: #fef2f2;
}

.progress-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.progress-details {
  flex: 1;
}

.progress-label {
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.progress-message {
  font-size: 13px;
  color: var(--gray-600);
}

.progress-step.error .progress-message {
  color: var(--error);
}

/* AI generation spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.header h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

/* Status Indicator */
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-700);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-500);
}

.status.connected .status-dot {
  background: var(--success);
}

.status.disconnected .status-dot {
  background: var(--gray-500);
}

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

/* Panels */
.panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0; /* Allow flex shrinking */
}

.panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 600;
}

.panel-content {
  text-align: center;
  padding: 40px 20px;
}

.panel-content .message {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.panel-content .hint {
  font-size: 13px;
  color: var(--gray-700);
}

/* Org Selector */
.selector {
  margin-bottom: 16px;
}

.selector label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.selector select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

/* Browser */
.browser {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.breadcrumb .separator {
  color: var(--gray-500);
}

.breadcrumb .folder-breadcrumb {
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
  font-size: 14px;
}

.breadcrumb .folder-breadcrumb:hover {
  text-decoration: underline;
}

.project-name {
  font-weight: 500;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lists */
.list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* Allow flex shrinking */
}

.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-100);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.list-item:hover {
  background: var(--gray-200);
}

.list-item.selected {
  background: #e8f0fe;
  border: 1px solid var(--primary);
}

.list-item .icon {
  font-size: 18px;
  flex-shrink: 0;
}

.list-item .info {
  flex: 1;
  min-width: 0;
}

.list-item .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item .meta {
  font-size: 12px;
  color: var(--gray-700);
}

.list-item .actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.list-item.folder-item {
  cursor: pointer;
}

.list-item.folder-item:hover {
  background: var(--gray-200);
}

.action-btn.secondary {
  background: var(--gray-300);
  color: var(--gray-900);
  padding: 4px 8px;
  font-size: 12px;
}

.action-btn.secondary:hover {
  background: var(--gray-400);
}

.list .loading,
.list .empty {
  text-align: center;
  padding: 20px;
  color: var(--gray-700);
}

/* Download Items */
.download-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--gray-100);
  border-radius: 6px;
  flex-shrink: 0;
}

.download-item .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.download-item .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-item .status {
  font-size: 12px;
  color: var(--gray-700);
}

.download-item .status.complete {
  color: var(--success);
}

.download-item .status.error {
  color: var(--error);
}

.progress-bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

/* Buttons */
.primary-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  flex: 1;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.primary-btn:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.secondary-btn {
  padding: 10px 20px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: white;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  flex: 1;
}

.secondary-btn:hover {
  background: var(--gray-100);
}

.secondary-btn:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--gray-100);
}

.text-btn {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.text-btn:hover {
  text-decoration: underline;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s, transform 0.3s;
  max-width: 300px;
  font-size: 13px;
  font-weight: 500;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.notification-info {
  background: var(--primary);
  color: white;
}

.notification-success {
  background: var(--success);
  color: white;
}

.notification-error {
  background: var(--error);
  color: white;
}

.notification-warning {
  background: var(--warning);
  color: var(--gray-900);
}

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  transition: opacity 0.2s, background-color 0.2s;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

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

.action-btn.primary:hover {
  background: var(--primary-dark);
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
  flex-shrink: 0;
}

.footer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
}

.footer-btn:hover {
  color: var(--gray-900);
}

.badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
}

.badge.hidden {
  display: none;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Scrollbar */
.list::-webkit-scrollbar,
.panel::-webkit-scrollbar {
  width: 8px;
}

.list::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track {
  background: transparent;
}

.list::-webkit-scrollbar-thumb,
.panel::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

.list::-webkit-scrollbar-thumb:hover,
.panel::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Schema Viewer */
.schema-viewer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.schema-display {
  margin-top: 20px;
}

.schema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-200);
}

.schema-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--gray-900);
}

.schema-stats {
  display: flex;
  gap: 8px;
}

.stat-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.schema-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-card {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.2s;
}

.field-card:hover {
  background: var(--gray-50);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.field-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  flex: 1;
}

.field-type-badge {
  display: inline-block;
  padding: 3px 10px;
  background: #e8f0fe;
  color: var(--primary);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  margin-left: 8px;
}

.field-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 13px;
  color: var(--gray-700);
}

.field-detail-item {
  display: flex;
  flex-direction: column;
}

.field-detail-label {
  font-size: 11px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.field-detail-value {
  color: var(--gray-900);
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  word-break: break-all;
}

.field-badges {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.field-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #fff3cd;
  color: #856404;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
}

.field-badge.required {
  background: #f8d7da;
  color: #721c24;
}

.field-notes {
  margin-top: 10px;
  padding: 8px 10px;
  background: white;
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray-700);
  font-style: italic;
}

.field-header-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.no-schema {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-600);
}

.no-schema-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.no-schema-text {
  font-size: 14px;
}

.field-dropdown-items {
  margin-top: 10px;
  padding: 10px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}

.dropdown-items-label {
  font-size: 11px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}

.dropdown-items-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dropdown-item-chip {
  display: inline-block;
  padding: 4px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* ==================== AI Field Preview ==================== */
.ai-preview {
  margin-top: 20px;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.ai-preview.hidden {
  display: none;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

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

.preview-stats {
  display: flex;
  gap: 8px;
}

.stat-badge {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.preview-content {
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
  background: var(--gray-100);
}

.preview-actions {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: white;
  border-top: 1px solid var(--gray-200);
}

.preview-actions .primary-btn,
.preview-actions .secondary-btn {
  flex: 1;
}

/* Preview Section Header */
.preview-section-header {
  padding: 16px;
  background: white;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 16px;
}

.preview-section-header h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
}

.preview-section-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--gray-600);
}

/* New Field Badge */
.field-card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.field-new-badge {
  display: inline-block;
  padding: 3px 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* New Field Card Styling */
.field-card-new {
  border-left: 4px solid #10b981;
  background: linear-gradient(to right, rgba(16, 185, 129, 0.05) 0%, white 100%);
}
