/* ==========================================================================
   ARK CORE TENANT INGESTION GATEWAY (SELF SERVICE) STYLES
   ========================================================================== */

.self-service-container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #f1f5f9; /* Soft bright text for dark mode interface compatibility */
  background-color: var(--bg-main)
}

/* --- HEADER ZONE --- */
.self-service-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid #334155;
  padding-bottom: 1.5rem;
}

.self-service-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.theme-shadow .self-service-header h1 {
  background: linear-gradient(90deg, #f83838, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.self-service-header p {
  color: #94a3b8;
  margin: 0;
  font-size: 1rem;
}

.user-badge {
  background-color: #1e293b;
  color: #e2e8f0;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
  border: 1px solid #475569;
}


/* --- CARD STACK LAYOUT --- */
.vertical-card-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem; /* Creates clean breathing room between steps */
  margin-bottom: 5rem;
}

/* Individual Core Cards */
.service-card {
  position: relative;
  background-color: #1e293b; /* Sleek slate card background */
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: visible !important;
}

.service-card:hover {
  box-shadow: var(--shadow-hover);
  transition: all 0.2s ease;
  transform: translateY(-2px)
}

.theme-shadow .service-card {
  background-color: #3b1e1e; /* Even darker background for shadow theme */
  border: 1px solid #553333
}

.service-card:hover {
  box-shadow: var(--shadow-hover);
}

.theme-shadow .form-group select {
  background-color: #2a0f0f;
  border: 1px solid #553333;
}

.theme-shadow .custom-file-button {
  background-color: #2a0f0f;
  border: 1px solid #553333;
}

.theme-shadow .manifest-search-input {
  background-color: #2a0f0f;
  border: 1px solid #553333;
}

.theme-shadow .manifest-table th {
  background-color: #553333;
}

.theme-shadow .manifest-table td {
  background-color: #553333;
}

.theme-shadow .staged-files-preview {
  background-color: #2a0f0f;
  border: 1px solid #553333;
}
/* Step Badges (Top right of cards) */
.card-badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background-color: #334155;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  border: 1px solid #475569;
}

.service-card h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  color: #f8fafc;
  font-weight: 600;
}

.card-description {
  color: #94a3b8;
  margin: 0 0 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  z-index: 11;
}


/* --- STEP 1: FORM CONTROLS --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
  /* box-shadow: var(--shadow); */
  transition: all 0.2s ease;
}

