/* Modern Minimalistic Design */
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  font-size: 0.875rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.loader {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  display: none;
  animation: spin 0.8s linear infinite;
  position: absolute;
}
#btnRefreshStats, #btnUpdateMastersheet {
    text-align: center;
    justify-content: center;
    display: flex;
}
.loader.is-active {
  display: inline-block;
}

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

/* Navigation */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  padding: 0 2rem;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  font-size: 0.9375rem;
  transition: all 0.2s;
  position: relative;
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Main Content */
.main {
  flex: 1;
  padding: 2rem;
  width: 100%;
  margin: 0 auto;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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



/* Panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* Fields */
.field {
  margin-bottom: 1.25rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  /* margin-bottom: 1.25rem; */
}
.upload-field-wrap {
    display: flex;
    gap: 50px;
    justify-content: space-between;
}
.upload-field-wrap .field {
    width: 50%;
}
.upload-field-wrap .field-row {
    width: 50%;
    flex-direction: column;
    display: flex;
    gap: 0;
}
.upload-field-wrap .field-row .field {
    margin-bottom: 0;
    width: 100%;
}
.clear-checkbox {
    margin-top: 10px !important;
}
.stats-refresh-row {
    width: 100%;
    justify-content: center;
}
.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color 0.2s;
}

.select option {
  background: var(--surface);
  color: var(--text);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.input::placeholder {
  color: var(--text-muted);
}

.textarea {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  resize: vertical;
}

/* Input Group */
.input-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.input-group .input {
  flex: 1;
  min-width: 200px;
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
}

.checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.checkbox span {
  user-select: none;
}

/* Chip Labels (Category Selection) */
.select-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9375rem;
}

.chip-label:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chip-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.chip-label input[type="checkbox"]:checked + span {
  color: var(--primary);
  font-weight: 500;
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}

.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-muted);
}

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

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn-with-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}

