:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #06b6d4;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --surface: #ffffff;
  --hover: #f1f5f9;
}

html.dark {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border: #334155;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

#app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

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

.sidebar-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.nav-menu {
  list-style: none;
  flex: 1;
  padding: 1rem 0;
}

.nav-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background-color: var(--bg);
  color: var(--text);
}

.nav-link.active {
  background-color: var(--bg);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.theme-btn {
  width: 100%;
  padding: 0.5rem;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.theme-btn:hover {
  background-color: var(--border);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h2 {
  font-size: 1.5rem;
}

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

.status-indicator {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-idle {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-running {
  background-color: #fef3c7;
  color: #92400e;
}

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

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
  display: none;
}

.menu-toggle:hover {
  opacity: 0.7;
}

.view {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: none;
}

.view.active {
  display: block;
}

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

.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.card-value.critical {
  color: var(--danger);
}

.actions-section {
  margin-top: 2rem;
}

.actions-section h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

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

.action-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.action-card h4 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.action-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

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

.btn-secondary {
  background-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background-color: var(--text-secondary);
}

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

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-info {
  background-color: #06b6d4;
  color: white;
}

.btn-info:hover {
  background-color: #0891b2;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
  width: 100%;
}

.filter-section {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filters-panel {
  display: none;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  width: 100%;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.filters-panel.open {
  display: grid;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.filter-group select,
.filter-group input {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background-color: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
}

.logs-table thead {
  background-color: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
}

.logs-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.logs-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.logs-table tr:hover {
  background-color: var(--bg-secondary);
}

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

.level-warn {
  color: var(--warning);
  font-weight: 600;
}

.level-info {
  color: var(--primary);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.tickets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.form-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background-color: var(--bg);
  color: var(--text);
  font-family: inherit;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tickets-list {
  display: grid;
  gap: 1rem;
}

.ticket-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ticket-item:hover {
  box-shadow: var(--shadow);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
}

.ticket-title {
  font-weight: 600;
  font-size: 1rem;
}

.ticket-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-critical {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-high {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-medium {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-low {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-open {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-in-progress {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-closed {
  background-color: #d1fae5;
  color: #065f46;
}

.ticket-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.ticket-description {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.ticket-services {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.service-tag {
  background-color: var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.ticket-actions {
  display: flex;
  gap: 0.5rem;
}

.triage-panel {
  max-width: 600px;
}

.triage-panel h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

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

.output-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  margin-top: 1.5rem;
}

.output-panel h4 {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.output-content {
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.text-center {
  text-align: center;
}

/* Settings Panel */
.settings-panel {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.settings-panel h3 {
  margin-bottom: 2rem;
  font-size: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

/* API Keys Form */
.api-keys-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.key-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

.api-key-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
}

.btn-small {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.api-keys-form small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
}

.api-keys-form small a {
  color: var(--primary);
  text-decoration: none;
}

.api-keys-form small a:hover {
  text-decoration: underline;
}

/* Model Selection */
.model-selection {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.model-selection select {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--bg);
  color: var(--text);
}

/* Current Setting Display */
.current-setting {
  padding: 1.5rem;
  background: var(--hover);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.setting-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.setting-value {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Provider Grid - 3 columns */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

/* Info Cards */
.info-section {
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.info-card {
  padding: 1rem;
  background: var(--surface);
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

.info-card strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.info-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section h4 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.settings-section p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.provider-card {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.provider-card:hover {
  border-color: var(--primary);
  background: var(--hover);
}

.provider-card h5 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.provider-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.provider-status {
  padding: 0.5rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.provider-status.available {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
}

.provider-status.unavailable {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

.current-setting {
  padding: 1rem;
  background: var(--hover);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--hover);
  border-radius: 4px;
}

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

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

.info-list {
  list-style: none;
  padding: 0;
}

.info-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-list li:last-child {
  border-bottom: none;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 400px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  font-weight: 500;
}

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

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

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

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

.toast-warning {
  background: var(--warning);
  color: white;
}

/* Provider Card Enhancement */
.provider-card.current {
  border-width: 3px;
  background: rgba(14, 165, 233, 0.05);
}

.provider-card button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }

  .cards-grid,
  .quick-actions,
  .status-grid,
  .info-cards {
    grid-template-columns: 1fr;
  }

  .provider-grid {
    grid-template-columns: 1fr;
  }

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

  .header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .filters-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Mobile Menu Toggle */
  .menu-toggle {
    display: block !important;
  }

  /* Mobile Sidebar */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    width: 250px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    width: 100%;
  }

  /* Mobile Header */
  .header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem !important;
  }

  .header h2 {
    font-size: 1.3rem;
  }

  /* Mobile Typography */
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  /* Mobile Cards */
  .card {
    padding: 1rem;
  }

  .card-value {
    font-size: 1.5rem;
  }

  /* Mobile Buttons */
  .btn {
    padding: 0.75rem 1rem;
    font-size: 1rem; /* 16px for iOS readability */
  }

  .btn-large {
    width: 100%;
  }

  /* Mobile Tables */
  .logs-table {
    font-size: 0.85rem;
  }

  .logs-table th,
  .logs-table td {
    padding: 0.5rem;
  }

  /* Mobile Forms */
  .form-group {
    margin-bottom: 1rem;
  }

  label {
    font-size: 0.9rem;
  }

  input,
  select,
  textarea {
    font-size: 1rem; /* Prevents zoom on iOS */
  }

  /* Mobile Settings */
  .settings-panel {
    padding: 1rem;
  }

  .provider-grid {
    gap: 0.75rem;
  }

  .provider-card {
    padding: 1rem;
  }

  .provider-card h5 {
    font-size: 1rem;
  }

  .provider-card p {
    font-size: 0.9rem; /* Better mobile readability */
  }

  /* Mobile Toast */
  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  /* Mobile Filter Panel */
  .filters-panel {
    padding: 1rem;
  }

  /* Mobile Pagination */
  .pagination {
    gap: 0.5rem;
  }

  .pagination button,
  .pagination span {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  /* Mobile Output */
  .output-content {
    font-size: 0.75rem;
    max-height: 300px;
  }

  /* Mobile Chat Interface */
  .chat-container {
    height: 100%;
  }

  .chat-messages {
    height: calc(100vh - 400px);
  }

  .chat-input-area {
    gap: 0.5rem;
  }

  .message {
    margin: 0.5rem 0;
    font-size: 0.9rem;
  }

  .source-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* ===== CHAT INTERFACE STYLES ===== */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg);
  border-radius: 0.75rem;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-secondary);
}

.chat-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--bg);
}

.message {
  display: flex;
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease-out;
}

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

/* Message Types */
.message.user {
  justify-content: flex-end;
}

.message.user p {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  max-width: 70%;
  word-wrap: break-word;
}

.message.assistant p,
.message.system-message p {
  background-color: var(--bg-secondary);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border-left: 3px solid var(--primary);
  max-width: 70%;
  word-wrap: break-word;
}

.message.thinking p {
  background-color: var(--warning);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  max-width: 70%;
  font-style: italic;
  opacity: 0.8;
}

.message.system-message p {
  border-left: 3px solid var(--info);
  font-size: 0.9rem;
}

.message p {
  margin: 0;
  padding: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-secondary);
  border-radius: 1rem;
  width: fit-content;
}

.typing-indicator span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--text-secondary);
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
  }
  30% {
    opacity: 1;
  }
}

/* Chat Input Area */
.chat-input-area {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Log Source Selector */
.log-source-selector {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.source-btn {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.95rem;
}

.source-btn:hover {
  background-color: var(--hover);
  border-color: var(--primary);
}

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

/* Input Container */
.input-container {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.log-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.log-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

.log-input[type="text"]::placeholder {
  color: var(--text-secondary);
}

/* File Upload Label */
.file-upload-label {
  flex: 1;
  padding: 0.75rem;
  border: 2px dashed var(--border);
  border-radius: 0.5rem;
  background-color: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.file-upload-label:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--hover);
}

/* Start Triage Button */
#start-triage-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Tool Call Display */
.tool-call {
  background-color: var(--bg-secondary);
  border-left: 3px solid var(--success);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.tool-call-name {
  font-weight: 600;
  color: var(--success);
}

.tool-result {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: var(--bg);
  border-radius: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-height: 200px;
  overflow-y: auto;
}

/* Investigation Summary */
.investigation-summary {
  background: linear-gradient(135deg, var(--success), var(--info));
  color: white;
  padding: 1rem;
  border-radius: 0.75rem;
  margin: 0.5rem 0;
}

.investigation-summary h4 {
  margin-top: 0;
  font-size: 1rem;
}

.investigation-summary p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Error Message */
.error-message {
  background-color: var(--danger);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border-left: 3px solid var(--danger);
}

/* Help Panel Styles */
.help-panel {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.help-panel h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--primary);
}

.help-section {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.help-section:hover {
  box-shadow: var(--shadow);
}

.help-section h4 {
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.help-section p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.help-section ul,
.help-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.help-section li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.faq-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--bg);
  border-radius: 0.4rem;
  border-left: 3px solid var(--info);
}

.faq-item strong {
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

.faq-item p {
  margin: 0;
  color: var(--text-secondary);
}

/* About Panel Styles */
.about-panel {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.about-panel h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--primary);
}

.about-section {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--success);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.about-section:hover {
  box-shadow: var(--shadow);
}

.about-section h4 {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.about-section p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.about-section li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* Technology Stack */
.tech-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.tech-category {
  background-color: var(--bg);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

.tech-category h5 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.tech-category ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tech-category li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-left: 1rem;
  position: relative;
}

.tech-category li:before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* Developer Card */
.developer-card {
  background-color: var(--bg);
  border: 2px solid var(--primary);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-top: 1rem;
}

.developer-info h5 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.developer-info p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.contact-info {
  display: grid;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: 0.4rem;
  border-left: 3px solid var(--info);
}

.contact-label {
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
}

.contact-item a {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.contact-item a:hover {
  text-decoration: underline;
}

/* Feature List */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.feature-list li {
  padding: 0.75rem 1rem;
  background-color: var(--bg);
  border-left: 3px solid var(--success);
  border-radius: 0.4rem;
  color: var(--text-secondary);
}

.feature-list li:before {
  content: "✅ ";
  color: var(--success);
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
  .help-panel,
  .about-panel {
    padding: 1rem;
  }

  .help-panel h3,
  .about-panel h3 {
    font-size: 1.5rem;
  }

  .tech-stack {
    grid-template-columns: 1fr;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .contact-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-label {
    min-width: auto;
  }
}

/* Conversational Chat Styles */

/* Session Info Panel */
.session-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  gap: 1rem;
}

/* Chat Input Container */
.chat-input-container {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  background-color: var(--bg);
}

#chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 48px;
  max-height: 150px;
  background-color: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}

#chat-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

#chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* User Message Styling */
.message.user-message {
  background-color: var(--primary);
  color: white;
  align-self: flex-end;
  max-width: 80%;
  margin-left: auto;
  border-radius: 0.75rem 0.75rem 0.25rem 0.75rem;
  padding: 0.75rem 1rem;
}

.message.user-message p {
  margin: 0;
}

/* Assistant Message Styling */
.message.assistant-message {
  background-color: var(--bg-secondary);
  align-self: flex-start;
  max-width: 80%;
  border-radius: 0.75rem 0.75rem 0.75rem 0.25rem;
  padding: 0.75rem 1rem;
}

.message.assistant-message p {
  margin: 0;
}

/* Tool Execution Styling */
.message.tool-execution {
  background-color: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--info);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  align-self: flex-start;
  max-width: 80%;
  border-radius: 0.5rem;
}

.message.tool-execution p {
  margin: 0;
}

.message.tool-execution strong {
  color: var(--info);
}

/* Chat Mode Toggle */
.chat-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.chat-mode-toggle .btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

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

/* Button Group for Start Actions */
.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
