:root {
  --primary: #2E3647; /* Blue for light mode */
  --primary-light: #3e4960; /* Lighter blue */
  --primary-dark: #293550; /* Darker blue */
  --secondary: #059669; /* Green for light mode */
  --secondary-light: #10b981; /* Lighter green */
  --secondary-dark: #047857; /* Darker green */
  --accent: #d97706; /* Orange for light mode */
  --accent-light: #f59e0b; /* Lighter orange */
  --accent-dark: #b45309; /* Darker orange */
  --error: #dc2626; /* Red for light mode */
  --success: #16a34a; /* Green for light mode */
  --info: #2E3647; /* Blue for light mode */
  --warning: #d97706; /* Orange for light mode */
  --background: #f0f2f5;          /* Softened main background */
  --background-light: #f8fafc;    /* Softened container background */
  --background-dark: #e5e7eb;     /* Softened dark background for buttons etc */
  --text-primary: #111827; /* Almost black for light mode */
  --text-secondary: #4b5563; /* Gray for light mode */
  --light: #ffffff; /* Pure white */
  --dark: #111827; /* Almost black */
  --grey: #4b5563; /* Gray */
  --grey-light: #9ca3af; /* Light gray */
  --border-radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.15);  /* Softened shadow */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

/* Dark mode variables */
.dark-theme {
  --primary: #3b82f6; /* Blue for dark mode */
  --primary-light: #60a5fa; /* Lighter blue for dark mode */
  --primary-dark: #2563eb; /* Slightly darker blue for dark mode */
  --secondary: #10b981; /* Green for dark mode */
  --secondary-light: #34d399; /* Lighter green for dark mode */
  --secondary-dark: #059669; /* Darker green for dark mode */
  --accent: #f59e0b; /* Orange for dark mode */
  --accent-light: #fbbf24; /* Lighter orange for dark mode */
  --accent-dark: #d97706; /* Darker orange for dark mode */
  --error: #ef4444; /* Red for dark mode */
  --success: #22c55e; /* Green for dark mode */
  --info: #3b82f6; /* Blue for dark mode */
  --warning: #f59e0b; /* Orange for dark mode */
  --background: #121212; /* Dark background for dark mode */
  --background-light: #1e1e1e; /* Dark mode secondary background */
  --background-dark: #2d2d2d; /* New variable for dark mode */
  --text-primary: #f3f4f6; /* Light gray for dark mode */
  --text-secondary: #9ca3af; /* Light gray for dark mode */
  --light: #f3f4f6; /* Light gray for dark mode */
  --dark: #f3f4f6; /* Light text on dark background */
  --grey: #6b7280; /* Mid gray for dark mode */
  --grey-light: #4b5563; /* Slightly lighter gray for dark mode */
}

/* Theme toggle styles */
.theme-toggle-container {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  z-index: 100;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  transition: var(--transition);
  box-shadow: 0 0 0 1px var(--grey-light);
  min-width: auto;
}

.theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 0 0 1px var(--grey);
}

.dark-theme .theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle-icon {
  font-size: 1.2rem;
  transition: var(--transition);
}

.fa-icon {
  width: 20px;
  height: 20px;
  fill: var(--text-primary);
}

.light-icon {
  display: block;
}

.dark-icon {
  display: none;
}

.dark-theme .light-icon {
  display: none;
}

.dark-theme .dark-icon {
  display: block;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  border-radius: 0 !important;
}

body {
  background-color: var(--background);
  color: var(--text-primary);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  line-height: 1.6;
  padding: var(--spacing-md);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--background-light);
  box-shadow: var(--shadow);
  padding: var(--spacing-xl);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--grey-light);
}

