/* ?? General Styles */
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f8faff 0%, #e8f2ff 100%);
  color: #333;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

html, body {
  overflow-x: hidden;
}

/* Auth container visibility control - IMPORTANT: Always show by default */
#authContainer {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 1000 !important;
}

/* Hide auth container when authenticated */
#authContainer.hidden,
body.authenticated #authContainer {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide elements by default, show only when logged in */
#topBar.hidden, #sidebar.hidden, #mainContent.hidden {
  display: none !important;
}

/* Auth container visibility control */
#authContainer.hidden {
  display: none !important;
}

body, html {
  overflow-x: hidden !important;
}

/* Body layout when authenticated */
body.authenticated {
  margin-left: 250px; /* Adjust based on sidebar width */
}

/* Responsive body layout */
@media (max-width: 1200px) {
  body.authenticated {
    margin-left: 200px;
  }
}

@media (max-width: 900px) {
  body.authenticated {
    margin-left: 0;
  }
}

/* Remove margin-left on body when sidebar is hidden */
body.sidebar-hidden {
  margin-left: 0 !important;
}

/* Responsive fix: prevent horizontal scroll on all containers */
.container1, .main-content, .module-content, .sidebar, .top-bar {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar hidden state for mobile/desktop */
#sidebar.hidden {
  display: none !important;
}

/* Top bar hidden state */
#topBar.hidden {
  display: none !important;
}

/* Main content hidden state */
#mainContent.hidden {
  display: none !important;
}

/* Main content visibility control - hide by default */
#mainContent {
  display: none;
}

/* Show main content only when authenticated */
#mainContent.authenticated {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Force hide main content when not authenticated - extra protection */
#mainContent:not(.authenticated) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide sidebar and top bar by default */
#sidebar, #topBar {
  display: none;
}

/* Show sidebar and top bar when authenticated */
#sidebar.authenticated {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#topBar.authenticated {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Force hide sidebar and top bar when not authenticated - extra protection */
#sidebar:not(.authenticated) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#topBar:not(.authenticated) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ?? Auth Container */
.container1 {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 106, 255, 0.1);
  width: 400px;
  text-align: center;
  margin: 100px auto 0 auto;
  border: 1px solid rgba(0, 106, 255, 0.1);
}

.auth-box h1 {
  color: #0056ff;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 30px;
  letter-spacing: -0.5px;
}

.auth-box form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-box label {
  font-weight: 600;
  color: #333;
  text-align: left;
  margin-bottom: 8px;
}

.auth-box input {
  padding: 14px 16px;
  border: 2px solid #e1e8ff;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #fafbff;
}

.auth-box input:focus {
  border-color: #0056ff;
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 86, 255, 0.1);
  outline: none;
}

.auth-box button {
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  position: relative;
}

.auth-box button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0044cc 0%, #0056ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 86, 255, 0.3);
}

.auth-box button:disabled {
  background: linear-gradient(135deg, #cccccc 0%, #999999 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-box button:disabled:hover {
  transform: none;
  box-shadow: none;
}

#loginBtnLoading {
  font-style: italic;
  opacity: 0.9;
}

.auth-box .error {
  color: #dc3545;
  font-size: 14px;
  margin-top: 10px;
  padding: 10px;
  background: #fff5f5;
  border-radius: 6px;
  border: 1px solid #fed7d7;
}

/* Top Bar Styles */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 70px;
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  box-shadow: 0 4px 20px rgba(0, 106, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1200;
  padding: 0 32px;
  box-sizing: border-box;
}

.top-bar-metrics {
  display: flex;
  align-items: center;
  gap: 32px;
}

.user-stat {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 16px;
  color: white;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-stat-label {
  font-size: 12px;
  opacity: 0.9;
  display: block;
  margin-bottom: 2px;
}

.user-stat-value {
  font-size: 16px;
  font-weight: 700;
  display: block;
}

.top-bar-timer {
  font-size: 18px;
  color: white;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.refresh-stats-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 8px;
}

.refresh-stats-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(180deg);
}

.top-bar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 20px;
  flex: 1;
  max-width: 800px;
}