.form-group:hover {
  box-shadow: var(--shadow-hover);
  transition: all 0.2s ease;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

.form-group select {
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.form-group select:focus {
  border-color: #2563eb;
}

.form-group select:hover {
  box-shadow: var(--shadow-hover) !important;
}
.Filter active index by filename {
  box-shadow: var(--shadow);
}

/* --- STEP 2: PROVISIONING & FILE DROPS --- */
.upload-form-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hidden native input file handle wrapped by a gorgeous layout button */
.file-input-wrapper input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.custom-file-button {
  display: inline-block;
  padding: 1rem 2rem;
  background-color: #0f172a;
  border: 2px dashed #475569;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.custom-file-button:hover {
  border-color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.02);
  color: #f8fafc;
}

/* Multi-file preview log lists */
.staged-files-preview {
  margin: 1rem 0 0 0;
  padding: 0;
  list-style: none;
  background-color: #0f172a;
  border-radius: 6px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #334155;
}

.staged-files-preview li {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #1e293b;
  font-size: 0.85rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
}

.staged-files-preview li:last-child {
  border-bottom: none;
}

/* Action Execution Submits */
.action-button {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.2s ease, transform 0.1s ease;
  box-shadow: var(--shadow);
}

.theme-shadow .action-button {
  background: linear-gradient(135deg, #eb2525, #000000);
}
.action-button:hover:not(:disabled) {
  opacity: 0.95;
  box-shadow: var(--shadow-hover);
}

.action-button:active:not(:disabled) {
  transform: scale(0.98);

}

.action-button:disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
}

/* Status Notifications */
.status-banner {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.status-banner.success {
  background-color: rgba(22, 163, 74, 0.1);
  border: 1px solid #16a34a;
  color: #4ade80;
}

.status-banner.error {
  background-color: rgba(220, 38, 38, 0.1);
  border: 1px solid #dc2626;
  color: #f87171;
}


/* --- STEP 3: AUDITING MANIFEST AND GRIDS --- */
.search-bar-wrapper {
  margin-bottom: 1.25rem;
}

.manifest-search-input {
  width: 100%;
  max-width: 400px;
  background-color: #0f172a;
  border: 1px solid #475569;
  color: #f8fafc;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.manifest-search-input:hover {
  box-shadow: var(--shadow-hover);
  transition: all 0.2s ease;
}

.manifest-search-input:focus {
  border-color: #38bdf8;
}

.loader-subtext, .empty-manifest-notice {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
  font-size: 0.95rem;
  background-color: #0f172a;
  border-radius: 8px;
  border: 1px dashed #334155;
}

/* Manifest Scrolling Data Table Workspace */
.manifest-table-scroll-zone {
  width: 100%;
  overflow-x: auto;
  background-color: #0f172a;
  border-radius: 8px;
  border: 1px solid #334155;
}

.manifest-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.manifest-table th {
  background-color: #1e293b;
  color: #94a3b8;
  font-weight: 600;
  padding: 1rem;
  border-bottom: 2px solid #334155;
}

.manifest-table td {
  padding: 1rem;
  border-bottom: 1px solid #233149;
  color: #cbd5e1;
  vertical-align: middle;
}

.manifest-table tr:last-child td {
  border-bottom: none;
}

.doc-name-cell {
  font-weight: 500;
  color: #f1f5f9;
}

/* Row-Level Ingot Destructive Evictions */
.delete-row-btn {
  background-color: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-row-btn:hover:not(:disabled) {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.delete-row-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- RETRIEVAL REFRESH FALLBACK FALLS --- */
.self-service-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 500;
}

/* --- Mobile Responsive Overrides for Self-Service --- */
@media (max-width: 768px) {
  .self-service-container {
    padding: 1rem !important;
    max-width: 100% !important;
  }

  .self-service-header h1 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 1rem;
  }

  .vertical-card-stack {
    gap: 1rem;
  }

  /* Make individual service cards full-width and compact */
  .service-card {
    padding: 1.25rem !important;
    border-radius: 10px;
  }

  .service-card h2 {
    font-size: 1.1rem;
  }

  .card-description {
    font-size: 0.85rem;
  }

  /* Form controls and dropdowns take full width for easy tapping */
  .form-group select,
  .manifest-search-input {
    width: 100%;
    font-size: 16px; /* Prevents iOS auto-zoom */
    padding: 0.75rem;
  }

  /* Custom file button styling for mobile touch targets */
  .custom-file-button {
    display: block;
    text-align: center;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
  }

  .upload-submit-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    margin-top: 0.75rem;
  }

  /* Manifest table scroll zone wrapper */
  .manifest-table-scroll-zone {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.75rem;
  }

  .manifest-table {
    min-width: 500px; /* Ensures columns don't crunch together */
    font-size: 0.85rem;
  }

  .manifest-table th,
  .manifest-table td {
    padding: 0.6rem 0.5rem;
  }
}/* ==========================================================================
   SAVED CONVERSATIONS LAYOUT — Sonic/Shadow Theme Compatible
   ========================================================================== */

/* MAIN CONTAINER */
.saved-conversations-container {
  display: flex;
  height: calc(100vh - 80px);
  background: var(--bg-main);
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}

/* SIDEBAR */
.saved-conversations-sidebar {
  width: 280px;
  background: var(--bg-main);
  border-right: 1px solid var(--border-color);
  padding: 1rem;
  overflow-y: auto;
  
  transition: all 0.2s ease;
}

.saved-conversations-sidebar:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.sidebar-title {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* LIST */
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.conversation-item {
  padding: 0.75rem;
  border-radius: 6px;
  background: var(--bg-main);
  border: 1px solid var(--user-border-color);
  cursor: pointer;
  /* box-shadow: var(--light-shadow); */
  transition: all 0.5s ease;
}

.conversation-item:hover {
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: 0.2s ease;
}

.theme-shadow .conversation-item:hover {
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  transition: 0.2s ease;
}

.conversation-item.active {
  background: var(--bubble-user-bg);
  color: var(--text-main);
  border-color: var(--user-border-color);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  pointer-events: none;
  transform: translateY(-2px);
}

/* .conversation-item.active:hover {
    box-shadow: var(--shadow-hover);
} */

.theme-shadow .conversation-item.active {
  background: var(--bubble-user-bg);
  color: var(--text);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.conversation-item:active {
    box-shadow: none;
    transform: translateY(2px);
    transition: all 0.2s ease;
    background: var(--bg-main)
}

.theme-shadow .conversation-item:active {
    box-shadow: none;
    transform: translateY(2px);
    transition: all 0.2s ease;
    background: var(--bg-main)
}

/* MAIN VIEWER */
.saved-chat-wrapper {
  max-width: 850px;        /* match ChatPage */
  margin: 0 auto;          /* center it */
  padding: 1.5rem;         /* match ChatPage padding */
}

.saved-conversations-viewer {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--bg-main);
  /* box-shadow: var(--shadow); */
  transition: all 0.2s ease;
}

.saved-conversations-viewer:hover {
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.viewer-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-main);
}

/* MESSAGE BUBBLES */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  line-height: 1.4;
}

/* Human messages (right aligned) */
.message-bubble.human {
  align-self: flex-end;
  background: var(--bubble-user-bg);
  color: var(--text-main);
}

.theme-shadow .message-bubble.human {
    color: var(--text)
}