h1 {
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.description {
  color: var(--text-secondary);
  font-size: 1rem;
}

.form-section {
  margin-bottom: var(--spacing-xl);
}

.form-section h2 {
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 500;
}

/* Section container styles */
.section-container {
  margin-bottom: var(--spacing-xl);
  border: 1px solid var(--grey-light);
  border-radius: var(--border-radius);
  background-color: var(--background-light);
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: var(--background-light);
  cursor: pointer !important;
  border-bottom: 1px solid var(--grey-light);
  position: relative;
  z-index: 1;
  transition: background-color 0.2s ease;
}

.section-header:hover {
  background-color: var(--background-dark);
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  display: inline-block;
  color: var(--text-primary);
}

.refresh-button {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 5px;
  margin-left: 10px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.refresh-button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: rotate(15deg);
}

.dark-theme .refresh-button {
  color: var(--text-primary-dark);
}

.dark-theme .refresh-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.section-toggle {
  width: 24px;
  height: 24px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
  background-color: transparent !important;
  border: none !important;
  cursor: pointer !important;
}

.section-toggle:before {
  content: "▲";
  font-size: 0.8rem;
  color: var(--text-primary);
  display: block;
  transition: transform 0.3s ease;
  transform: rotate(0deg);
}

.section-toggle.expanded:before {
  transform: rotate(180deg);
}

.section-content {
  max-height: 0 !important;
  overflow: hidden !important;
  transition: max-height 0.3s ease !important;
  display: block !important;
}

.section-content.expanded {
  max-height: none !important;
  overflow: visible !important;
}

.dark-theme .section-container {
  border-color: var(--grey);
  background-color: var(--background-dark);
}

.dark-theme .section-header {
  background-color: var(--background-dark);
  border-color: var(--grey);
}

.form-row {
  display: flex;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.form-group {
  flex: 1;
  min-width: 250px;
  margin-bottom: var(--spacing-md);
}

label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
}

input,
select,
textarea {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--grey-light);
  border-radius: 0;
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--background);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Custom Checkbox Styles */
input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--grey-light);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  margin-right: var(--spacing-md);
}

input[type="checkbox"]:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 8.5l3 3L13 4' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 16px 16px;
  background-position: center;
  background-repeat: no-repeat;
}

input[type="checkbox"]:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Dark theme adjustments for checkbox */
.dark-theme input[type="checkbox"] {
  border-color: var(--grey);
}

.dark-theme input[type="checkbox"]:checked {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
}

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

.checkbox-label {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* New styles for checkbox rows */
.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.checkbox-row .form-group {
  flex: 0 0 auto;
  min-width: unset;
  margin-bottom: 0;
  margin-right: var(--spacing-md);
}

/* Base button styles */
button {
  background-color: var(--background-light);
  color: var(--text-primary);
  border: 1px solid var(--grey-light);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 36px;
  box-shadow: none;
  text-transform: capitalize;
}

button:hover {
  background-color: var(--background);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: none;
}

button:disabled {
  background-color: var(--background);
  color: var(--grey-light);
  border-color: var(--grey-light);
  cursor: not-allowed;
  box-shadow: none;
}

/* Template buttons row styles */
.template-buttons-row {
  display: flex;
  width: 100%;
  background-color: transparent;
  padding: 0;
  margin-bottom: var(--spacing-lg);
  gap: var(--spacing-md);
}

.template-buttons-row button {
  flex: 1;
  margin: 0;
  height: 40px;
  background-color: var(--background-dark);
  color: var(--text-primary);
  font-size: 0.85rem;
  min-width: 0;
  padding: var(--spacing-md);
  border: 1px solid var(--grey-light);
}

.template-buttons-row button:hover {
  background-color: var(--background);
  color: var(--primary);
  border-color: var(--primary);
}

/* Dark theme adjustments */
.dark-theme .template-buttons-row button {
  background-color: var(--background-dark);
  border-color: var(--grey-light);
}

.dark-theme .template-buttons-row button:hover {
  background-color: var(--background);
  color: var(--primary-light);
  border-color: var(--primary-light);
}

/* Action buttons at bottom */
.actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
  background-color: transparent;
  padding: 0;
  width: fit-content;
  margin-left: auto;
}

.actions button {
  margin: 0;
  height: 40px;
  background-color: var(--background-light);
  font-size: 0.85rem;
  border: 1px solid var(--grey-light);
  padding: var(--spacing-md) var(--spacing-xl);
}

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

.button-danger:hover {
  color: var(--error);
  background-color: var(--background);
  border-color: var(--error);
}

.button-success {
  color: var(--success);
}

.button-success:hover {
  color: var(--success);
  background-color: var(--background);
  border-color: var(--success);
}

/* Dark theme adjustments for action buttons */
.dark-theme .actions button {
  background-color: var(--background-dark);
  border-color: var(--grey-light);
}

.dark-theme .actions button:hover {
  background-color: var(--background);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .template-buttons-row {
    flex-direction: column;
    gap: 1px;
  }

  .template-buttons-row button {
    width: 100%;
  }

  .actions {
    width: 100%;
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }
}