.dashboard-title {
  font-size: 28px;
  font-weight: 700;
  color: white;
  text-align: center;
  margin: 0;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Sidebar Styles */
.sidebar {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 70px); /* Adjust for top bar */
  position: fixed;
  left: 0;
  top: 70px; /* Start below the top bar */
  width: 250px;
  background: #f8f9fa;
  box-shadow: 2px 0 16px rgba(0,86,255,0.07);
  z-index: 1001;
  overflow-y: auto;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0;
  padding: 20px 0;
}

.sidebar-btn {
  background: #ffffff;
  color: #333;
  border: none;
  padding: 16px 24px;
  margin: 4px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid #e9ecef;
}

.sidebar-btn:hover {
  background: #e3f2fd;
  color: #0056ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.sidebar-btn.active {
  background: #0056ff;
  color: white;
  box-shadow: 0 4px 12px rgba(0,86,255,0.3);
}

.sidebar-btn.active:hover {
  background: #0044cc;
  color: white;
}

.user-id-card {
  margin-top: auto;
  margin-bottom: 32px;
  margin-left: 16px;
  margin-right: 16px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,86,255,0.04);
  padding: 18px 16px 14px 16px;
  text-align: left;
  font-size: 15px;
  color: #0056ff;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
}

.user-id-label {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 4px;
  font-weight: 500;
}

.user-id-value {
  font-weight: bold;
  color: #0056ff;
  word-break: break-all;
  font-size: 15px;
  padding-top: 2px;
}

/* Main Content Area */
.main-content {
  margin-left: 250px;
  margin-top: 80px; /* Ensure enough space for the top bar */
  padding: 0;
  min-height: calc(100vh - 80px);
  background: #f8faff;
  transition: margin-top 0.2s;
}

.module-content {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 106, 255, 0.08);
  padding: 40px;
  border: 1px solid #e1e8ff;
}

/* Logo Styling */
.logo {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px 0;
}

.responsive-logo {
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 106, 255, 0.1));
}

/* Search Container */
.search-container {
  background: #f8faff;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 40px;
  border: 1px solid #e1e8ff;
}

.search-container h2 {
  font-size: 24px;
  font-weight: 700;
  color: #0056ff;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.search-main-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.search-filter-dropdown {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 2px solid #e1e8ff;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-filter-dropdown:focus {
  border-color: #0056ff;
  box-shadow: 0 0 0 3px rgba(0, 86, 255, 0.1);
  outline: none;
}

.search-input-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.search-input-row input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid #e1e8ff;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search-input-row input:focus {
  border-color: #0056ff;
  box-shadow: 0 0 0 3px rgba(0, 86, 255, 0.1);
  outline: none;
}