/* AI messages (left aligned) */
.message-bubble.ai {
  align-self: flex-start;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

/* System messages (centered, subtle) */
.message-bubble.system {
  align-self: center;
  background: var(--bg-surface-hover);
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Hide mobile back button by default on desktop */
.mobile-back-btn {
  display: none;
}

/* --- Mobile Viewport Overrides (Phones under 768px) --- */
@media (max-width: 768px) {
  .saved-conversations-container {
    flex-direction: column;
    height: calc(100vh - 60px);
    overflow: hidden;
  }

  .saved-conversations-sidebar {
    width: 100% !important;
    height: 100%;
    border-right: none;
  }

  .saved-conversations-viewer {
    width: 100% !important;
    height: 100%;
    display: none;
  }

  /* When a conversation is selected, hide the sidebar list and show the chat viewer full screen */
  .saved-conversations-container.chat-active .saved-conversations-sidebar {
    display: none;
  }

  .saved-conversations-container.chat-active .saved-conversations-viewer {
    display: flex;
    flex-direction: column;
  }

  /* Style the mobile back button header */
  .mobile-back-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
    flex-shrink: 0;
  }

  .viewer-header-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(18, 24, 36, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .viewer-title {
    margin: 0;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .saved-chat-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
  }
}.help-panel {
  padding: 20px;
  background: var(--bg-main);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  transition: all 0.2s ease;
}


.help-panel .help-title {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.help-panel .help-subtitle {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 20px;
}

.help-panel .help-section {
  margin-bottom: 15px;
}

.help-panel .help-section-header {
  width: 100%;
  background: var(--bg-main);
  border-color: var(--border-color);
  padding: 10px;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 16px;
  color: var(--text-main)
}

.help-panel .help-section-header:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.help-panel .help-section-header:active {
  box-shadow: none;
  transform: translateY(2px);
  transition: all 0.2s ease;
}

.help-panel .help-section-body {
  padding: 10px;
  background: var(--bg-main);
  border-left: 1px solid var(--border-color);
}

.help-panel .help-code {
  background: var(--bg-main);
  padding: 8px;
  border-radius: 4px;
  font-family: monospace;
}

.help-panel-container {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 350px;
  background: var(--bg-main);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 999;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
  animation: slideInLeft 0.25s ease-out;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.help-panel-container.closing {
  animation: slideOutLeft 0.25s ease-in forwards;
}

@keyframes slideOutLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* Fix bullet indentation */
.help-panel .help-section-body ul {
  margin-left: 0;          /* Remove default browser margin */
  padding-left: 20px;      /* Controlled indentation */
}

/* Fix bullet alignment so they don't spill past the border */
.help-panel .help-section-body li {
  margin-bottom: 6px;
  font-size: 0.95rem;      /* Slightly smaller, cleaner */
  line-height: 1.4;
}

/* Fix code block spacing */
.help-panel .help-code {
  margin-left: 0;
  padding-left: 12px;
  font-size: 0.9rem;
}

/* Fix section body padding so content stays inside the vertical line */
.help-panel .help-section-body {
  padding: 12px 16px;
  border-left: 3px solid #4a6fa5;
}/* ==========================================================================
   TIME TRACKING TABLE — Soft Pastel + Shadow Mode Adaptive
   ========================================================================== */

.page-container {
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}

.page-container h1 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

/* Table Frame */
.sa-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}

.sa-table:hover {
  box-shadow: var(--shadow-hover);
  transition: all 0.2s ease;
  
}

/* Header */
.sa-table thead {
  background: var(--bg-surface-hover);
}

.sa-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  /* box-shadow: var(--shadow); */
  transition: all 0.2s ease;
}

/* Rows */
.sa-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: background 0.2s ease, transform 0.2s ease;
  /* box-shadow: var(--shadow); */
  transition: all 0.2s ease;
}

.sa-table tr {
  box-shadow: var(--shadow);
}
/* Hover Lift */
.sa-table tbody tr:hover {
  background: var(--bg-surface-hover);
  
  box-shadow: var(--shadow-hover);
  transition: all 0.2s ease;
  transform: translateY(-2px);
}

.sa-table tbody tr:active {
  box-shadow: none;
  transform: translateY(2px);
}



/* Last Row Cleanup */
.sa-table tbody tr:last-child td {
  border-bottom: none;
}

/* Notes Column Style */
.sa-table td:last-child {
  color: var(--text-muted);
  font-style: italic;
}

.sa-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 3rem !important;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
  margin-top: 3rem;
}

.sa-card:hover {
  box-shadow: var(--shadow-hover);
}

/* Center the table inside the card */
.sa-card .sa-table {
  width: 100%;
  margin: 0 auto;
}

/* Shadow Theme Overrides */
.theme-shadow .sa-table {
  background: #1c1111;
  border-color: #7f1d1d;
  box-shadow: var(--shadow);
}

.theme-shadow .sa-table th {
  background: #2e2e36;
  color: var(--card-text);
  border-color: #7f1d1d;
}

.theme-shadow .sa-table td {
  color: var(--card-text);
  border-color: #7f1d1d;
}

.theme-shadow .sa-table tbody tr:hover {
  background: #2e2e36;
  box-shadow: var(--shadow-dark-hover);
}

/* Fade-in Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.time-workspace {
  display: grid;
  grid-template-columns: 2fr 1fr; /* Calendar = 2/3, Notes = 1/3 */
  gap: 20px;
  height: 100%;
  padding: 20px;
  background-size: cover;
}