.button-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: 0;
  cursor: pointer;
  transition: var(--transition);
}
.button-secondary {
  background-color: var(--secondary);
  color: white;
  border: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: 0;
  cursor: pointer;
  transition: var(--transition);
}

.button-secondary:hover {
  background-color: var(--secondary-dark);
}

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

.button-success:hover {
  background-color: #0f9d58; /* Slightly darker success color */
}
.button-danger {
  background-color: var(--error);
}

.button-danger:hover {
  background-color: #b91c1c; /* Slightly darker error color */
}

.button-sm {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  min-width: 80px;
}

.alert {
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 0;
  margin-bottom: var(--spacing-lg);
  border-left: 4px solid transparent;
}

.alert-success {
  background-color: rgba(22, 163, 74, 0.1);
  color: var(--success);
  border-left-color: var(--success);
}

.alert-danger {
  background-color: rgba(220, 38, 38, 0.1);
  color: var(--error);
  border-left-color: var(--error);
}

.alert-info {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--info);
  border-left-color: var(--info);
}

.alert-warning {
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--warning);
  border-left-color: var(--warning);
}

.form-template {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background-color: transparent;
  border: none;
}

.clone-section {
  background-color: var(--background);
  border: 1px solid var(--grey-light);
}

.clone-id-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.clone-id-section label {
  margin-bottom: 0;
  margin-right: var(--spacing-sm);
  white-space: nowrap;
}

.template-id-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.template-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.template-controls-extra {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.template-dropdown-container {
  position: relative;
  width: 100%;
}

.template-dropdown {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--grey-light);
  border-radius: 0;
  background-color: var(--background-light);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.template-dropdown:hover {
  border-color: var(--primary);
}

.template-dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--background-light);
  min-width: 350px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  border-radius: 0;
  top: 100%;
  left: 0;
  border: 1px solid var(--grey-light);
  margin-top: var(--spacing-xs);
}

.template-dropdown-open .template-dropdown-content {
  display: block;
  width: 100%;
}

.template-dropdown-item {
  padding: var(--spacing-md);
  text-decoration: none;
  display: block;
  cursor: pointer;
  border-bottom: 1px solid var(--grey-light);
  transition: var(--transition);
}

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

.template-dropdown-item:hover {
  background-color: var(--background);
}

.template-dropdown-item .template-id {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
}

.template-dropdown-chevron {
  transition: transform 0.3s;
}

.template-dropdown-open .template-dropdown-chevron {
  transform: rotate(180deg);
}

.template-list-empty,
.templates-loading,
.template-list-error {
  padding: var(--spacing-md);
  color: var(--text-secondary);
}

.templates-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.role-section {
  border: 1px solid var(--grey-light);
  border-radius: 0;
  margin-bottom: var(--spacing-lg);
  overflow: hidden;
}

.role-title {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--grey-light);
  font-size: 1.2rem;
  font-weight: 500;
}

.response-container {
  margin-top: var(--spacing-xl);
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--grey-light);
}

.response-container h3 {
  padding: var(--spacing-md) var(--spacing-lg);
  margin: 0;
  background-color: var(--background-light);
  border-bottom: 1px solid var(--grey-light);
  font-weight: 500;
}

pre {
  background-color: var(--background);
  padding: var(--spacing-lg);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  margin: 0;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.copy-btn {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  min-width: auto;
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.875rem;
}

.loader {
  text-align: center;
  margin: var(--spacing-lg) 0;
  display: none;
}

.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50% !important;
  border-left-color: var(--primary);
  animation: spin 1s linear infinite;
  display: inline-block;
  width: 24px;
  height: 24px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.field-required {
  color: var(--error);
  margin-left: var(--spacing-xs);
}

.field-section {
  margin-bottom: var(--spacing-lg);
  padding: 0 var(--spacing-md) var(--spacing-md);
}

.collapsible-btn {
  background-color: var(--background-light);
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--spacing-md) var(--spacing-lg);
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  min-width: auto;
  box-shadow: none;
}

.collapsible-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
  background-color: var(--background-light);
}

.collapsible-active,
.collapsible-btn:hover {
  background-color: var(--background);
}