.search-input-row button {
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.search-input-row button:hover {
  background: linear-gradient(135deg, #0044cc 0%, #0056ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 86, 255, 0.3);
}

.search-actions-row {
  display: flex;
  gap: 16px;
}

.new-deal-btn {
  background: linear-gradient(135deg, #ff7b00 0%, #ff9500 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.new-deal-btn:hover {
  background: linear-gradient(135deg, #e66b00 0%, #ff7b00 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 123, 0, 0.3);
}

.new-deal-full-btn {
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  display: block;
  box-sizing: border-box;
}

.new-deal-full-btn:hover {
  background: linear-gradient(135deg, #0044cc 0%, #0056ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 86, 255, 0.3);
}

.start-new-deal-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.start-new-deal-btn:hover {
  background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Enhanced Tab Navigation Styles */
.tabs {
  display: flex;
  width: 100%;
  margin: 20px 0;
  border-bottom: 2px solid #e1e8ff;
  padding-bottom: 0;
  background: #f8faff;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.tab-button {
  flex: 1;
  background: linear-gradient(135deg, #f8faff 0%, #e8f2ff 100%);
  color: #666;
  border: none;
  border-right: 1px solid #e1e8ff;
  padding: 16px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-align: center;
  position: relative;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-button:last-child {
  border-right: none;
}

.tab-button:hover {
  background: linear-gradient(135deg, #e1e8ff 0%, #d0e2ff 100%);
  color: #0056ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 86, 255, 0.15);
}

.tab-button.active {
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 86, 255, 0.3);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #0056ff;
}

/* Enhanced Navigation Buttons */
.tab-navigation-buttons {
  display: flex;
  gap: 16px;
  margin: 24px 0;
  width: 100%;
}

.tab-next-button, .tab-back-button {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-next-button {
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  color: white;
}

.tab-next-button:hover {
  background: linear-gradient(135deg, #0044cc 0%, #0056ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 86, 255, 0.3);
}

.tab-next-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-back-button {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
}

.tab-back-button:hover {
  background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.tab-back-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tab Content Styling */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

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

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

/* Form Styling */
.deal-box {
  background: white;
  border-radius: 12px;
  padding: 32px;
  border: 1px solid #e1e8ff;
}

.deal-box h1 {
  font-size: 28px;
  text-align: center;
  margin-bottom: 32px;
  color: #0056ff;
  font-weight: 700;
  letter-spacing: -0.5px;
}

form {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: none;
}

form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  margin-top: 20px;
}

form input,
form select,
form textarea {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 2px solid #e1e8ff;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  background: #fafbff;
  transition: all 0.3s ease;
}

form input:focus,
form select:focus,
form textarea:focus {
  border-color: #0056ff;
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 86, 255, 0.1);
  outline: none;
}

form button {
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 24px;
  min-width: 140px;
}

form button:hover {
  background: linear-gradient(135deg, #0044cc 0%, #0056ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 86, 255, 0.3);
}

/* Field Helper Text Styles */
.field-helper-text {
  font-size: 12px;
  color: #666;
  margin-top: -12px;
  margin-bottom: 16px;
  font-style: italic;
  line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .sidebar {
    width: 200px;
  }
  
  .main-content {
    margin-left: 200px;
    padding: 32px;
  }
  
  .module-content {
    padding: 32px;
  }
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    height: auto;
    padding: 16px;
    gap: 12px;
  }
  
  .top-bar-metrics {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
  
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: center;
    padding: 16px;
    box-shadow: none;
    border-right: none;
    border-bottom: 1px solid #e1e8ff;
  }
  
  .sidebar-btn {
    width: auto;
    margin: 0 8px;
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .main-content {
    margin-left: 0;
    margin-top: 100px; /* More space for mobile top bar */
    padding: 0;
  }
  
  .module-content {
    padding: 24px;
  }
  
  .search-filters {
    flex-direction: column;
  }
  
  .search-filter-dropdown {
    min-width: auto;
  }
  
  .search-input-row {
    flex-direction: column;
  }
  
  .search-actions-row {
    justify-content: center;
  }
  
  .top-bar-title {
    margin: 12px 0;
    max-width: 600px;
  }
  
  .dashboard-title {
    font-size: 24px;
    white-space: normal;
    line-height: 1.3;
  }
  
  .deal-entry-right-pane {
    padding: 16px;
  }
  
  .deal-entry-search-filters {
    gap: 8px;
  }
  
  .deal-entry-search-actions {
    gap: 6px;
  }
  
  .deal-entry-search-result-item {
    padding: 12px;
    font-size: 12px;
  }
  
  /* Mobile Quill Editor Adjustments */
  .ql-toolbar {
    padding: 6px;
  }
  
  .ql-toolbar button {
    width: 24px;
    height: 24px;
  }
  
  .ql-toolbar .ql-formats {
    margin-right: 10px;
  }
  
  .ql-editor {
    min-height: 100px;
    padding: 8px;
    font-size: 13px;
  }
  
  .ai-content-section {
    padding: 16px;
    margin: 16px 0;
  }
  
  .ai-generate-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .container1 {
    width: 90%;
    padding: 32px 24px;
    margin: 60px auto 0 auto;
  }
  
  .top-bar {
    padding: 12px;
  }
  
  .user-stat {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .top-bar-timer {
    font-size: 14px;
    padding: 6px 12px;
  }
  
  .logout-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
  
  .search-container {
    padding: 24px;
  }
  
  .search-container h2 {
    font-size: 20px;
  }
  
  .deal-box {
    padding: 24px;
  }
  
  .deal-box h1 {
    font-size: 24px;
  }
  
  .tabs {
    flex-direction: column;
    gap: 8px;
  }
  
  .tab-button {
    margin: 0;
  }
  
  .top-bar-title {
    margin: 8px 0;
    max-width: 400px;
  }
  
  .dashboard-title {
    font-size: 20px;
    white-space: normal;
    line-height: 1.4;
  }
  
  .deal-entry-right-pane {
    padding: 12px;
  }
  
  .deal-entry-search-result-item {
    padding: 10px;
    font-size: 11px;
  }
  
  .deal-entry-search-result-item .deal-title {
    font-size: 12px;
  }
  
  /* Mobile Quill Editor Further Adjustments */
  .ql-toolbar {
    padding: 4px;
  }
  
  .ql-toolbar button {
    width: 22px;
    height: 22px;
  }
  
  .ql-toolbar .ql-formats {
    margin-right: 8px;
  }
  
  .ql-editor {
    min-height: 80px;
    padding: 6px;
    font-size: 12px;
  }
  
  .ai-content-section {
    padding: 12px;
    margin: 12px 0;
  }
  
  .ai-content-heading {
    font-size: 14px;
    margin-bottom: 12px;
  }
  
  .ai-generate-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* Inline search results styling */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 32px 0 0 0;
  width: 100%;
}

.search-result-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 106, 255, 0.08);
  border: 1.5px solid #e1e8ff;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 16px;
  color: #222;
  position: relative;
}

.search-result-item .deal-title {
  font-size: 20px;
  font-weight: 700;
  color: #0056ff;
  margin-bottom: 6px;
}

.search-result-item .deal-provider {
  color: #222;
  font-weight: 500;
}

.search-result-item .deal-status {
  color: #28a745;
  font-weight: 600;
}

.search-result-item .deal-date {
  color: #888;
  font-size: 14px;
}

.search-result-item .deal-phone {
  color: #444;
  font-size: 14px;
}

.search-result-item .deal-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.search-result-item .edit-deal-btn,
.search-result-item .copy-deal-btn {
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.search-result-item .edit-deal-btn:hover {
  background: linear-gradient(135deg, #0044cc 0%, #0056ff 100%);
  transform: translateY(-2px);
}

.search-result-item .copy-deal-btn {
  background: linear-gradient(135deg, #ff7b00 0%, #ff9500 100%);
}

.search-result-item .copy-deal-btn:hover {
  background: linear-gradient(135deg, #e66b00 0%, #ff7b00 100%);
  transform: translateY(-2px);
}

@media (max-width: 700px) {
  .search-result-item {
    padding: 16px 8px;
    font-size: 15px;
  }
  .search-result-item .deal-title {
    font-size: 17px;
  }
  .search-result-item .edit-deal-btn,
  .search-result-item .copy-deal-btn {
    padding: 8px 10px;
    font-size: 13px;
  }
}

.clear-search-btn {
  background: linear-gradient(135deg, #e1e8ff 0%, #f8faff 100%);
  color: #0056ff;
  border: 2px solid #e1e8ff;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.3s ease;
  min-width: 120px;
}
.clear-search-btn:hover {
  background: linear-gradient(135deg, #d0e2ff 0%, #e1e8ff 100%);
  color: #003399;
  border-color: #0056ff;
}

/* Split-pane layout for Deal Entry with search results */
.deal-entry-split-layout {
  display: flex;
  gap: 32px;
  height: calc(100vh - 150px);
  min-height: 600px;
}

.deal-entry-left-pane {
  flex: 6;
  min-width: 0;
  overflow-y: auto;
  padding-right: 16px;
}

.deal-entry-right-pane {
  width: 200px;
  min-width: 180px;
  background: #f8faff;
  border-radius: 12px;
  border: 1px solid #e1e8ff;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.deal-entry-right-pane h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0056ff;
  margin-bottom: 20px;
  text-align: center;
}

.deal-entry-search-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.deal-entry-search-filters select,
.deal-entry-search-filters input {
  padding: 10px 12px;
  border: 2px solid #e1e8ff;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  transition: all 0.3s ease;
}

.deal-entry-search-filters select:focus,
.deal-entry-search-filters input:focus {
  border-color: #0056ff;
  box-shadow: 0 0 0 3px rgba(0, 86, 255, 0.1);
  outline: none;
}

.deal-entry-search-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.deal-entry-search-actions button {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.deal-entry-search-actions .search-btn {
  background: linear-gradient(135deg, #0056ff 0%, #007bff 100%);
  color: white;
}

.deal-entry-search-actions .search-btn:hover {
  background: linear-gradient(135deg, #0044cc 0%, #0056ff 100%);
  transform: translateY(-1px);
}

.deal-entry-search-actions .clear-btn {
  background: linear-gradient(135deg, #e1e8ff 0%, #f8faff 100%);
  color: #0056ff;
  border: 2px solid #e1e8ff;
}

.deal-entry-search-actions .clear-btn:hover {
  background: linear-gradient(135deg, #d0e2ff 0%, #e1e8ff 100%);
  border-color: #0056ff;
}

.deal-entry-search-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deal-entry-search-result-item {
  background: white;
  border-radius: 8px;
  border: 1px solid #e1e8ff;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
}

.deal-entry-search-result-item:hover {
  border-color: #0056ff;
  box-shadow: 0 2px 8px rgba(0, 106, 255, 0.1);
  transform: translateY(-1px);
}

.deal-entry-search-result-item.selected {
  border-color: #0056ff;
  background: #f0f4ff;
  box-shadow: 0 2px 8px rgba(0, 106, 255, 0.15);
}

.deal-entry-search-result-item .deal-title {
  font-size: 14px;
  font-weight: 700;
  color: #0056ff;
  margin-bottom: 4px;
}

.deal-entry-search-result-item .deal-provider {
  color: #333;
  font-weight: 500;
  margin-bottom: 2px;
}

.deal-entry-search-result-item .deal-status {
  color: #28a745;
  font-weight: 600;
  font-size: 12px;
}

.deal-entry-search-result-item .deal-date {
  color: #666;
  font-size: 11px;
  margin-top: 4px;
}

/* Responsive adjustments for split layout */
@media (max-width: 1200px) {
  .deal-entry-split-layout {
    flex-direction: column;
    height: auto;
  }
  
  .deal-entry-right-pane {
    width: 100%;
    min-width: auto;
    order: -1;
  }
  
  .deal-entry-left-pane {
    padding-right: 0;
    flex: 1;
  }
}

@media (max-width: 900px) {
  .top-bar-logo {
    margin: 12px 0;
    height: 60px;
    max-width: 600px;
  }
  
  .top-bar .responsive-logo {
    height: 55px;
    max-width: 100%;
  }
  
  .deal-entry-right-pane {
    padding: 16px;
  }
  
  .deal-entry-search-filters {
    gap: 8px;
  }
  
  .deal-entry-search-actions {
    gap: 6px;
  }
  
  .deal-entry-search-result-item {
    padding: 12px;
    font-size: 12px;
  }
  
  /* Mobile Quill Editor Adjustments */
  .ql-toolbar {
    padding: 6px;
  }
  
  .ql-toolbar button {
    width: 24px;
    height: 24px;
  }
  
  .ql-toolbar .ql-formats {
    margin-right: 10px;
  }
  
  .ql-editor {
    min-height: 100px;
    padding: 8px;
    font-size: 13px;
  }
  
  .ai-content-section {
    padding: 16px;
    margin: 16px 0;
  }
  
  .ai-generate-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .top-bar-logo {
    margin: 8px 0;
    height: 50px;
    max-width: 400px;
  }
  
  .top-bar .responsive-logo {
    height: 45px;
    max-width: 100%;
  }
  
  .deal-entry-right-pane {
    padding: 12px;
  }
  
  .deal-entry-search-result-item {
    padding: 10px;
    font-size: 11px;
  }
  
  .deal-entry-search-result-item .deal-title {
    font-size: 12px;
  }
  
  /* Mobile Quill Editor Further Adjustments */
  .ql-toolbar {
    padding: 4px;
  }
  
  .ql-toolbar button {
    width: 22px;
    height: 22px;
  }
  
  .ql-toolbar .ql-formats {
    margin-right: 8px;
  }
  
  .ql-editor {
    min-height: 80px;
    padding: 6px;
    font-size: 12px;
  }
  
  .ai-content-section {
    padding: 12px;
    margin: 12px 0;
  }
  
  .ai-content-heading {
    font-size: 14px;
    margin-bottom: 12px;
  }
  
  .ai-generate-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* Deal Textarea Styles */
.deal-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 200px;
  padding: 12px;
  border: 2px solid #e1e8ff;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  font-family: 'Poppins', sans-serif;
  background: white;
  resize: vertical;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.deal-textarea:focus {
  border-color: #0056ff;
  box-shadow: 0 0 0 3px rgba(0, 86, 255, 0.1);
  outline: none;
}

.deal-textarea::placeholder {
  color: #999;
  font-style: italic;
}

/* AI Content Section Styles */
.ai-content-section {
  background: #f8faff;
  border: 1px solid #e1e8ff;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  width: 100%;
  box-sizing: border-box;
}

.ai-content-heading {
  color: #0056ff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

/* AI Generate Button Styles */
.ai-generate-btn {
  width: 100%;
  display: block;
  background: #0056ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  padding: 16px 0;
  margin: 12px 0 0 0;
  box-shadow: 0 2px 8px rgba(0,86,255,0.08);
  width: 100%;
  display: block;
  background: #0056ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  padding: 14px 0;
  margin-bottom: 18px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0,86,255,0.08);
}
.payout-search-btn:hover {
  background: #0044cc;
}

@media (max-width: 600px) {
  .payout-phone-input, .payout-search-btn {
    font-size: 15px;
    padding: 12px 0;
  }
}

/* Current Value Display Styles for Payout Form */
.current-value-display {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #0056ff;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.current-value-display:hover {
  background: #f0f2f5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.current-value-display strong {
  color: #0056ff;
  font-weight: 600;
}

.current-value-display img {
  max-width: 100px;
  max-height: 60px;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin-top: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Metadata display (last updated info) */
.current-value-display[style*="border-left: 3px solid #28a745"] {
  background: #f1f3f4;
  border-left-color: #28a745;
  margin-top: 16px;
  font-size: 11px;
  color: #888;
}

.current-value-display[style*="border-left: 3px solid #28a745"] strong {
  color: #28a745;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .current-value-display {
    font-size: 11px;
    padding: 4px 6px;
  }
  
  .current-value-display img {
    max-width: 80px;
    max-height: 50px;
  }
}

/* Disabled input styles for payout form */
.payout-fields input:disabled,
.user-display-info input:disabled {
  background-color: #f8f9fa;
  color: #6c757d;
  border-color: #dee2e6;
  cursor: not-allowed;
  opacity: 0.8;
}

.payout-fields input:disabled:focus,
.user-display-info input:disabled:focus {
  border-color: #dee2e6;
  box-shadow: none;
}

/* User info section styling */
.user-display-info {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.user-display-info label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
  display: block;
}

.user-display-info input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  margin-bottom: 12px;
}

.search-btn, .payout-full-btn {
  background: #0056ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  padding: 16px 0;
  margin: 12px 0 0 0;
  box-shadow: 0 2px 8px rgba(0,86,255,0.08);
  width: 100%;
  display: block;
  box-sizing: border-box;
}

.search-btn:hover, .payout-full-btn:hover {
  background: #0044cc;
}

@media (max-width: 600px) {
  .search-btn, .payout-full-btn {
    font-size: 16px;
    padding: 14px 0;
  }
}

.phone-search-group {
  display: flex;
  align-items: stretch;
  border: 2px solid #e1e8ff;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  gap: 12px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0,86,255,0.04);
}

.phone-search-group input[type="tel"] {
  flex: 1 1 0;
  border: 1px solid #e1e8ff;
  outline: none;
  font-size: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: transparent;
  color: #333;
  transition: border 0.2s;
}

.phone-search-group input[type="tel"]:focus {
  background: #f5f8ff;
  border-color: #0056ff;
}

.phone-search-group .search-user-btn {
  background: #0056ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 0 18px;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
}

.phone-search-group .search-user-btn:hover {
  background: #0044cc;
}

@media (max-width: 700px) {
  .phone-search-group {
    flex-direction: column;
    gap: 8px;
    padding: 6px;
  }
  .phone-search-group input[type="tel"],
  .phone-search-group .search-user-btn {
    border-radius: 8px;
    width: 100%;
    min-width: unset;
    padding: 12px 0;
  }
}

.payout-phone-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 2px solid #e1e8ff;
  border-radius: 8px;
  font-size: 16px;
  background: #fafbff;
  color: #333;
  transition: border 0.2s;
}
.payout-phone-input:focus {
  border-color: #0056ff;
  background: #fff;
}

.payout-search-btn {
  width: 100%;
  display: block;
  background: #0056ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  padding: 14px 0;
  margin-bottom: 18px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0,86,255,0.08);
}
.payout-search-btn:hover {
  background: #0044cc;
}

@media (max-width: 600px) {
  .payout-phone-input, .payout-search-btn {
    font-size: 15px;
    padding: 12px 0;
  }
}

/* Two-column calculated values layout */
.saved-values-column,
.recalculated-values-column {
  padding: 12px;
  border-radius: 6px;
}

.saved-values-column {
  background-color: #e3f2fd;
  border: 1px solid #bbdefb;
}

.recalculated-values-column {
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
}

.saved-value {
  color: #1976d2;
  font-weight: 600;
  background-color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #bbdefb;
}

.recalculated-value {
  color: #d32f2f;
  font-weight: 600;
  background-color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ffcdd2;
}

.recalculated-value.changed {
  background-color: #fff3e0;
  border: 2px solid #ff9800;
  color: #e65100;
  font-weight: 700;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .saved-values-column,
  .recalculated-values-column {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* Existing Photos Section Styles */
.existing-photos-section {
  margin-top: 20px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.existing-photos-section h4 {
  margin: 0 0 12px 0;
  color: #495057;
  font-size: 16px;
  font-weight: 600;
}

.existing-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.existing-photo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
}

.existing-photo-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.existing-photo-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 4px;
}

.existing-photo-item .photo-number {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
  text-align: center;
}

@media (max-width: 600px) {
  .existing-photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  
  .existing-photo-item img {
    height: 60px;
  }
  
  .existing-photo-item .photo-number {
    font-size: 11px;
  }
}

/* Submit Deal Button Spinner Styles */
.submit-deal-btn {
  position: relative;
  transition: all 0.3s ease;
}

.submit-deal-btn:disabled {
  background: #6c757d !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.submit-deal-btn .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.submit-deal-btn:disabled .btn-spinner {
  display: inline-block;
}

.submit-deal-btn:disabled .btn-text {
  opacity: 0.8;
}

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

/* Photo upload validation styles */
.photo-validation-error {
  color: #dc3545;
  font-size: 14px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 6px;
  display: none;
}

.photo-validation-error.show {
  display: block;
}

/* Google Places Autocomplete fixes */
.pac-container {
  z-index: 9999 !important;
  pointer-events: auto !important;
}

/* Enhanced helper text for Google Places instruction */
.field-helper-text {
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.4;
}

.field-helper-text strong {
  color: #0056ff;
}

.pac-item {
  cursor: pointer !important;
  pointer-events: auto !important;
}

.pac-item:hover {
  background-color: #f0f0f0 !important;
}

/* Ensure form inputs remain interactive when autocomplete is active */
form input:focus {
  z-index: 1;
  position: relative;
}

/* Fix for shop name input specifically */
#dealProviderNameInput {
  position: relative;
  z-index: 1;
}

#dealProviderNameInput:focus {
  z-index: 2;
}

/* Ensure other form elements don't interfere */
form input:not(#dealProviderNameInput) {
  z-index: 1;
}

/* Fix for autocomplete dropdown positioning */
.pac-container {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}

/* Ensure form containers don't block autocomplete */
.deal-box {
  overflow: visible !important;
  position: relative !important;
}

.tab-content {
  overflow: visible !important;
  position: relative !important;
}

/* Ensure the shop name input container doesn't clip the dropdown */
#tab1 {
  overflow: visible !important;
  position: relative !important;
}