.details-pane {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tabs {
  display: flex;
  gap: 10px;
}

.tabs button {
  display: flex; /* ← THIS fixes it */
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.tabs button:hover {
  background: var(--accent-primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

.tabs button:active {
  background: var(--accent-primary);
  box-shadow: none;
  transform: translateY(2px);
  transition: all 0.2s ease;
}

.selected-row {
    background: #ffe6e6;
    border-left: 4px solid #d9534f;
}

.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px;
    position: relative;
    z-index: 1;
    
}

.sa-card glass {
  margin-top: 3rem !important;

}


/* Custom theme-aligned table selection highlight */
.sa-table tr.selected-row td {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

/* Universal override: Targets any cells inside a selected row regardless of framework */
tr.selected-row td {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  font-weight: 600;
}
/* Override the explicit framework table cell selectors */
table.sa-table tbody tr.selected-row td,
table.sa-table tr.selected-row td {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  font-weight: 600;
}

/* --- Mobile Viewport Overrides (Phones under 768px) --- */
@media (max-width: 768px) {
  .time-workspace {
    flex-direction: column !important;
    padding: 12px !important;
    gap: 16px !important;
  }

  .calendar-pane,
  .details-pane {
    width: 100% !important;
  }

  /* Make calendar toolbar wrap its action buttons cleanly on mobile */
  .calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .calendar-toolbar .sa-btn {
    flex: 1;
    min-width: 45%;
    padding: 8px 10px;
    font-size: 0.85rem;
    text-align: center;
  }

  /* Optimize modal sizing and inputs for mobile viewports */
  .modal {
    width: 90% !important;
    max-width: 400px;
    padding: 1.25rem !important;
    box-sizing: border-box;
  }

  .modal .sa-input,
  .modal textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    padding: 0.65rem;
  }

  .primary-action-btn {
    width: 100%;
    margin-top: 0.5rem;
  }
}.simple-calendar {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

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

.cal-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 120px;
  gap: 6px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px; /* pulls weekday row close to date cells */
}

.cal-weekday {
  padding: 2px 0;
  font-size: 11px;
  line-height: 12px;
  text-align: center;
  font-weight: bold;
}

.cal-cell {
  background: var(--bg-main);
  border-radius: 6px;
  padding: 6px;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.cal-cell:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

.cal-cell:active {
  box-shadow: none;
  transform: translateY(2px);
  transition: all 0.2 ease;
}
.cal-date {
  font-weight: bold;
  margin-bottom: 4px;
}

.cal-event {
  background: #007bff;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-top: 4px;
}

.calendar-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  height: 100%;
}

.calendar-toolbar {
  display: flex;
  gap: 10px;
}

.sa-btn {
  background: rgba(255, 255, 255, 0.1); /* Semi-transparent */
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border */
  color: var(--text-main); /* Match your existing theme text */
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.sa-btn:hover {
  background: var(--accent-primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

.sa-btn:active {
  box-shadow: none;
  transform: translateY(2px);
  transition: all 0.2s ease;
}
.sa-btn.danger {
  background: transparent;
  border: 1px solid rgba(217, 83, 79, 0.5); /* Muted red */
  color: #d9534f;
}

.sa-btn.danger:hover {
  background: #b52f2b;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  position: fixed;     /* Also escapes stacking contexts */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  z-index: 10000;
}

.modal {
  background: rgba(0, 0, 0, 0.55);
  padding: 20px;
  border-radius: 8px;
  min-width: 300px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  z-index: 998;
}

/* Modal card */
.modal > div:first-child {
  background: rgba(30, 30, 40, 0.65); /* darker, readable */
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;

  padding: 24px;
  width: 360px;

  display: flex;
  flex-direction: column;
  gap: 12px;

  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: white; /* IMPORTANT */
}

/* Inputs */
.modal .sa-input {
  background: rgba(255, 255, 255, 0.18); /* visible now */
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  padding: 10px;
  border-radius: 10px;
  color: white; /* IMPORTANT */
}

.modal .sa-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* Base event style */
.cal-event {
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  font-size: 0.85rem;
}

/* Time log entries (green) */
.cal-event.log {
  background: #e8f7e8;
  border-left: 4px solid #28a745;
  color: #1b5e20;
}

/* Calendar events (blue) */
.cal-event.event {
  background: #e6f0ff;
  border-left: 4px solid #007bff;
  color: #0a3d91;
  font-size: 10px;
}

/* Hover effect */
.cal-event:hover {
  transform: translateX(3px);
  background: #f0f0f0;
}

/* Selected highlight */
.cal-event.selected {
  background: #ffe6e6;
  border-left-color: #d9534f;
  color: #b52f2b;
}

.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 5px;
    position: relative;
    z-index: 1;
}


.taskboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 20px;
  height: calc(100vh - 80px); /* below nav */
  overflow: hidden;
}

.task-lane {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.task-lane:hover {
  box-shadow: var(--shadow-hover);
  transition: all 0.2s ease;
  transform: translateY(-2px);
}

.task-lane h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: bold;
}


.task-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.task-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.task-modal {
  background: var(--bg-main);
  padding: 20px;
  border-radius: 8px;
  width: 350px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-modal input,
.task-modal textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  
  transition: all 0.2s ease;
}
.task-modal input:hover {
  transition: all 0.2s ease;
  box-shadow: var(--shadow) !important;
  transform: translateY(-2px);
}

.task-modal input:active {
  transition: all 0.2s ease;
  box-shadow: none;
  transform: translateY(2px);
  border: 1px solid var(--border-color) !important;
}
.task-modal textarea:hover {
  transition: all 0.2s ease;
  box-shadow: var(--shadow) !important;
  transform: translateY(-2px);
}

.task-modal textarea:active {
  transition: all 0.2s ease;
  box-shadow: none;
  transform: translateY(2px);
  border: 1px solid var(--border-color);
}

.task-modal-actions {
  display: flex;
  justify-content: space-between;
}

.taskboard-header {
  display: flex;
  justify-content: flex-start;
  padding: 10px 20px;
}

.task-add-btn {
  display: flex;
  justify-content: flex-start;
  padding: 10px 20px;
  background: var(--bg-main);
  border-color: var(--accent-primary);
  border-radius: 16px;
  color: var(--text-main);
  margin-top: 5px;
  transition: all 0.2s ease;
}

.task-add-btn:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  transition: all 0.2s ease;
  background: var(--accent-primary)
}

.task-add-btn:active {
  transition: all 0.2s ease;
  box-shadow: none;
  border-color: var(--accent-success);
  
  transform: translateY(2px);
  background: var(--accent-success);
}

.task-delete-btn {
  background: transparent;
  border: none;
  color: #ff6b6b;
  font-size: 18px;
  cursor: pointer;
  float: right;
  margin-top: -4px;
  margin-right: 4px;
  transition: color 120ms ease;
}

.task-delete-btn:hover {
  color: #ff3b3b;
}

/* Hide mobile tab switcher by default on desktop */
.mobile-lane-tabs {
  display: none;
}

/* --- Mobile Viewport Overrides (Phones under 768px) --- */
@media (max-width: 768px) {
  .mobile-lane-tabs {
    display: flex;
    gap: 6px;
    padding: 0 1rem;
    margin-bottom: 1rem;
  }

  .mobile-lane-tabs button {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
  }

  .mobile-lane-tabs button.active {
    background: var(--accent-primary, #3b82f6);
    color: #ffffff;
    border-color: transparent;
  }

  .taskboard {
    display: block !important;
    padding: 0 1rem;
  }

  .task-lane {
    width: 100% !important;
    margin-bottom: 0;
  }

  /* Hide inactive lanes on mobile */
  .task-lane.mobile-lane-hidden {
    display: none !important;
  }

  .task-modal {
    width: 90% !important;
    padding: 1.25rem !important;
  }

  .task-modal input,
  .task-modal textarea {
    font-size: 16px !important; /* Prevents auto-zoom on mobile safari/chrome */
  }
}.task-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}



.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow)
}

.task-card-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 6px;
}

.task-card-desc {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--text-main);
  
  transition: all 0.2s ease;
}

.task-card-meta {
  font-size: 0.75rem;
  opacity: 0.7;
}

