/* Viktor Tasks - Dark Theme Styles */

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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-hover: #252525;
  --border: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

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

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.login-logo {
  font-size: 64px;
  margin-bottom: 16px;
  color: var(--success);
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #a855f7 50%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #fff;
  color: #1f1f1f;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.google-btn:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

.login-note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

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

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  font-size: 28px;
  color: var(--success);
}

.header-title {
  font-size: 20px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.signout-btn {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.signout-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-btn {
  padding: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.add-btn:hover {
  background: var(--accent-hover);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* List View */
.list-view {
  max-width: 800px;
  margin: 0 auto;
}

.task-group {
  margin-bottom: 24px;
}

.task-group-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.task-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.task-item.completed {
  opacity: 0.6;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.task-title {
  font-size: 16px;
  font-weight: 500;
  flex: 1;
}

.task-type-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.task-type-badge.task { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.task-type-badge.reminder { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.task-type-badge.event { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.task-type-badge.note { background: rgba(34, 197, 94, 0.2); color: #4ade80; }

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.task-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.task-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-item:hover .task-actions {
  opacity: 1;
}

.task-action-btn {
  padding: 6px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.task-action-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.task-action-btn.delete:hover {
  color: var(--error);
}

/* Completed Section */
.completed-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.completed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.completed-header:hover {
  background: var(--bg-hover);
}

.completed-header span:last-child {
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.completed-container {
  margin-top: 12px;
}

.completed-container.collapsed {
  display: none;
}

.clear-completed-btn {
  margin-top: 12px;
  padding: 8px 16px;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-completed-btn:hover {
  background: var(--error);
  color: white;
}

/* Calendar View */
.calendar-view {
  max-width: 900px;
  margin: 0 auto;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.calendar-nav {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-nav:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

#calendar-month {
  font-size: 24px;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
}

.calendar-grid {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.calendar-weekdays span {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  min-height: 100px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day:hover {
  background: var(--bg-hover);
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.today {
  background: rgba(139, 92, 246, 0.1);
}

.calendar-day-number {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.calendar-day.today .calendar-day-number {
  background: var(--accent);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-item {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-item.task { background: rgba(139, 92, 246, 0.3); }
.calendar-item.reminder { background: rgba(245, 158, 11, 0.3); }
.calendar-item.event { background: rgba(59, 130, 246, 0.3); }
.calendar-item.note { background: rgba(34, 197, 94, 0.3); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

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

#task-form {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

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

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

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

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

.toast.error {
  border-color: var(--error);
}

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

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

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

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

/* Responsive */
@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    justify-content: center;
  }

  .view-controls {
    justify-content: center;
  }

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

  .calendar-day {
    min-height: 60px;
  }

  .calendar-day-items {
    display: none;
  }

  .calendar-day.has-items::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    margin: 4px auto 0;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }

  .header {
    padding: 12px 16px;
  }

  .header-title {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .filter-tab {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* Settings Button */
.settings-btn {
  padding: 8px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Quick Add Bar */
.quick-add-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.quick-add-type {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.quick-add-type:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.quick-add-bar input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.quick-add-bar input:focus {
  border-color: var(--accent);
}

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

/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 350px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 90;
  overflow: hidden;
  transition: all 0.3s ease;
}

.chat-widget.collapsed {
  height: 48px;
}

.chat-widget.collapsed .chat-widget-body {
  display: none;
}

.chat-widget.collapsed .chat-toggle {
  transform: rotate(180deg);
}

.chat-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 500;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-settings-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.chat-settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.chat-toggle {
  font-size: 12px;
  transition: transform 0.3s;
}

.chat-widget-body {
  display: flex;
  flex-direction: column;
  height: 350px;
}

.chat-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.chat-welcome {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.chat-message {
  margin-bottom: 12px;
  max-width: 85%;
}

.chat-message.user {
  margin-left: auto;
}

.chat-message-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-message.user .chat-message-content {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-message-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-widget-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.chat-widget-input-area input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.chat-widget-input-area input:focus {
  border-color: var(--accent);
}

.chat-widget-input-area button {
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.chat-widget-input-area button:hover {
  background: var(--accent-hover);
}

.chat-typing {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.chat-no-key {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
}

.chat-no-key a {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

/* Settings Modal */
.modal.hidden {
  display: none;
}

.settings-modal {
  max-width: 450px;
}

.modal-body {
  padding: 24px;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.setting-group input {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
}

.setting-group input:focus {
  border-color: var(--accent);
}

.setting-actions {
  display: flex;
  gap: 12px;
}

.setting-actions button {
  flex: 1;
}

.btn-danger {
  padding: 12px 24px;
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.setting-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.key-status {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.key-status.configured {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.key-status.not-configured {
  background: rgba(102, 102, 102, 0.1);
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

/* Key Source Options (Chat Settings Modal) */
.key-source-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.key-source-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.key-source-option:hover {
  border-color: var(--accent);
}

.key-source-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.key-source-option .option-content {
  flex: 1;
}

.key-source-option .option-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.key-source-option .option-desc {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
}

.custom-key-section {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.custom-key-section.hidden {
  display: none;
}

.custom-key-section label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.custom-key-section input {
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 12px;
}

.custom-key-section input:focus {
  border-color: var(--accent);
  outline: none;
}

.key-source-status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.key-source-status.global {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--info);
  color: var(--info);
}

.key-source-status.override {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.key-source-status.none {
  background: rgba(102, 102, 102, 0.1);
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

/* Notes View */
.notes-view {
  max-width: 800px;
  margin: 0 auto;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.notes-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.add-note-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.add-note-btn:hover {
  background: var(--accent-hover);
}

.notes-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.note-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.note-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.note-item-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-item-preview {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 63px;
}

.note-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.note-item-source {
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: 10px;
  font-size: 11px;
}

.note-item-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.note-item:hover .note-item-actions {
  opacity: 1;
}

.note-action-btn {
  padding: 6px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.note-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.note-action-btn.delete:hover {
  color: var(--error);
  border-color: var(--error);
}

/* Note Modal */
.note-modal-content {
  max-width: 600px;
}

.note-modal-content textarea {
  min-height: 200px;
  resize: vertical;
}

#note-form {
  padding: 24px;
}

/* Empty Notes State */
.notes-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.notes-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.notes-empty h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.notes-empty p {
  color: var(--text-muted);
}

/* Mobile adjustments for chat widget */
@media (max-width: 480px) {
  .chat-widget {
    width: calc(100% - 32px);
    right: 16px;
    bottom: 16px;
  }

  .quick-add-bar {
    padding: 12px 16px;
  }

  .quick-add-type {
    padding: 6px 10px;
    font-size: 13px;
  }

  .notes-container {
    grid-template-columns: 1fr;
  }
}