.chevron::after {
  content: "▼";
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.collapsible-active .chevron::after {
  content: "▲";
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: var(--background-light);
  margin: 10% auto;
  padding: var(--spacing-xl);
  border-radius: 0;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
}

.close {
  position: absolute;
  right: var(--spacing-lg);
  top: var(--spacing-lg);
  color: var(--text-secondary);
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close:hover,
.close:focus {
  color: var(--text-primary);
}

.modal h2 {
  margin-bottom: var(--spacing-lg);
  color: var(--primary);
  font-weight: 500;
}

.opportunity-list,
.template-list,
.submission-list {
  max-height: 300px;
  overflow-y: auto;
  margin: var(--spacing-md) 0 var(--spacing-lg);
  border: 1px solid var(--grey-light);
  border-radius: 0;
}

.opportunity-item,
.submission-item {
  padding: var(--spacing-md);
  cursor: pointer;
  border-bottom: 1px solid var(--grey-light);
  transition: var(--transition);
}

.opportunity-item:last-child,
.submission-item:last-child {
  border-bottom: none;
}

.opportunity-item:hover,
.submission-item:hover {
  background-color: var(--background);
}

.opportunity-item.selected,
.submission-item.selected {
  background-color: var(--background);
  border-left: 3px solid var(--primary);
}

.opportunity-item strong {
  display: block;
  margin-bottom: var(--spacing-xs);
}

.opportunity-item div {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.submission-item .submission-name {
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
}

.submission-item .submission-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.submission-item .submission-detail {
  display: flex;
  align-items: center;
}

.submission-item .submitter-names {
  font-weight: 500;
  color: var(--primary);
  width: 100%;
  margin-top: var(--spacing-xs);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--spacing-lg);
  gap: var(--spacing-md);
}

.url-container {
  margin-top: var(--spacing-xl);
  background-color: var(--background-light);
  padding: var(--spacing-lg);
  border-radius: 0;
  border: 1px solid var(--grey-light);
}

.url-container h3 {
  margin-bottom: var(--spacing-lg);
  color: var(--primary);
  font-weight: 500;
}

.url-item {
  margin-bottom: var(--spacing-lg);
}

.url-item:last-child {
  margin-bottom: 0;
}

.url-item label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
}

.url-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.url-input {
  flex: 1;
  padding: var(--spacing-md);
  border: 1px solid var(--grey-light);
  border-radius: 0;
  font-size: 0.9rem;
  background-color: var(--background-light);
  overflow: hidden;
  text-overflow: ellipsis;
}

.url-copy-btn {
  background-color: var(--primary);
  min-width: 80px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    padding: var(--spacing-sm);
  }

  .container {
    padding: var(--spacing-md);
  }

  .form-group {
    min-width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .template-id-section,
  .clone-id-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .template-id-section input,
  .clone-id-section input {
    width: 100%;
    margin-bottom: var(--spacing-sm);
  }

  .template-controls-extra {
    flex-direction: column;
  }

  .template-buttons-row {
    flex-direction: column;
  }

  .actions {
    flex-direction: column;
  }

  .modal-content {
    width: 95%;
    margin: 5% auto;
    padding: var(--spacing-lg);
  }

  .url-row {
    flex-direction: column;
    align-items: stretch;
  }

  .url-copy-btn {
    width: 100%;
  }
}

/* Status Modal Styles */
#statusMessage {
  padding: var(--spacing-lg);
  margin: var(--spacing-md) 0;
  border-radius: 0;
  line-height: 1.5;
}

.status-success {
  background-color: rgba(22, 163, 74, 0.1);
  border-left: 4px solid var(--success);
  color: var(--success);
}

.status-error {
  background-color: rgba(220, 38, 38, 0.1);
  border-left: 4px solid var(--error);
  color: var(--error);
}

#statusTitle.success-title {
  color: var(--success);
}

#statusTitle.error-title {
  color: var(--error);
}

.button-info {
  background-color: var(--info);
  color: white;
  border: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: 0;
  cursor: pointer;
  transition: var(--transition);
}

.button-info:hover {
  background-color: var(--primary-dark);
}

.search-container {
  margin-bottom: var(--spacing-md);
}

.search-input {
  padding: var(--spacing-md);
  border: 1px solid var(--grey-light);
  border-radius: 0;
  font-size: 1rem;
  transition: var(--transition);
  flex-grow: 1;
  min-width: 250px;
}

.search-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.search-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-md);
  gap: var(--spacing-md);
}

.search-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.search-buttons {
  display: flex;
  gap: var(--spacing-sm);
}

