/* CRM Dashboard Styles */
.conversation-summary-box {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 24px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.summary-header-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 16px 12px;
}

.summary-header-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.summary-header-content > * {
  margin-right: 8px;
}

.summary-header-content > *:last-child {
  margin-right: 0;
}

.summary-header-content h4 {
  margin: 0;
  font-size: 15px;
  color: #9333ea;
  font-weight: 600;
  display: flex;
  align-items: center;
}

#refresh-summary-btn {
  background: transparent;
  color: #9333ea;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-content-crm {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.summary-content-inner {
  padding: 0 12px 12px 12px;
}

.summary-content-box {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid #9333ea;
}

.summary-timestamp {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
}

.summary-content-box p {
  margin: 0;
  font-size: 14px;
  color: #333;
  line-height: 1.8;
}

.summary-address-link {
  color: #9333ea;
  text-decoration: underline;
}

.summary-strong {
  color: #9333ea;
}

.checklist-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.checklist-container h5 {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #9333ea;
  font-weight: 600;
}

.checklist-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}

.checklist-item {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checklist-label span.checked {
  text-decoration: line-through;
  opacity: 0.6;
}

.suggested-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

#send-suggested-btn {
  background: #9333ea;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  flex: 1;
}

#schedule-suggested-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  flex: 1;
}

#generate-summary-btn {
  background: #9333ea;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
}

.conversation-summary-box.no-summary {
  padding: 16px 12px;
}

.conversation-summary-box.no-summary h4 {
  font-size: 15px;
  color: #9333ea;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quote-header {
  cursor: pointer;
  position: relative;
  padding: 16px 12px;
}

.quote-header-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quote-title-badges {
  display: flex;
  flex-direction: column;
  text-transform: uppercase;
  flex: 1;
}

.quote-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.quote-title-badges h4 {
  margin: 0;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  padding-top: 14px;
}

.quote-toggle-icon {
  transition: transform 0.3s;
}

.quote-toggle-icon.rotated {
  transform: rotate(-90deg);
}

.quote-header h4 {
  margin: 0;
}

.edit-quote-btn {
  position: absolute;
  top: 8px;
  right: 4px;
  background: transparent;
  border: none;
  color: #9333ea;
  cursor: pointer;
  padding: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  border-radius: 6px;
}

.edit-quote-btn svg {
  width: 24px;
  height: 24px;
}

.edit-quote-btn:hover svg {
  stroke: white;
}

.quote-content {
  padding: 12px;
}

.quote-content.hidden {
  display: none;
}

.customer-page-link-container {
  margin-bottom: 12px;
}

.customer-page-link {
  display: block;
  background: #9333ea;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  text-align: center;
}

.detail-value.phone-link {
  color: inherit;
  text-decoration: none;
}

.notes-section {
  margin-bottom: 24px;
  margin-top: 16px;
}

.notes-header-toggle {
  margin: 0;
  padding: 16px 6px 6px 12px;
  font-size: 15px;
  color: #9333ea;
  font-weight: 600;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.notes-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 12px 16px 12px;
}

.note-item {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid #9333ea;
}

.note-item.no-timestamp {
  border-left: 3px solid #666;
}

.note-timestamp {
  color: #666;
  font-size: 11px;
  margin-bottom: 6px;
  font-weight: 500;
}

.note-text {
  color: #333;
  font-size: 14px;
}

.quotes-section.event-details {
  margin-bottom: 24px;
}

.event-details-content {
  padding: 0 12px 12px 12px;
}

.status-badge {
  font-size: 12px;
  padding: 6px 10px 6px 10px;
  border-radius: 0;
  font-weight: 600;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 50%, calc(100% - 4px) 100%, 0 100%, 4px 50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.status-accepted {
  background: #3b82f6;
  color: white;
}

.status-pending {
  background: #f59e0b;
  color: white;
}

.status-declined {
  background: #ef4444;
  color: white;
}

.status-deposit {
  background: #10b981;
  color: white;
}

.status-paid {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
  color: #000;
  text-shadow: 0 0 2px rgba(255, 215, 0, 0.5);
}

.status-cocktails {
  background: #9333ea;
  color: white;
  padding: 6px 8px;
}

.status-cocktails svg {
  display: block;
}



#crm-panel {
  padding: 0 !important;
}

.crm-dashboard {
  padding: 8px 8px 0 8px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.quotes-section h3 {
  padding-left: 16px !important;
}

button svg,
.edit-quote-btn svg,
#refresh-summary-btn svg,
.action-btn svg,
.detail-icon svg,
.metric-icon svg {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
}

button,
.edit-quote-btn,
#refresh-summary-btn,
.action-btn {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

body.dark-mode .conversation-summary-box {
  background: #2c2c2e;
  border-color: #38383a;
}

body.dark-mode .summary-content-box,
body.dark-mode .note-item {
  background: #1c1c1e;
}

body.dark-mode .summary-timestamp,
body.dark-mode .note-timestamp {
  color: #999;
}

body.dark-mode .summary-content-box p,
body.dark-mode .note-text,
body.dark-mode .checklist-label {
  color: #e0e0e0;
}

/* Tab Styles */
.crm-tabs {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  border-top: 2px solid #e0e0e0;
  position: sticky;
  bottom: 0;
  background: white;
  z-index: 10;
}

.crm-tab {
  background: transparent;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  border-top: 3px solid transparent;
  transition: all 0.2s;
}

.crm-tab:hover {
  color: #9333ea;
  background: #f8f9fa;
}

.crm-tab.active {
  color: #9333ea;
  border-top-color: #9333ea;
}

.crm-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
}

body.dark-mode .crm-tabs {
  border-top-color: #38383a;
  background: #1c1c1e;
}

body.dark-mode .crm-tab {
  color: #999;
}

body.dark-mode .crm-tab:hover {
  color: #9333ea;
  background: #2c2c2e;
}

body.dark-mode .crm-tab.active {
  color: #9333ea;
}

/* Mobile: Actions tab content from bottom to top */
@media (max-width: 768px) {
  .crm-tab-content[data-content="actions"][style*="display: block"] {
    display: flex !important;
    flex-direction: column-reverse;
  }
  
  .generic-h4 {
    margin-top: 0 !important;
  }
}

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

/* Customer Portal Button */
.portal-button-container {
  padding: 0 12px 16px 12px;
}

.portal-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(147, 51, 234, 0.2);
}

.portal-button:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 4px 8px rgba(147, 51, 234, 0.3);
  transform: translateY(-1px);
}

.portal-button svg {
  flex-shrink: 0;
}

body.dark-mode .portal-button {
  box-shadow: 0 2px 4px rgba(147, 51, 234, 0.4);
}

body.dark-mode .portal-button:hover {
  box-shadow: 0 4px 8px rgba(147, 51, 234, 0.5);
}
