/* Global Reset & Base Styles */
:root {
  --bg-app: #070913;
  --bg-sidebar: rgba(10, 13, 28, 0.7);
  --bg-header: rgba(7, 9, 19, 0.5);
  --card-bg: rgba(20, 26, 46, 0.45);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-hover-border: rgba(113, 50, 140, 0.35);
  --card-glow: rgba(113, 50, 140, 0.04);
  
  --primary: #71328C;
  --primary-hover: #8e42b0;
  --primary-glow: rgba(113, 50, 140, 0.3);
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --violet: #8b5cf6;
  --violet-glow: rgba(139, 92, 246, 0.15);
  --rose: #ef4444;
  --amber: #f59e0b;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;
  
  --sidebar-width: 260px;
  --header-height: 80px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Custom Scrollbars */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(113, 50, 140, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

/* App Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 40px;
}

.brand-logo {
  background: linear-gradient(135deg, var(--primary), var(--violet));
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-logo i {
  color: white;
  width: 20px;
  height: 20px;
}

.brand-info h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info span {
  font-size: 11px;
  color: var(--text-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.menu-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.menu-item i {
  width: 18px;
  height: 18px;
  transition: var(--transition-smooth);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.menu-item.active {
  background: rgba(113, 50, 140, 0.1);
  color: #a5b4fc;
  border-left: 3px solid var(--primary);
  border-radius: 4px 10px 10px 4px;
}

.menu-item.active i {
  color: var(--primary);
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dark);
}

.status-badge.connected .status-dot {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.status-badge.disconnected .status-dot {
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose);
}

.status-badge.warning .status-dot {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

/* Top Navigation Header */
.top-header {
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-title .breadcrumb {
  font-size: 10px;
  color: var(--text-dark);
  font-weight: 700;
  letter-spacing: 1.5px;
}

.header-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: white;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-status span {
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
}

/* Buttons */
.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 12px var(--primary-glow);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 10px;
}

.btn-round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(24px);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
  background-clip: padding-box;
}

.glass-card:hover {
  border-color: var(--card-hover-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px var(--card-glow);
}

/* Tab Panels */
.content-container {
  padding: 40px;
  flex: 1;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

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

/* 1. DASHBOARD TAB STYLES */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
  overflow: hidden;
}

.card-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon i {
  width: 24px;
  height: 24px;
}

.card-icon.indigo {
  background: rgba(113, 50, 140, 0.1);
  color: var(--primary);
  border: 1px solid rgba(113, 50, 140, 0.2);
}

.card-icon.emerald {
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.card-icon.violet {
  background: rgba(139, 92, 246, 0.1);
  color: var(--violet);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.card-details {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin-top: 4px;
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}

.query-promo-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  background: radial-gradient(circle at top right, rgba(113, 50, 140, 0.15), var(--card-bg));
}

.promo-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.promo-header p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.suggested-prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.suggested-prompt-chip {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  transition: var(--transition-smooth);
}

.suggested-prompt-chip i {
  color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.suggested-prompt-chip:hover {
  background: rgba(113, 50, 140, 0.06);
  border-color: rgba(113, 50, 140, 0.3);
  transform: translateY(-2px);
}

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

.card-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.sources-preview-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.source-item-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.source-item-mini i {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.source-item-mini.pdf i {
  color: #f87171;
}

.source-item-mini.word_doc i {
  color: #60a5fa;
}

.source-item-mini span {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* 2. CHAT TAB STYLES */
.chat-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 24px;
  height: calc(100vh - var(--header-height) - 80px);
}

.chat-board {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

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

.chat-agent-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(113, 50, 140, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-agent-info h3 {
  font-size: 15px;
  font-weight: 600;
}

.chat-agent-info span {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  max-width: 85%;
  line-height: 1.6;
}

.message.user-msg {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  border-radius: 16px 16px 4px 16px;
  font-size: 14px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.message.assistant-msg {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  padding: 16px 20px;
  border-radius: 16px 16px 16px 4px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message.system-msg {
  align-self: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--card-border);
  border-radius: 12px;
  max-width: 90%;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.message-content {
  word-break: break-word;
}

.message-content p {
  margin-bottom: 10px;
}
.message-content p:last-child {
  margin-bottom: 0;
}
.message-content ul, .message-content ol {
  margin-left: 20px;
  margin-bottom: 10px;
}
.message-content li {
  margin-bottom: 4px;
}

/* Citations inside text */
.cite-tag {
  background: rgba(113, 50, 140, 0.2);
  border: 1px solid rgba(113, 50, 140, 0.4);
  color: #a5b4fc;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  margin: 0 2px;
  text-decoration: none;
}

.cite-tag:hover {
  background: var(--primary);
  color: white;
}

/* Loading status inside chat */
.loading-message {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.chat-input-bar {
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  background: rgba(10, 13, 28, 0.5);
  display: flex;
  align-items: center;
  gap: 16px;
}

.chat-input-bar textarea {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  transition: var(--transition-smooth);
}

.chat-input-bar textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.04);
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
}

.chat-sidebar .info-panel, 
.chat-sidebar .active-citations-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
}

.vertical-prompts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.prompt-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  padding: 12px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.prompt-card:hover {
  background: rgba(113, 50, 140, 0.04);
  border-color: rgba(113, 50, 140, 0.25);
  transform: translateX(4px);
}

.prompt-title {
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.prompt-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.citations-placeholder {
  color: var(--text-dark);
  font-size: 13px;
  text-align: center;
  margin: auto;
}

.citations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.citation-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
  transition: var(--transition-smooth);
}

.citation-card:hover {
  border-color: rgba(113, 50, 140, 0.2);
}

.citation-num-badge {
  background: rgba(113, 50, 140, 0.15);
  border: 1px solid rgba(113, 50, 140, 0.3);
  color: #a5b4fc;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-block;
  margin-bottom: 6px;
}

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

/* 3. SOURCES TAB STYLES */
.sources-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
  align-items: flex-start;
}

.source-upload-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.upload-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 24px;
}

.upload-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-smooth);
}

.upload-tab-btn:hover {
  color: var(--text-main);
}

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

.upload-form-panel {
  display: none;
}

.upload-form-panel.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input, 
.form-group textarea {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  transition: var(--transition-smooth);
}

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

.sources-table-container {
  overflow-x: auto;
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.sources-table th, 
.sources-table td {
  padding: 16px;
  border-bottom: 1px solid var(--card-border);
}

.sources-table th {
  color: var(--text-muted);
  font-weight: 500;
}

.sources-table tbody tr {
  transition: var(--transition-smooth);
}

.sources-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.source-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.source-title-cell i {
  color: var(--text-muted);
}

.source-title-cell.pdf i {
  color: #f87171;
}

.source-title-cell.word_doc i {
  color: #60a5fa;
}

.source-type-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.source-id-cell {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-dark);
}

/* Spinner */
.spinner {
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

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

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 0;
}

/* Authentication Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 11, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal {
  max-width: 480px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay.active .auth-modal {
  transform: translateY(0);
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(113, 50, 140, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon i {
  width: 28px;
  height: 28px;
}

.auth-modal h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.auth-modal p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin: 10px 0;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  padding: 12px;
  border-radius: 8px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step p {
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.5;
}

.modal-actions {
  width: 100%;
  margin-top: 10px;
}

.modal-actions .btn {
  width: 100%;
}

.auth-progress-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--primary);
  background: rgba(113, 50, 140, 0.05);
  border: 1px solid rgba(113, 50, 140, 0.2);
  padding: 10px 14px;
  border-radius: 8px;
  text-align: left;
}

.auth-progress-msg i {
  flex-shrink: 0;
}

/* App Login Custom Styles */
.login-modal {
  padding: 32px;
  background: radial-gradient(circle at top right, rgba(113, 50, 140, 0.1), var(--card-bg));
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.password-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 48px; /* Room for eye button */
}

.btn-icon {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

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

.login-error-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 12px;
  border-radius: 8px;
  text-align: left;
  margin-top: 8px;
}

.login-error-msg i {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

#btn-logout {
  transition: var(--transition-smooth);
}

#btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Source Action Buttons Styles */
.btn-action-icon {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  margin-left: 6px;
}

.btn-action-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-action-icon.edit-btn:hover {
  color: var(--primary);
  border-color: rgba(113, 50, 140, 0.4);
  background: rgba(113, 50, 140, 0.1);
}

.btn-action-icon.delete-btn:hover {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

.btn-action-icon i {
  width: 14px;
  height: 14px;
}

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

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}