.search-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.reset-btn {
  background-color: var(--grey-light);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

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

.reset-btn:hover {
  background-color: var(--grey);
}

.search-btn:disabled,
.reset-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.search-prompt {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  font-style: italic;
}

.search-result-count {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--grey-light);
  color: var(--text-primary);
}

/* Contact list styles */
.contact-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--grey-light);
  border-radius: 0;
  border-radius: var(--border-radius);
  margin-top: var(--spacing-md);
}

.contact-item {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--grey-light);
  cursor: pointer;
  transition: var(--transition);
}

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

.contact-item:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

.contact-item.selected {
  background-color: rgba(37, 99, 235, 0.1);
  border-left: 3px solid var(--primary);
}

.contact-item strong {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.contact-item div {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* Dark theme adjustments */
.dark-theme .search-btn {
  background-color: var(--primary);
}

.dark-theme .reset-btn {
  background-color: var(--grey);
}

.dark-theme .search-btn:hover {
  background-color: var(--primary-light);
}

.dark-theme .reset-btn:hover {
  background-color: var(--grey-light);
}

.dark-theme .contact-item:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.dark-theme .contact-item.selected {
  background-color: rgba(59, 130, 246, 0.2);
}

.dark-theme .search-result-count {
  border-bottom: 1px solid var(--grey);
}

/* Apply row layout for parties on wider screens (e.g., >= 992px) */
@media (min-width: 992px) {
  .submission-cell.submission-party {
     /* Arrange Label and Party Names side-by-side */
     flex-direction: row;
     align-items: center; /* Vertically center label and party names */
     gap: var(--spacing-lg); /* Increase gap */
  }

  .party-names-container {
      /* Arrange Client/Admin side-by-side */
      flex-direction: row;
      gap: var(--spacing-lg); /* Space between Client and Admin */
      align-items: baseline; /* Align text baseline */
  }

  .party-name {
      /* Adjust styling if needed for row layout */
      white-space: nowrap; /* Prevent wrapping */
  }

  /* Optional: Adjust grid columns on wide screens if needed */
  /* .submission-row {
      grid-template-columns: 4fr 1fr 1fr; /* Give more space to first column */
  /* } */
}

/* Custom Label Styles */
.submission-custom-label {
  font-weight: 600; /* Make label stand out */
  color: var(--primary); /* Use primary color */
  font-size: 1rem;
  margin-bottom: var(--spacing-xs); /* Space below label when stacked */
  display: flex; /* Align label and edit button */
  align-items: center;
  gap: var(--spacing-sm);
  flex-grow: 1; /* Allow label to take space */
  min-width: 100px; /* Minimum width */
}
.dark-theme .submission-custom-label {
  color: var(--primary-light);
}
.submission-custom-label .label-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.submission-custom-label .no-label {
  font-style: italic;
  color: var(--text-secondary);
  font-weight: normal;
  font-size: 0.9em;
}

.edit-label-btn {
  background: none;
  border: none;
  padding: 2px;
  margin: 0;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
  opacity: 0.6;
  transition: var(--transition);
  min-width: auto; /* Override default button min-width */
  height: auto; /* Override default button height */
  box-shadow: none;
}
.edit-label-btn:hover {
  color: var(--primary);
  opacity: 1;
  background: none; /* Ensure no background on hover */
  border: none;
  box-shadow: none;
}
.dark-theme .edit-label-btn:hover {
  color: var(--primary-light);
}

/* Adjustments for row layout */
@media (min-width: 992px) {
   .submission-custom-label {
       margin-bottom: 0; /* No margin below label when in a row */
       flex-grow: 0; /* Don't let it grow excessively */
       flex-shrink: 0; /* Prevent shrinking */
       max-width: 250px; /* Limit width */
   }
}

@media (max-width: 768px) {
  .search-options {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-toggle {
    margin-bottom: var(--spacing-sm);
  }
  
  .search-buttons {
    justify-content: space-between;
  }
  
  .contact-list {
    max-height: 300px;
  }
}

.no-results {
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--text-secondary);
  font-style: italic;
}

.dark-theme input,
.dark-theme select,
.dark-theme textarea,
.dark-theme .template-dropdown,
.dark-theme .url-input {
  background-color: #2d2e31;
  color: var(--text-primary);
  border-color: var(--grey-light);
}

.dark-theme .alert-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.dark-theme .alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.dark-theme .alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.dark-theme .alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.dark-theme .status-success {
  background-color: rgba(22, 163, 74, 0.2);
}

.dark-theme .status-error {
  background-color: rgba(220, 38, 38, 0.2);
}

/* Enhanced contact item styles */
.contact-item {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--grey-light);
  cursor: pointer;
  transition: var(--transition);
}

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

.contact-item:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

.contact-item.selected {
  background-color: rgba(37, 99, 235, 0.1);
  border-left: 3px solid var(--primary);
}

.contact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-xs);
}