.task-modal-actions button {
  display: flex;
  justify-content: flex-start;
  padding: 10px 20px;
  background: var(--bg-main);
  border-color: var(--accent-primary);
  border-radius: 16px;
  color: var(--text-main);
  margin-top: 5px;
  transition: all 0.2s ease;
}

.task-modal-actions button:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  transition: all 0.2s ease;
  background: var(--accent-primary)
}

.task-modal-actions button:active {
  transition: all 0.2s ease;
  box-shadow: none;
  
  
  transform: translateY(2px);
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.task-actions button {
  background: #ffffff10;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #ddd;
  transition: background 120ms ease;
}

.task-actions button:hover {
  background: #ffffff20;
}
.insight-card.glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 20px;
  color: white;
}
.chart-section {
  margin-top: 2rem;
  padding: 1rem;
  border-radius: 12px;
  height: 350px;
}

/* --- Mobile Responsive Overrides for Insights --- */
@media (max-width: 768px) {
  .insights-container,
  .insights-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
    box-sizing: border-box;
    padding: 1rem !important;
  }

  /* Make individual stat cards take full width */
  .insight-card,
  .stat-card {
    width: 100% !important;
  }

  /* Scale SVG charts and visual containers for small screens */
  .chart-container,
  .activity-breakdown-chart {
    width: 100% !important;
    overflow-x: auto;
  }
  
  .chart-container svg {
    max-width: 100%;
    height: auto;
  }
}
/* ==========================================================================
   1. GLOBAL RESETS & THEME VARIABLES
   ========================================================================== */
:root {
  --bg-main: #ffffff;
  --bg-alt: #eff6ff;       /* Ultra-soft, calming pastel sky blue backdrop */
  --bg-surface: #ffffff;    /* Clean white surface containers to break up the color */
  --bg-surface-hover: #f1f5f9;
  --border-color: #bfdbfe;  /* Gentle light-blue accent borders */
  --ai-border-color: #ffffff; 
  --user-border-color: #eff6ff;
  --text-main: #1e3a8a;     /* Deep, soft royal blue for comfortable reading */
  --text-muted: #60a5fa;    /* Balanced sky blue for auxiliary items */
  --text: #000000;          /* Default text color (same as text-main for consistency) */
  --accent-primary: #3b82f6; /* Smooth, modern classic blue (clean, non-aggressive) */
  --accent-success: #10b981; /* Soft emerald green for secure badges */
  --accent-danger: #ef4444;  /* Muted crimson for alerts */
  --bubble-user-bg: #eff6ff;
  --font-sans: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --reverse-shadow: 
      0 2px -4px rgba(0, 0, 0, 0.02),
      0 10px -20px rgba(0, 0, 0, 0.04),
      0 20px -4px rgba(0, 0, 0, 0.04),
      0 30px -60px rgba(0, 0, 0, 0.06);
  --shadow:
      0 2px 4px rgba(0, 0, 0, 0.02),
      0 10px 20px rgba(0, 0, 0, 0.04),
      0 20px 4px rgba(0, 0, 0, 0.04),
      0 30px 60px rgba(0, 0, 0, 0.06);
  --light-shadow:
      0 2px 4px rgba(0, 0, 0, 0.03),
      0 8px 16px rgba(0, 0, 0, 0.04),
      0 16px 32px rgba(0, 0, 0, 0.05);
  --shadow-hover: 
    0 4px 8px rgba(0, 0, 0, 0.04),
    0 15px 30px rgba(0, 0, 0, 0.08),
    0 30px 15px rgba(0, 0, 0, 0.06),
    0 45px 70px rgba(0, 0, 0, 0.1);

  --shadow-hover-reversed: 
    -0 -4px 8px rgba(0, 0, 0, 0.04),
    -0 -15px 30px rgba(0, 0, 0, 0.08),
    -0 -30px 15px rgba(0, 0, 0, 0.06),
    -0 -45px 70px rgba(0, 0, 0, 0.1);
  
  --light-shadow-hover:
  0 3px 6px rgba(0, 0, 0, 0.03),
  0 12px 24px rgba(0, 0, 0, 0.05),
  0 20px 10px rgba(0, 0, 0, 0.05),
  0 30px 40px rgba(0, 0, 0, 0.07);
}

/* THEME OVERRIDE: SHADOW MODE (DARK CRIMSON) */
.theme-shadow {
  --bg-main: #353333;   
  --bg-alt: #910000;    
  --bg-surface: #ffffff;     
  --bg-surface-hover: #2e2e36;
  --border-color: #af2626;
  --ai-border-color: #ffffff; 
  --user-border-color: #910000;   
  --text-main: #e6e6e6;      
  --text-muted: #9ca3af;     
  --accent-primary: #dc2626; 
  --accent-success: #eab308; 
  --accent-danger: #ff0000;  
  --text: #ffffff;

  /* Component Overrides */
  --bubble-user-bg: #910000;
  --bubble-user-border: #7f1d1d;
  --bubble-user-text: #f3f4f6;
  --bubble-ai-bg: #0a0a0c;
  --bubble-ai-border: #0a0a0c;
  --bubble-ai-text: #e5e7eb;
  --filter-bg: #1c1111;
  --hero-overlay: linear-gradient(rgba(10, 10, 12, 0.4), rgba(10, 10, 12, 0.85));
  --input-text: var(--text-main);
  --card-text: #e5e7eb;
  --loader-glow: drop-shadow(0 0 6px rgba(220, 38, 38, 0.7));
  /* Deeper, more aggressive black layering to cut through the dark theme */
  --shadow:
      0 4px 6px rgba(0, 0, 0, 0.3),
      0 15px 30px rgba(0, 0, 0, 0.4),
      0 30px 60px rgba(0, 0, 0, 0.5); 
  --shadow-dark-hover: 
    0 8px 12px rgba(0, 0, 0, 0.45),
    0 22px 40px rgba(0, 0, 0, 0.55),
    0 45px 80px rgba(0, 0, 0, 0.65);    
}

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

body, html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main); 
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