.btn-with-loader .btn-loader {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1rem;
  height: 1rem;
  border-width: 2px;
  border-radius: 50%;
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

/* Status Message */
.status-message {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.875rem;
  margin-bottom: 1rem;
  color: var(--primary);
  font-size: 0.9375rem;
}

/* Output */
.output {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #cbd5e1;
  max-height: 500px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.output:empty {
  display: none;
}

/* File Input */
.file-input {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  cursor: pointer;
}

.file-input::file-selector-button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  margin-right: 0.75rem;
}

.file-input::file-selector-button:hover {
  background: var(--primary-hover);
}

/* Login Page */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.login-card h1 {
  color: var(--primary);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.login-card .form-group {
  margin-bottom: 1.25rem;
}

.login-card .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.login-card .form-group input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color 0.2s;
}

.login-card .form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.login-card .btn-primary {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.auth-message {
  margin-top: 1rem;
  padding: 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-align: center;
}

.auth-message.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.auth-message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}



/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    padding: 0 1rem;
  }

  .nav-btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .main {
    padding: 1rem;
  }

  .panel {
    padding: 1rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .input-group {
    flex-direction: column;
  }

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

/* Additional styles for simplified dashboard */

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.status-idle {
  background: var(--text-muted);
  animation: none;
}

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

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

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

.status-text {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Output Box */
.output-box {
  margin-top: 1.5rem;
  min-height: 100px;
}

/* Log Output */
.log-output {
  background: #0a0e1a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  max-height: 600px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Stats Container */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stat-value {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  word-break: break-word;
}

.stats-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.stat-panel-title {
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.stat-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.stat-panel .stat-label {
  white-space: nowrap;
}

.stat-panel .stat-value {
  flex: 1;
  text-align: right;
}

/* Help Text */
.help-text {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Message Boxes */
.success-message {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  line-height: 1.6;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  line-height: 1.6;
}

.info-message {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  line-height: 1.6;
}

.success-message code,
.error-message code,
.info-message code {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
}

.error-text {
  color: var(--danger);
  font-weight: 600;
}


/* ====== chatbot css starts here======= */

/* Sidebar Styles */

.rs-chatbot-main-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.sidebar {
    width: 320px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chat-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

.chat-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.chat-item.active {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.chat-item.active, .chat-item-id, .chat-item.active .chat-item-count, .chat-item.active .chat-item-date{
  color: #000;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.chat-item-id {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.chat-item-count {
    font-size: 0.75rem;
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
}

.chat-item-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chat-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.chat-item-actions button {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.chat-item-actions button:hover {
    background: var(--background);
}

.chat-item-actions .delete-btn:hover {
    color: var(--error);
    border-color: var(--error);
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
}

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

.chat-header h1 {
    font-size: 1.5rem;
    color: var(--text);
}

.chat-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.chat-id-label {
    color: var(--text-secondary);
}

.chat-id-value {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
}

/* Stats Panel */
.stats-panel {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.stats-accordion {
    padding: 1rem 1.5rem;
}

.stats-accordion summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-accordion summary::-webkit-details-marker {
    display: none;
}

.btn-refresh {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
}

.btn-refresh:hover {
    background: var(--primary-hover);
    transform: rotate(90deg);
}

.stats-container {
    margin-top: 1rem;
}

.stats-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.stat-group {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.stat-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 500;
    color: var(--text);
    font-family: 'Courier New', monospace;
}

/* Settings Panel */
.settings-panel {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.settings-accordion {
    padding: 1rem 1.5rem;
}

.settings-accordion summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    user-select: none;
    list-style: none;
}

.settings-accordion summary::-webkit-details-marker {
    display: none;
}

.settings-content {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.input-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.input-label span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-label input,
.input-label select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--background);
}

.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.welcome-message h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.welcome-message p {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.example-text {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1rem !important;
}

/* Message Styles */
.message {
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease-out;
}

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

.message-question {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.question-icon {
    font-size: 1.25rem;
}

.question-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.question-text {
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
}

.message-question-text {
    font-weight: 500;
    color: var(--text);
}

.message-answer {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

.message-section {
    margin-bottom: 1.5rem;
}

.message-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-valid {
    background: #d1fae5;
    color: #065f46;
}

.status-invalid {
    background: #fee2e2;
    color: #991b1b;
}

.sql-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--error);
}

.results-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.results-table th {
    background: var(--background);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
}

.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.results-table tr:hover {
    background: var(--background);
}

.results-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.info-item {
    display: flex;
    gap: 0.5rem;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text);
    font-weight: 600;
}

.summary-text {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.875rem;
}

.timings {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timing-item {
    background: var(--background);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* Input Area */
.input-area {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
}

.input-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#questionInput {
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 48px;
    max-height: 200px;
    transition: border-color 0.2s;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
        color: var(--text);
}


#questionInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-icon {
    font-size: 1.25rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.api-key-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 1rem;
}

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

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);

}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -320px;
        height: 100%;
        z-index: 100;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }

    .settings-content {
        grid-template-columns: 1fr;
    }
}

/* Collapsible Section Styles */
.collapsible-section {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.collapsible-header {
    cursor: pointer;
    padding: 1rem;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
    user-select: none;
}

.collapsible-header:hover {
    background: #e5e7eb;
}

.collapsible-header .section-title {
    margin: 0;
}

.toggle-icon {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.collapsible-content {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

/* Summary Section - Keep original simple style */
.summary-section {
    margin-bottom: 1.5rem;
}

button#newChatBtn {
    width: 100%;
}

#sendBtn{
      background: var(--primary);
    color: white;
}
button#checkBtn {
    background: var(--primary);
    color: white;
}
input#mainInput {
    padding: 8px 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}
.trigger-box {
    display: flex;
    gap: 10px;
    align-items: center;
}
.tab-input-flex {
    justify-content: space-between;
}

.collapsible-message-wrapper {
    display: flex;
    gap: 10px;
    align-items: baseline;
}
.collapsible-message-wrapper .collapsible-section{
  width: 50%;
}

.collapsible-section {
    border: 1px solid #f6f6f640 !important;
}
.collapsible-header {
    margin-bottom: 0;
}
.collapsible-header:hover {
    background: none;
}
.collapsible-message-wrapper .message-section.collapsible-section {
    margin-bottom: 10px;
}
.view-btn:hover {
    color: #fff;
    border: 1px solid #fff;
}