.contact-name {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.contact-company {
  color: var(--primary);
  font-size: 0.9rem;
  font-style: italic;
}

.contact-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-xs);
}

.contact-details div {
  font-size: 0.9rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-right: var(--spacing-xs);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .contact-details {
    grid-template-columns: 1fr;
  }
  
  .contact-header {
    flex-direction: column;
  }
  
  .contact-company {
    margin-top: 2px;
  }
}

/* Dark theme adjustments */
.dark-theme .contact-item:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.dark-theme .contact-item.selected {
  background-color: rgba(59, 130, 246, 0.2);
}

.dark-theme .contact-name {
  color: var(--light);
}

.dark-theme .contact-label {
  color: var(--light);
}

/* Email Toggle Container */
.email-toggle-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: var(--background-light);
  border: 1px solid var(--grey-light);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
}

.email-toggle-label {
  flex: 1;
}

.email-toggle-label h3 {
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 500;
}

.email-toggle-label p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* iOS Style Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin-left: var(--spacing-md);
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--grey-light);
  transition: var(--transition);
  border-radius: 34px !important;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: var(--light);
  transition: var(--transition);
  border-radius: 50% !important;
}

input:checked + .slider {
  background-color: var(--secondary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--secondary);
}

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

/* Rounded sliders */
.slider.round {
  border-radius: 34px !important;
}

.slider.round:before {
  border-radius: 50% !important;
}

/* Dark theme styling for toggle */
.dark-theme .slider {
  background-color: var(--grey);
}

.dark-theme input:checked + .slider {
  background-color: var(--secondary-light);
}

/* Input error styling */
.input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 1px var(--error) !important;
  background-color: rgba(220, 38, 38, 0.05) !important;
}

.input-error:focus {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2) !important;
}

/* Email Confirmation Modal */
.confirm-message {
  margin: var(--spacing-md) 0;
  line-height: 1.5;
}

.email-details {
  background-color: var(--background);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin: var(--spacing-md) 0;
}

.email-details p {
  margin: var(--spacing-xs) 0;
}

.warning-text {
  color: var(--warning);
  font-weight: 500;
  margin: var(--spacing-md) 0;
}

/* Updated File Explorer Styles */
.explorer-container {
  width: 100%;
  border: 1px solid var(--grey-light);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin: var(--spacing-md);
}

.explorer-header {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  background-color: var(--background-dark);
  padding: var(--spacing-md);
  font-weight: 600;
}

.explorer-header-cell {
  padding: var(--spacing-xs) var(--spacing-md);
  text-align: left;
}

.explorer-content {
  max-height: 600px;
  overflow-y: auto;
}

.template-group {
  margin-bottom: 1px;
}

.template-group:last-child {
  margin-bottom: 0;
}

.template-group-header {
  display: flex;
  align-items: center;
  padding: var(--spacing-md);
  cursor: pointer;
  background-color: var(--background-light);
  transition: background-color 0.2s ease;
}

.template-group-header:hover {
  background-color: var(--background-dark);
}

.template-group-name {
  font-weight: 500;
  margin-left: var(--spacing-md);
  flex: 1;
}

.template-group-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.template-group-icon:before {
  content: "▶";
  font-size: 0.7rem;
  color: var(--text-primary);
}

.template-group.expanded .template-group-icon:before {
  content: "▼";
}

.template-submissions {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out; /* Add padding transition */
  /* Add padding only when expanded */
  padding-top: 0;
  padding-bottom: 0;
  /* display: block; Remove if it causes issues */
}


.template-group.expanded .template-submissions {
  /* Adjust max-height dynamically in JS if content varies hugely,
     otherwise set a large enough value or rely on scrollHeight */
  max-height: 1000px; /* Example large value, or use JS calculation */
  overflow-y: auto; /* Allow scrolling if content exceeds max-height */
  /* Add padding when expanded */
  padding-top: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
}

.template-submissions .submission-row:last-child {
  border-bottom: none;
}