body:has(.theme-shadow) {
  background-color: #353333;
}

/* Custom Clean Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ==========================================================================
   2. LANDING PAGE STYLES (Identity Gatekeeper)
   ========================================================================== */
.landing-page {
  display: flex;
  width: 100vw;
  height: 100vh;
}

.landing-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10% 5%;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
}

.landing-right {
  flex: 1.2;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Clean pastel overlay to anchor the landing image smoothly */
.landing-right::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, var(--bg-surface) 0%, rgba(219, 234, 254, 0.3) 100%);
}

.landing-hero-text h2 {
  font-size: 2.2rem;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.landing-hero-text p {
  color: #4b5563;
  margin-bottom: 2.5rem;
  font-size: 1rem;
  line-height: 1.5;
}

.enter-btn {
  width: 100%;
  max-width: 300px;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.enter-btn:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}
.enter-btn:active:not(:disabled) {
  background: #2563eb;
  transform: translateY(2px);
}
.enter-btn:disabled {
  background: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   3. SECURE PORTAL CORE LAYOUT (Chat Interface)
   ========================================================================== */
.portal-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  min-height: 100vh;
  background-color: var(--bg-main); 
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Top Navigation Bar */
.menu-navigator {
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
  box-shadow: var(--shadow);
  transition: all 0.9s ease
}
.theme-shadow .menu-navigator {
  background-color: #1c1111;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.menu-navigator:hover {
  box-shadow: var(--shadow-hover);
  transition: 0.9s ease
}
.nav-logo {
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--accent-primary);
}

.nav-logo a, 
.nav-logo a:visited {
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--accent-primary) !important; /* Forces the link to stay your primary accent */
  text-decoration: none;
}

.banner-context a {
  color: var(--text-main);
  text-decoration: underline;
  font-weight: 500;
}

.theme-shadow .banner-context {
  color: var(--text-muted)
}
.banner-context h4 {
  color: var(--text-main); /* Uses the soft sky-blue or ash-gray depending on theme */
  margin-bottom: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.nav-links span {
  color: #4b5563;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-links span.active, .nav-links span:hover {
  color: var(--text-main);
  font-weight: 600;
}




.nav-links span.nav-exit:hover {
  color: var(--accent-danger);
}

/* Banner Frame (Locked perfectly at 45% position) */
.hero-banner {
  height: 110px;
  background-size: cover;
  background-position: center 45%; 
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--light-shadow);
  /* transition: all 0.9 ease; */
  --hero-bg: none;
  transition: filter 0.4s ease;
}

.theme-shadow .hero-banner {
  box-shadow: var(--shadow);
}

/* Soft white tint shield layer to keep text highly legible */
.hero-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.75));
  z-index: 1;
}

.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  /* background: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.75)); */
  background-size: cover;
  background-position: center 45%;
  background-repeat: no-repeat;
  background-image: var(--hero-bg); /* pulls the inline backgroundImage */
  transform: scale(1);
  transition: transform 0.6s ease;
  z-index: 1;
}

/* Hover zoom */
.hero-banner:hover {
  /* box-shadow: var(--shadow-hover); */
  transition: all 0.2 ease;
  filter: brightness(1.07);
}

.banner-context {
  position: relative;
  z-index: 2;
}

.banner-context h3 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  display: inline-block;
  font-family: monospace;
  font-weight: 600;
}

/* Main Body Framework */
.portal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 1.5rem 1.5rem 1.5rem; /* Top: 0, Right: 1.5rem, Bottom: 1.5rem, Left: 1.5rem */  min-height: 0;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

div:has(.portal-body) {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.remove-file-btn {
  all: unset;
  margin-left: 0.5rem;
  cursor: pointer;
  color: var(--accent-primary);
  font-weight: bold;
}
/* Chat History Matrix */
.chat-window {
  flex: 1;
  scroll-behavior: smooth;
  border-radius: 8px;
  padding: 1.25rem 1.5rem 2rem 1.5rem; /* Explicit: top, right, bottom, left */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;

  /* Dual fade mask (Matches both WebKit and Standard spec) */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0px,
    black 40px,
    black calc(100% - 36px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0px,
    black 40px,
    black calc(100% - 36px),
    transparent 100%
  );
}

.message-bubble {
  max-width: 75%;
  padding: 0.85rem 1.2rem;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 0.95rem;
  animation: fadeIn 0.2s ease-out forwards;
  box-shadow: var(--shadow);
}

.message-sender {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
  font-family: monospace;
  text-transform: uppercase;
}

/* Message Variations */
.message-bubble.system {
  align-self: center;
  background: #f8fafc;
  border: 1px dashed var(--border-color);
  color: #64748b;
  font-size: 0.85rem;
  max-width: 100%;
  text-align: center;
}
.message-bubble.system .message-sender { color: #64748b; }

.message-bubble.user {
  align-self: flex-end;
  background: var(--bubble-user-bg);       /* Very soft, clean light blue bubble */
  color: var(--text-main);   /* Easy reading deep blue text */
  border: 1px solid var(--user-border-color);
  box-shadow: var(--shadow);
}

.message-bubble.user .message-sender { color: var(--accent-primary); }

.message-bubble.ai {
  align-self: flex-start;
  background: #f8fafc;       /* Off-white bubble for AI response clarity */
  border: 1px solid var(--ai-border-color);
  color: #334155;
  box-shadow: var(--shadow);
}
.message-bubble.ai .message-sender { color: var(--text-main); }

.message-bubble.ai.thinking {
  color: #94a3b8;
  font-style: italic;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}

.message-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-text p {
  margin: 0.35rem 0;
}

.message-text p:first-child {
  margin-top: 0;
}

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

.citation-link {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.citation-link-document {
  display: inline-flex;
  max-width: 100%;
  margin-top: 0.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.08);
  line-height: 1.35;
  text-decoration: none;
}

.citation-link-document:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.55);
}