/* Style the individual submission row */
.submission-row {
  display: grid; /* Keep using grid */
  /* Adjust columns if adding a label column, e.g., 2fr 1fr 1fr 1fr */
  grid-template-columns: 3fr 1fr 1fr; /* Original */
  /* Add a new column for the label/edit icon */
  /* grid-template-columns: auto 1fr auto auto; /* Example: Label | Parties | Status | Actions */
  /* Let's try modifying the first column instead for now */
  padding: var(--spacing-sm) var(--spacing-md); /* Use sm for vertical padding */
  background-color: var(--background);
  align-items: center; /* Vertically align items in the row */
  border-bottom: 1px solid var(--grey-light); /* Add separator */
  width: 100%; /* Ensure row takes full width */
  box-sizing: border-box; /* Include padding/border in width */
  text-align: left; /* Ensure text aligns left by default */
}

.submission-row:hover {
  background-color: var(--background-dark);
}

/* Status and Action cells - ensure they align left */
.submission-cell {
  padding: var(--spacing-xs) var(--spacing-md);
  display: flex;
  align-items: center;
  /* Default alignment is start (left) for flex */
  justify-content: flex-start; /* Explicitly align content left */
  text-align: left;
  overflow: hidden; /* Prevent content overflow issues */
  text-overflow: ellipsis; /* Add ellipsis if text is too long */
}
.submission-cell .action-buttons {
  justify-content: flex-end; /* Keep actions aligned to the right within their cell */
  margin-left: auto; /* Push actions to the right */
}

.submission-party {
  padding-left: var(--spacing-xl);
  font-weight: normal;
  display: flex;
  flex-direction: column;
}

/* Style the first cell containing parties and potentially label */
.submission-cell.submission-party {
  padding-left: 0; /* Remove default padding if needed */
  display: flex;
  flex-direction: column; /* Stack label and parties vertically by default */
  gap: var(--spacing-xs);
  align-items: flex-start; /* Align items left */
}

.party-names-container {
  display: flex;
  flex-direction: column; /* Stack Client/Admin vertically by default */
  gap: 2px; /* Small gap between client/admin lines */
  width: 100%; /* Take available width */
}

.party-name {
  margin-bottom: 0; /* Remove default margin */
  font-size: 0.9rem; /* Adjust font size */
  display: flex; /* Use flex for badge and name */
  align-items: center; /* Align badge and name */
  gap: var(--spacing-xs);
}

.action-buttons {
  display: flex;
  gap: var(--spacing-xs);
  justify-content: flex-end;
}

.action-button {
  min-width: auto;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.8rem;
  height: 28px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px !important;
  font-size: 0.75rem;
  text-transform: capitalize;
  background-color: var(--grey-light);
  color: white;
  text-align: center;
}

.status-completed {
  background-color: var(--success);
}

.status-pending, .status-awaiting {
  background-color: var(--warning);
}

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

.status-in-progress {
  background-color: var(--info);
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  
}

.party-badge {
  /* Keep existing styles */
  display: inline-block;
  margin-right: 0; /* Remove margin, use gap */
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500; /* Make badge slightly bolder */
  flex-shrink: 0; /* Prevent badge from shrinking */
}

/* Dark theme styles */
.dark-theme .explorer-header {
  background-color: var(--background-dark);
}

.dark-theme .template-group-header {
  background-color: var(--background-dark);
}

.dark-theme .template-group-header:hover {
  background-color: var(--background);
}

.dark-theme .submission-row {
  background-color: var(--background-dark);
  border-color: var(--grey); /* Adjust border color for dark theme */
}

.dark-theme .submission-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Settings Icon Button */
.settings-container {
  /* position: absolute; Or fixed if you want it always visible */
  /* top: var(--spacing-md); */
  right: var(--spacing-md);
  z-index: 1001; /* Ensure it's above other elements */
}

.settings-button {
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--spacing-sm);
  border: none !important; /* Remove border */
  border-radius: 50% !important; /* Keep it round */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; /* Adjust size */
  height: 38px; /* Adjust size */
  transition: var(--transition);
}

/* .settings-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: rotate(15deg);
} */

.dark-theme .settings-button {
  background: transparent;
  color: var(--text-secondary);
}

/* .dark-theme .settings-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: rotate(15deg);
} */

.settings-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.cog-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.settings-button:hover .cog-icon {
  transform: rotate(45deg);
}