.theme-shadow .message-bubble.user {
  align-self: flex-end;
  background: #910000;       /* Very soft, clean light blue bubble */
  color: var(--text);   /* Easy reading deep blue text */
  border: 1px solid #910000;
  box-shadow: var(--shadow);
}

.theme-shadow .message-bubble.ai {
  align-self: flex-start;
  background: #1a1a1a;       /* Off-white bubble for AI response clarity */
  border: 1px solid #1a1a1a;
  color: #334155;
  color: var(--text);
}

/* ==========================================================================
   4. INTERACTIVE EXAMPLE CARDS
   ========================================================================== */
.example-cards-container {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.query-card {
  background: #dbeafe;
  border: 1px solid var(--user-border-color);
  padding: 1rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  color: var(--text);
}


.theme-shadow .query-card {
  background: #910000;                  
  border: 1px solid var(--border-color);
  filter: var(--loader-glow);         
}

.query-card:hover {
  background: #f8fafc;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  translate: translateY(-2px);
}

.theme-shadow .query-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.query-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.query-card p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.query-card span {
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 600;
  align-self: flex-end;
}

/* ==========================================================================
   5. CONTROLS FOOTER & FILTERS DRAWER
   ========================================================================== */
.controls-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-input-wrapper {
  position: relative;
  flex: 1;
  z-index: 0;
  
  transition: all 0.2s ease;
}

.chat-input-wrapper .chat-input {
  width: 100%
}

/* Animated border layer */
.chat-input-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 25px;
  padding: 2px; /* border thickness */
  pointer-events: none;
  transition: all 0.2s ease;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #00aaff 20%,
    #00ffcc 40%,
    transparent 60%
  );
  background-size: 400% 400%;
  z-index: 0;
  @keyframes borderLoop {
    0%   { background-position: 0% 0%; }
    25%  { background-position: 100% 0%; }
    50%  { background-position: 100% 100%; }
    75%  { background-position: 0% 100%; }
    100% { background-position: 0% 0%; }
  }

  /* Turn gradient into a border */
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;

  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Hover activates the glowing border */
.chat-input-wrapper:hover::before {
  opacity: 1;
  animation: borderLoop 3s linear infinite;
  transform: translateY(-2px);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-hover-reversed);
}

.chat-input-wrapper:active::before {
  transform: translateY(2px);
}
.chat-input-wrapper:hover {
  transform: translateY(-2px);
  transition: all 0.2s ease;
}
.chat-input-wrapper:focus-within::before {
   opacity: 1;
   animation: borderLoop 3s linear infinite;
   box-shadow: var(--shadow-hover);
}

.chat-input-wrapper:active {
  transform: translateY(2px);
}


/* Looping animation */
@keyframes borderLoop {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 20%; }
}

.chat-input {
  position: relative;
  z-index: 1;
}

.chat-input-area {
  display: flex;
  background: var(--bg-main);
  z-index: 2;
}

.chat-input-area input:focus {
  border-color: transparent; /* hide real border */
  opacity: 1;
  animation: borderLoop 3s linear infinite;
}

.chat-input-area input:hover {
  /* border-color: var(--accent-primary); */
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.chat-input-area input:active {
  transform: translateY(2px);
  box-shadow: none;
}

.chat-input-area input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--ai-border-color);
  padding: 0.85rem 1.2rem;
  border-radius: 25px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
  background: var(--bg-main);
  box-shadow: var(--shadow);
  z-index: 1;

}

.theme-shadow .chat-input-area input {
  border: 1px solid var(--border-color)
}

.chat-input-area input:focus {
  /* border-color: var(--accent-primary); */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.chat-input-area input::placeholder {
  color: #94a3b8;
}

.chat-input-area .icon-button svg,
.chat-input-area .icon-button svg * {
    stroke: var(--accent-primary) !important;
    fill: none !important;
}


.circle-icon-button {
  all: unset;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-shadow .circle-icon-button {
  border: none;
}
.circle-icon-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.circle-icon-button:active:not(:disabled) {
  transform: translateY(2px);
}

.circle-icon-button svg,
.circle-icon-button svg * {
  stroke: var(--accent-primary) !important;
  fill: none !important;
}




.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-button:hover:not(:disabled) {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* Force icon color */
.icon-svg,
.icon-svg * {
  stroke: var(--accent-primary) !important;
  fill: none !important;
}

.input-stack {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

.icon-row {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.chat-textarea {
  width: 100%;
  resize: none;
  min-height: 64px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.85rem 1.2rem 2.5rem; /* extra bottom padding for icons */
  border-radius: 25px;
  border: 1px solid var(--ai-border-color);
  background: var(--bg-main);
  color: var(--text);
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  outline: none;
  transition: all 0.2s;
}

.chat-tooltip-popover a,
.chat-tooltip-popover a:visited {
  color: #00f2fe !important;
  text-decoration: underline;
}

.chat-tooltip-popover a:hover {
  color: #38bdf8 !important;
}

.theme-shadow .chat-textarea {
  border: 1px solid var(--bubble-user-border)
}
.chat-textarea:active {
  box-shadow: none;
}

.icon-row-overlay {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.chat-input-area .submit-button,
.chat-input-area .clear-button {
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 0 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.theme-shadow .chat-input-area .clear-button {
  background-color: #000000 !important;
}

.chat-input-area button:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.chat-input-area button:active:not(:disabled) {
  background: #2563eb;
  transform: translateY(2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.chat-input-area button:disabled {
  border: none !important;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
  cursor: not-allowed;
}

/* Security Dropdown Filter Component Row */
.filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: #eff6ff; 
  border: 1px solid var(--user-border-color);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.theme-shadow .filter-row {
  background: var(--bg-main); 
  border: 1px solid var(--border-color);
}

.theme-shadow .filter-row:hover {
  background: #1c1111;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.filter-row:hover {
  background: #f8fafc;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.filter-row label {
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-row select {
  background: var(--bg-main);
  color: #334155;
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.6rem;
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-row select:focus {
  border-color: var(--accent-primary);
}

.filter-row select:hover {
  box-shadow: var(--shadow-hover);
  transition: all 0.2s ease;
}
.affiliate-select:hover {
  background: #f8fafc;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.nav-clear:hover {
  color: #f8fafc !important;
  text-decoration: underline;
}
.export-button {
  background-color: var(--accent-primary);
  color: '#ffffff';
  marginLeft: '0.5rem'
}


/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   6. DYNAMIC STATE TRANSITIONS
   ========================================================================== */
/* FIX: Move the sizing limits here so the dashboard column stays 
   perfectly compact, centered, and sized the same before and after chatting */


.portal-body.initial-state-view {
  flex: 1;
}

/* Keeps cards container compact and perfectly preserves its original size */
.portal-body.initial-state-view .example-cards-container {
  flex: none;
}

/* Forces the footer to pin to the baseline by consuming the empty space above it */
.portal-body.initial-state-view .controls-footer {
  margin-top: auto;
  padding-top: 2rem; 
}

/* Ensure smooth auto-scroll tracking inside layout calculations */


/* ==========================================================================
   7. LOADING ANIMATIONS
   ========================================================================== */


/* Container alignment for the loader */
.sonic-loader-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: none !important; 
  background: transparent !important;
  padding: 1rem !important;
}

/* 🌀 The GIF Sprite Controller */
.sonic-spin-gif {
  width: 32px;
  height: 32px;
  object-fit: contain;
  
  /* 💡 PRO-TIP: Keeps old-school 16-bit pixels razor-sharp instead of blurry */
  image-rendering: pixelated; 
  
  /* Optional: Adds a subtle blue chaos energy glow behind the sprite */
  /* filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.6)); */
}

/* Keeps the text pulsing while waiting */
.loading-text {
  color: #94a3b8;
  font-size: 0.95rem;
  animation: text-pulse 1.5s ease-in-out infinite;
}

@keyframes text-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* --- Mobile Responsive Overrides --- */
@media (max-width: 768px) {
  /* Stack the landing page split screen into a single column */
  .landing-page {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .landing-left {
    width: 100% !important;
    padding: 1.5rem !important;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .landing-right {
    display: none; /* Hide the desktop split image panel on mobile to save space */
  }

  .login-actions-container {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Hide mobile toggle by default on desktop */
.mobile-menu-toggle {
  display: none;
}

.mobile-drawer {
  display: none;
}

/* --- Mobile Breakpoint (Phones under 768px) --- */
@media (max-width: 768px) {
  /* Hide standard desktop link row */
  .desktop-only {
    display: none !important;
  }

  /* Show mobile hamburger button */
  .mobile-menu-toggle {
    display: block;
  }

  .hamburger-btn {
    background: var(--accent-primary) !important;
    border: 1px solid var(--accent-primary) !important;
    color: white !important; /* Dark text for Sonic mode visibility */
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Slick Mobile Slide-down Drawer */
  .mobile-drawer {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(18, 24, 36, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.2s ease-out forwards;
  }

  .mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #94a3b8;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
  }

  .theme-toggle-btn-mobile {
    background: #1e293b;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: #f8fafc;
    font-weight: 500;
  }

  .mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-drawer-links span {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 1rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
  }

  .mobile-drawer-links span:active {
    background: rgba(255, 255, 255, 0.1);
  }

  .mobile-logout {
    color: #ef4444 !important;
    font-weight: 600;
  }
}
.mobile-actions-group {
  display: none;
}

@media (max-width: 768px) {
  /* Show mobile actions group on phones */
  .mobile-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .example-cards-container .query-card:not(:first-child) {
    display: none !important;
  }
  .message-bubble {
    max-width: 97% !important;
  }

  .citation-link-document {
    display: block;
    width: 100%;
    font-size: 0.84rem;
  }
}

  .mobile-quick-disconnect {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
  }



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

/* ===================================== */
/* ==========================================================================
   BTY EMBEDDED WIDGET THEME
   ========================================================================== */
.bty-embed-container {
  --bg-main: #121316;
  --bg-surface: #1c1e22;
  --bg-surface-hover: #23262b;
  --border-color: rgba(56, 194, 222, 0.25);
  --ai-border-color: #23262b;
  --user-border-color: rgba(56, 194, 222, 0.35);
  --text-main: #e7eaee;
  --text-muted: #9aa1ab;
  --text: #e7eaee;
  --accent-primary: #38C2DE;
  --bubble-user-bg: rgba(56, 194, 222, 0.12);

  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: var(--bg-main);
  color: var(--text-main);
}

/* Bound the height chain so the footer can genuinely pin, chat length can't push it off */
.bty-embed-container div:has(.portal-body) {
  flex: 1;
  min-height: 0;
}
.bty-embed-container .portal-body { min-height: 0; }
.bty-embed-container .chat-window { min-height: 0; }
.bty-embed-container .controls-footer {
  margin-top: auto;
  padding: 0 1.25rem 1.25rem;
}

/* Restyle components instead of masking them */
.bty-embed-container .message-bubble.ai {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}
.bty-embed-container .message-bubble.user {
  background: var(--bubble-user-bg);
  border-color: var(--border-color);
  color: var(--text-main);
}
.bty-embed-container .query-card {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}
.bty-embed-container .query-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
}
.bty-embed-container .chat-input-area input,
.bty-embed-container .chat-textarea {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}

.bty-embed-container .citation-link {
  color: var(--accent-primary);
}

.bty-embed-container .citation-link-document {
  border-color: var(--border-color);
  background: rgba(56, 194, 222, 0.08);
}

.bty-loader-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.bty-loader-dots {
  display: flex;
  gap: 6px;
}

.bty-loader-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: bty-bounce 1.1s ease-in-out infinite;
}

.bty-loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.bty-loader-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bty-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}