/* Settings Modal Specific Styles */
#settingsModal .modal-content {
max-width: 700px; /* Adjust width if needed */
}

.settings-section {
margin-bottom: var(--spacing-lg);
padding-bottom: var(--spacing-lg);
border-bottom: 1px solid var(--grey-light);
}
.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h3 {
margin-bottom: var(--spacing-md);
color: var(--primary);
font-size: 1.2rem;
font-weight: 500;
}

.theme-toggle-setting {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

#templateBlacklistInput {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--grey-light);
  /* border-radius: var(--border-radius) !important; */ /* Removed !important */
  font-size: 0.95rem;
  min-height: 150px;
  background-color: var(--background);
  color: var(--text-primary);
  resize: vertical; /* Allow vertical resize */
  line-height: 1.5;
}

#templateBlacklistInput:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.dark-theme #templateBlacklistInput {
  background-color: var(--background-dark);
  border-color: var(--grey);
  color: var(--text-primary);
}

/* Ensure theme toggle button fits well */
#settingsModal .theme-toggle {
position: relative; /* Override absolute if needed */
top: auto;
right: auto;
box-shadow: none; /* Remove default shadow */
border: 1px solid var(--grey-light);
}
#settingsModal .theme-toggle:hover {
  background-color: var(--background-dark);
}
.dark-theme #settingsModal .theme-toggle {
  border-color: var(--grey);
}
.dark-theme #settingsModal .theme-toggle:hover {
  background-color: var(--background);
}

/* iOS-style toggle switch (smaller version) */
.small-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.small-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.small-switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

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

.small-switch input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

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

/* Template group header with archive toggle */
.template-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.archive-toggle-container {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 10px;
}

.archive-toggle-label {
  font-size: 0.8em;
  margin-right: 6px;
  color: var(--text-secondary);
}

/* Style for archived submissions */
.archived-submission {
  opacity: 0.8;
  background-color: rgba(0,0,0,0.03);
}

.status-archived {
  background-color: #aaa;
  color: white;
}

/* Explorer search container */
.explorer-search-container {
  padding: 10px 15px;
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.explorer-search-container .search-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9em;
}

.clear-search-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 5px;
  margin-left: 5px;
}

.submission-count-status {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-left: 6px;
}

/* Dark mode adjustments */
.dark-theme .archived-submission {
  background-color: rgba(255,255,255,0.03);
}

.dark-theme .explorer-search-container {
  background-color: var(--background-dark);
  border-color: var(--grey);
}

.dark-theme .explorer-search-container .search-input {
  border-color: var(--grey);
  background-color: var(--background);
}

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

/* New Opportunity Creation Modal Styles */
.contact-search-section,
.new-contact-section {
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-md);
  border: 1px solid var(--grey-light);
  border-radius: var(--border-radius);
}

.search-fields,
.contact-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.search-fields input,
.contact-fields input {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--grey-light);
  border-radius: var(--border-radius);
}

.search-results {
  margin-top: var(--spacing-md);
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--grey-light);
  border-radius: var(--border-radius);
}

.contact-result {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--grey-light);
  cursor: pointer;
  transition: var(--transition);
}

.contact-result:hover {
  background-color: var(--background-dark);
}

.contact-result.selected {
  background-color: var(--primary-light);
  color: var(--light);
}

.contact-result:last-child {
  border-bottom: none;
}

/* Dark theme adjustments */
.dark-theme .contact-search-section,
.dark-theme .new-contact-section {
  border-color: var(--grey);
}

.dark-theme .search-fields input,
.dark-theme .contact-fields input {
  background-color: var(--background-dark);
  border-color: var(--grey);
  color: var(--text-primary);
}

.dark-theme .search-results {
  border-color: var(--grey);
}

.dark-theme .contact-result:hover {
  background-color: var(--background-dark);
}

.dark-theme .contact-result.selected {
  background-color: var(--primary-dark);
}

/* Direct match toggle for contact search in opportunity creation modal */
.direct-match-toggle {
  display: flex;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.direct-match-toggle input[type="checkbox"] {
  margin-right: 5px;
}

.contact-result .contact-label {
  font-weight: 600;
  color: #666;
  margin-right: 4px;
}

/* Dark mode support */
.dark-theme .direct-match-toggle {
  color: #ddd;
}

.dark-theme .contact-result .contact-label {
  color: #aaa;
}
