/* ============================================
   STYLES - Main Dashboard
   Fonts and colors defined in base.css
   ============================================ */

/* ============================================
   GLOBAL DRAG-TO-UPLOAD OVERLAY
   ============================================ */

.global-drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 249, 245, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.global-drop-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.global-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 64px;
  border: 2px dashed #7ba82e;
  border-radius: 20px;
  background: rgba(123, 168, 46, 0.05);
  text-align: center;
  pointer-events: none;
}

.global-drop-content svg {
  stroke: #7ba82e;
  opacity: 0.9;
}

.global-drop-content h2 {
  font-family: var(--font-family-bold, sans-serif);
  font-size: 1.6rem;
  color: rgba(0, 0, 0, 0.85);
  margin: 0;
}

.global-drop-content p {
  font-family: var(--font-family-regular, sans-serif);
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.5);
  margin: 0;
}

/* ============================================
   LOGIN SPLASH SCREEN
   Shown immediately on index.html after login
   via .splash-active on <html> (set before JS loads)
   ============================================ */

#splashOverlay {
  position: fixed;
  inset: 0;
  background: #FAF9F5;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* Shown instantly when coming from login (class set in <head> before JS) */
html.splash-active #splashOverlay {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}


#splashOverlay video {
  width: 320px;
  max-width: 80vw;
}

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

/* html.modal-open no longer needed — body is permanently overflow: hidden */

body {
  font-family: var(--font-family-base);
  background: var(--color-bg);
  height: 100vh;
  overflow: hidden;
  color: var(--color-text-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Hide content until authentication check completes */
  visibility: hidden;
}

body.auth-checked {
  visibility: visible;
}

/* ========================================
   APP WRAPPER (Pushed by Sidebar)
   ======================================== */
.app-wrapper {
  margin-left: 260px;
  transition: margin-left 300ms cubic-bezier(0.2, 0, 0.2, 1);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-nav.collapsed ~ .app-wrapper {
  margin-left: 90px;
}

@media (max-width: 1024px) {
  .app-wrapper {
    margin-left: 0;
  }
}

/* ========================================
   HEADER
   ======================================== */

.app-header {
  background: var(--color-bg-surface);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-soft);
}

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

.logo {
  height: 40px;
  width: auto;
  cursor: pointer;
  transition: transform 0.2s;
}

.logo:hover {
  transform: scale(1.05);
}

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

.user-email {
  color: var(--gray-700);
  font-size: 0.9rem;
}

.btn-upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--color-primary-text);
  border: 2px solid var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: 'n27medium', sans-serif;
  font-size: 0.9rem;
  font-weight: normal;
  transition: background-color 200ms ease-out, border-color 200ms ease-out;
}

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

.btn-upload svg {
  stroke: currentColor;
}

.btn-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 2px solid var(--btn-secondary-border);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: 'n27medium', sans-serif;
  font-size: 0.9rem;
  font-weight: normal;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out;
}

.btn-account::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  background-color: var(--btn-secondary-bg-hover);
  transition: width 300ms cubic-bezier(0.2, 0, 0.2, 1);
  z-index: -1;
}

.btn-account:hover {
  border-color: var(--btn-secondary-border-hover);
  color: var(--btn-secondary-fg-hover);
}

.btn-account:hover::before {
  width: 100%;
}

.btn-account svg {
  stroke: currentColor;
}

.btn-logout {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 2px solid var(--btn-secondary-border);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: 'n27medium', sans-serif;
  font-size: 0.9rem;
  font-weight: normal;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out;
}

.btn-logout::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  background-color: var(--btn-secondary-bg-hover);
  transition: width 300ms cubic-bezier(0.2, 0, 0.2, 1);
  z-index: -1;
}

.btn-logout:hover {
  border-color: var(--btn-secondary-border-hover);
  color: var(--btn-secondary-fg-hover);
}

.btn-logout:hover::before {
  width: 100%;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

#documentsView,
#settingsView {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#settingsView {
  overflow-y: auto;
}

.app-main {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ========================================
   VIEW SYSTEM
   ======================================== */

.view {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.view.active {
  display: block;
}

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

/* ========================================
   DASHBOARD VIEW
   ======================================== */

/* ========================================
   MODAL STYLES
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 42, 40, 0.7);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

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

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

.fade-in {
  animation: fadeInContent 250ms ease-out both;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header h2 {
  font-size: 1.5rem;
  font-family: 'n27bold', sans-serif;
  color: var(--primary);
  font-weight: normal;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--gray-700);
  transition: all 0.2s;
  border-radius: 0.5rem;
}

.modal-close:hover {
  background: rgba(211, 129, 63, 0.1);
  color: var(--primary);
}

.modal-close svg {
  display: block;
}

.modal-body {
  padding: 2rem;
}

.modal-subtitle {
  color: var(--gray-700);
  margin-bottom: 2rem;
  text-align: center;
}

.subtitle {
  font-size: 1.1rem;
  font-family: 'n27regular', sans-serif;
  color: var(--gray-700);
  margin-bottom: 2rem;
}

.upload-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: 1rem;
  padding: 4rem 2rem;
  cursor: pointer;
  transition: all 0.3s;
  background: #faf9f6;
  position: relative;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(211, 129, 63, 0.15);
  transform: translateY(-2px);
}

.upload-dropzone.dragging {
  border-color: var(--primary);
  background: rgba(211, 129, 63, 0.08);
  transform: scale(1.02);
  box-shadow: 0 10px 24px rgba(211, 129, 63, 0.2);
}

.upload-icon {
  color: var(--primary);
  margin-bottom: 1rem;
  stroke-width: 2;
}

.upload-text {
  font-size: 1.25rem;
  font-family: 'n27medium', sans-serif;
  color: #1a1410;
  margin-bottom: 0.5rem;
  font-weight: normal;
}

.upload-subtext {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.upload-hint {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.upload-status {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  display: none;
  font-size: 0.95rem;
}

.upload-status.visible {
  display: block;
  animation: slideDown 0.3s;
}

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

.upload-status.success {
  background: rgba(211, 129, 63, 0.15);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}

.upload-status.error {
  background: rgba(255, 68, 68, 0.15);
  color: #cc0000;
  border: 1px solid var(--error);
}

.upload-status.uploading {
  background: rgba(211, 129, 63, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
}

/* ========================================
   RECENT DOCUMENTS SECTION
   ======================================== */

.recent-section {
  margin-top: 3rem;
}

.section-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header-inline h2 {
  font-size: 1.75rem;
  font-family: 'n27bold', sans-serif;
  color: var(--primary);
  margin: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stats-inline {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: #e8e4d8;
  border-radius: 0.5rem;
  padding: 0.25rem;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: var(--gray-600);
  transition: background-color 200ms ease-out, color 200ms ease-out;
}

.view-btn:hover {
  background: #d4cfc0;
  color: #1a1410;
}

.view-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(58, 42, 40, 0.12);
}

.view-btn svg {
  stroke: currentColor;
}

.stats-inline span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stats-inline strong {
  color: var(--gray-900);
  font-size: 1.1rem;
  font-weight: 600;
}

/* Removed - now using block display for table layout */

/* List View */
.document-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.document-grid.list-view .document-card {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.document-grid.list-view .document-card:first-child {
  border-top: 1px solid var(--gray-200);
}

.document-grid.list-view .doc-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.document-grid.list-view .doc-card-icon {
  flex-shrink: 0;
}

.document-grid.list-view .doc-card-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.document-grid.list-view .doc-card-title {
  flex: 1;
  font-size: 0.95rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.document-grid.list-view .doc-card-meta {
  font-size: 0.875rem;
  color: var(--gray-700);
  flex-shrink: 0;
  white-space: nowrap;
}

.document-grid.list-view .empty-state {
  padding: 4rem 2rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
}

.document-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  padding: 1.5rem;
  cursor: default;
  transition: all 0.2s;
}

.document-card.clickable {
  cursor: pointer;
}

.document-card.clickable:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.doc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.doc-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(211, 129, 63, 0.1);
  border-radius: 0.5rem;
  color: var(--primary);
}

.doc-card-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.doc-card-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.doc-card-status.processing {
  background: rgba(211, 129, 63, 0.2);
  color: var(--primary);
}

.doc-card-status.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.doc-card-status.failed {
  background: rgba(255, 68, 68, 0.2);
  color: #cc0000;
}

.doc-card-status.queued,
.doc-card-status.pending {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.pulse {
  animation: pulse 2s infinite;
}

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

.doc-card-title {
  font-family: 'n27medium', sans-serif;
  font-weight: normal;
  color: #1a1410;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-card-meta {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state svg {
  color: rgba(123, 168, 46, 0.5);
  margin-bottom: 1.5rem;
}

.empty-state p {
  font-family: 'n27medium', sans-serif;
  font-size: 1.125rem;
  color: rgba(0, 0, 0, 0.7);
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}

.empty-state small {
  font-family: 'n27', sans-serif;
  font-size: 0.9375rem;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.6;
  max-width: 400px;
  display: block;
  margin: 0 auto;
}

/* ========================================
   PROJECT HEADER & TABS
   ======================================== */
.project-header {
  margin-bottom: 2rem;
}

.project-header h2 {
  font-size: 1.75rem;
  font-family: 'n27medium', sans-serif;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.project-tabs {
  display: flex;
  gap: 0;
  width: 100%;
  border-bottom: none;
  padding-bottom: 0;
}

.project-tab {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  background: transparent;
  color: rgba(0, 0, 0, 0.5);
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 2px solid #d1d5db;
  font-family: 'n27medium', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 200ms ease-out, border-color 200ms ease-out;
}

.project-tab:hover {
  color: rgba(0, 0, 0, 0.8);
}

.project-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

/* Tab Content Containers */
.tab-content {
  display: none;
  animation: fadeIn 200ms ease-out;
}

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

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

/* ========================================
   SETTINGS TOGGLES (Notification + Format)
   ======================================== */

.settings-toggles-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  margin-bottom: 1rem;
  gap: 2rem;
  flex-wrap: nowrap;
}

.settings-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
}

.settings-toggle-text {
  font-family: 'n27medium', sans-serif;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

.toggles-separator {
  color: rgba(0, 0, 0, 0.2);
  font-size: 1.25rem;
  user-select: none;
}

.format-toggles {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.format-toggles-label {
  font-family: 'n27medium', sans-serif;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: all 250ms ease-out;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 250ms ease-out;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(123, 168, 46, 0.2);
}

/* ========================================
   UPLOAD ZONE
   ======================================== */

.upload-zone {
  margin-bottom: 1.5rem;
}


.upload-zone-label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px dashed rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: all 150ms ease-out;
  font-family: 'n27regular', sans-serif;
  font-size: 0.9375rem;
  color: rgba(0, 0, 0, 0.6);
}

.upload-zone-hint {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.35);
  margin-top: -0.25rem;
}

.upload-zone-label:hover {
  border-color: var(--primary);
  background: rgba(123, 168, 46, 0.05);
  color: rgba(0, 0, 0, 0.8);
}

.upload-zone-label svg {
  opacity: 0.6;
}

.upload-zone-label:hover svg {
  opacity: 1;
  stroke: var(--primary);
}

/* ========================================
   FILES LIST TABLE
   ======================================== */

/* Override max-width constraints for files list */
.document-grid {
  display: block;
  padding: 0;
  width: 100%;
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0 0.75rem;
}

.pagination-btn:hover:not(.disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--gray-900);
}

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

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

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  color: var(--gray-500);
  font-size: 0.875rem;
}

.pagination-info {
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.files-list-container {
  width: 100%;
  margin-top: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.bulk-actions-area {
  position: absolute;
  left: 7px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.bulk-delete-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.3);
  cursor: default;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.bulk-delete-btn.has-selection {
  color: #ef4444;
  cursor: pointer;
  font-family: 'n27medium', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
}

.bulk-delete-btn.has-selection:hover {
  background: rgba(239, 68, 68, 0.08);
}

.bulk-download-wrapper {
  position: relative;
}

.bulk-download-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.3);
  cursor: default;
  padding: 9px 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.bulk-download-btn.has-selection {
  color: #7cb342;
  cursor: pointer;
  font-family: 'n27medium', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
}

.bulk-download-btn.has-selection:hover {
  background: rgba(124, 179, 66, 0.08);
}

.bulk-download-menu {
  position: absolute;
  left: 100%;
  bottom: calc(100% - 50px);
  transform: translateY(-4px);
  background: #f5f5f0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 0.4rem 0.5rem;
  min-width: 130px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s ease;
  z-index: 100;
}

.bulk-download-menu.open {
  opacity: 1;
  transform: translateY(0px);
  pointer-events: auto;
}

.bulk-download-menu-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.bulk-download-menu-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-family: 'n27medium', sans-serif;
  font-size: 0.8125rem;
  border-radius: 6px;
  transition: background 0.1s;
}

.bulk-download-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.bulk-download-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.bulk-download-checkbox:checked {
  background: #7cb342;
  border-color: #7cb342;
}

.bulk-download-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 0px;
  left: 3.5px;
  width: 3.5px;
  height: 7px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.bulk-download-go-btn {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: rgba(124, 179, 66, 0.15);
  color: #6da536;
  border: 1px solid rgba(124, 179, 66, 0.3);
  border-radius: 6px;
  font-family: 'n27medium', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.bulk-download-go-btn:hover {
  background: rgba(124, 179, 66, 0.25);
}

.bulk-download-go-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.files-table thead {
  border-bottom: none;
  background-color: transparent;
}

.files-table th {
  text-align: left;
  padding: 0.5rem 1rem;
  vertical-align: middle;
  font-family: 'n27medium', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.6);
  font-weight: normal;
}

.file-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Column widths */
/* Column 1: Name (with checkbox) */
.files-table th:nth-child(1) {
  width: 35%;
  text-align: left;
}

/* Column 2: Type */
.files-table th:nth-child(2) {
  width: 8%;
  text-align: left;
}

/* Column 3: Pages */
.files-table th:nth-child(3) {
  width: 8%;
  text-align: left;
}

/* Column 4: Uploaded */
.files-table th:nth-child(4) {
  width: 22%;
  text-align: left;
}

/* Column 5: Status */
.files-table th:nth-child(5) {
  width: 12%;
  text-align: left;
}

/* Column 6: Options */
.files-table th:nth-child(6) {
  width: 60px;
  text-align: center;
}

/* Recent view: 7 columns (Name, Project, Type, Pages, Last Accessed, Status, Options) */
.files-table.recent-view th:nth-child(1) { width: 28%; }
.files-table.recent-view th:nth-child(2) { width: 14%; }
.files-table.recent-view th:nth-child(3) { width: 7%; }
.files-table.recent-view th:nth-child(4) { width: 7%; }
.files-table.recent-view th:nth-child(5) { width: 20%; }
.files-table.recent-view td:nth-child(5) { white-space: nowrap; }
.files-table.recent-view th:nth-child(6) { width: 10%; text-align: left; }
.files-table.recent-view th:nth-child(7) { width: 60px; text-align: center; }

.files-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.sort-indicator {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.55rem;
  margin-left: 4px;
  vertical-align: middle;
}

.sort-indicator .sort-up,
.sort-indicator .sort-down {
  color: rgba(0, 0, 0, 0.25);
  transition: color 0.15s;
}

.sort-indicator.asc .sort-up { color: var(--primary); }
.sort-indicator.asc .sort-down { color: rgba(0, 0, 0, 0.12); }
.sort-indicator.desc .sort-down { color: var(--primary); }
.sort-indicator.desc .sort-up { color: rgba(0, 0, 0, 0.12); }

/* File Search + Toolbar Row */
.files-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1rem 0 1.5rem 0;
  margin-bottom: 0.5rem;
}

.file-search-area {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
}

.file-search-bar {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  padding: 6px 12px;
  gap: 8px;
  width: 200px;
}

.file-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-family-base);
  font-size: 0.875rem;
  color: var(--color-text);
}

.file-search-input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.file-search-bar-icon {
  width: 16px;
  height: 16px;
  opacity: 0.35;
  flex-shrink: 0;
}

.files-table tbody tr {
  border-bottom: none;
  transition: background-color 150ms ease-out;
}

.files-table tbody tr:nth-child(odd of .file-row) {
  background-color: rgba(0, 0, 0, 0.03);
}

.files-table tbody tr:hover:not(.inline-viewer-row):not(.file-row-clickable) {
  background-color: unset;
}

.files-table tbody tr.file-row-clickable:hover {
  background-color: rgba(0, 0, 0, 0.08) !important;
}

.files-table td {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.8);
  vertical-align: middle;
}

.file-name,
.file-name-col {
  font-family: 'n27regular', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name-inner,
.file-name-col-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-name .file-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.file-name-clickable {
  cursor: pointer;
  transition: color 0.15s ease;
}

.file-name-clickable:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Inline filename editing */
.file-rename-wrapper {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.file-name-input {
  font-family: 'n27medium', sans-serif;
  font-size: 0.9375rem;
  color: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  padding: 4px 8px;
  background: white;
  outline: none;
  box-shadow: 0 0 0 3px rgba(123, 168, 46, 0.1);
  flex: 1;
  min-width: 0;
}

.file-rename-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.file-rename-confirm {
  color: #4caf50;
}

.file-rename-confirm:hover {
  background: rgba(76, 175, 80, 0.1);
}

.file-rename-cancel {
  color: #999;
}

.file-rename-cancel:hover {
  color: #e53935;
  background: rgba(229, 57, 53, 0.1);
}

.file-name svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.file-type-filled {
  fill: currentColor;
  opacity: 0.6;
}

.file-type-icon:not(.file-type-filled) {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.file-size,
.file-pages,
.file-type,
.file-date {
  color: rgba(0, 0, 0, 0.6);
}

.file-project {
  color: rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-project .project-link {
  color: var(--color-primary);
  text-decoration: none;
  font-family: var(--font-family-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.file-project .project-link:hover {
  text-decoration: underline;
  color: var(--color-primary-hover);
}

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

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

/* File context menu */
.file-menu-cell {
  position: relative;
  text-align: center;
  width: 50px;
}

.file-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: rgba(0, 0, 0, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease-out;
}

.file-menu-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.7);
}

.file-context-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 1000;
  padding: 0.25rem 0;
  margin-top: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 150ms ease;
}

.file-context-menu.show {
  opacity: 1;
  visibility: visible;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'n27regular', sans-serif;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.8);
  text-align: left;
  transition: background-color 150ms ease-out;
}

.context-menu-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.context-menu-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.context-menu-item-danger {
  color: #ef4444;
}

.context-menu-item-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

.context-menu-item-danger svg {
  stroke: #ef4444;
  opacity: 1;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-family: 'n27medium', sans-serif;
}

.status-ready {
  color: #0369a1;
}

.status-processing {
  color: #a16207;
}


.status-completed {
  color: #15803d;
}

.status-failed {
  color: #b91c1c;
}

/* Progress Info (for Processing files) */
.progress-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 120px;
}

.progress-percentage {
  font-family: 'n27bold', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.2;
  color: #d97706;
  margin: 0;
  padding: 0;
  display: block;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background-color: #fef3c7;
  border-radius: 2px;
  overflow: hidden;
  margin: 1px 0 !important;
  padding: 0 !important;
  line-height: 0;
  display: block;
  font-size: 0;
}

.progress-bar-fill {
  height: 100%;
  background-color: #f59e0b;
  border-radius: 2px;
  transition: width 300ms ease-out;
}

.progress-eta {
  font-family: 'n27regular', sans-serif;
  font-size: 0.75rem;
  line-height: 1.2;
  color: rgba(0, 0, 0, 0.5);
  margin: 0;
  padding: 0;
  display: block;
}

/* OCR & View Buttons */
.btn-ocr,
.btn-ocr-disabled,
.btn-view,
.btn-close-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: 'n27medium', sans-serif;
  cursor: pointer;
  border: 2px solid;
  transition: all 150ms ease-out;
  width: 100%;
  gap: 0.375rem;
}

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

.btn-ocr:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 168, 46, 0.3);
}

.btn-ocr:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-ocr-disabled {
  background: transparent;
  color: rgba(0, 0, 0, 0.3);
  border-color: rgba(0, 0, 0, 0.15);
  cursor: not-allowed;
}

.btn-ocr-disabled:hover {
  transform: none;
}

/* View Button */
.btn-view {
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
}

.btn-view:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 168, 46, 0.3);
}

.btn-view:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-view svg {
  width: 16px;
  height: 16px;
}

/* Close Viewer Button */
.btn-close-viewer {
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
}

.btn-close-viewer:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 168, 46, 0.3);
}

.btn-close-viewer:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-close-viewer svg {
  width: 16px;
  height: 16px;
}

/* Circular Upload Container */
.circular-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.circular-dropzone {
  position: relative;
  width: 280px;
  height: 280px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-dropzone:hover {
  transform: scale(1.05);
}

.circular-dropzone.dragging {
  transform: scale(1.08);
}

.circular-dropzone.uploading {
  cursor: not-allowed;
}

.circular-dropzone.error .dropzone-content {
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* Circular Progress Ring */
.circular-progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 8;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 754;
  stroke-dashoffset: 754;
  transition: stroke-dashoffset 0.3s ease;
}

.circular-dropzone.uploading .progress-ring-fill {
  stroke: var(--primary);
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Dropzone Content */
.dropzone-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 200px;
  pointer-events: none;
}

.dropzone-content .upload-icon {
  width: 64px;
  height: 64px;
  stroke: var(--primary);
  margin: 0 auto 1rem;
  display: block;
  opacity: 0.8;
}

.dropzone-content .upload-text {
  font-size: 1.1rem;
  font-family: 'n27medium', sans-serif;
  color: var(--gray-900);
  margin: 0 0 0.5rem;
}

.dropzone-content .upload-subtext {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0 0 0.75rem;
}

.dropzone-content .upload-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  display: block;
}

.dropzone-content .selected-file-name {
  font-size: 0.875rem;
  font-family: 'n27medium', sans-serif;
  color: var(--primary);
  margin-top: 1rem;
  word-break: break-word;
  max-width: 180px;
  line-height: 1.4;
}

/* Upload Button */
.btn-upload-circular {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: var(--color-primary-text);
  border: 2px solid var(--primary);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-family: 'n27medium', sans-serif;
  font-weight: normal;
  cursor: pointer;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out;
  text-decoration: none;
}

.btn-upload-circular:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--color-primary-text);
}

.btn-upload-circular:active {
  background: var(--color-primary-active);
  border-color: var(--color-primary-active);
  color: var(--color-primary-text);
}

.empty-state svg {
  opacity: 0.5;
  margin-bottom: 1rem;
  stroke-width: 1.5;
}

.empty-state p {
  font-size: 1.1rem;
  font-family: 'n27medium', sans-serif;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

.empty-state small {
  font-size: 0.9rem;
  color: var(--gray-600);
}

/* ========================================
   VIEWER VIEW
   ======================================== */

.viewer-container-full {
  width: 100%;
}

.viewer-main-full {
  width: 100%;
  padding: 32px;
}

.viewer-header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: 'n27medium', sans-serif;
  font-size: 0.95rem;
  font-weight: normal;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out;
  width: fit-content;
}

.btn-back:hover {
  background: rgba(211, 129, 63, 0.18);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-back svg {
  stroke-width: 2;
}

.document-info {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.document-info h2 {
  font-size: 1.5rem;
  font-family: 'n27bold', sans-serif;
  color: #1a1410;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.doc-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.meta-separator {
  color: var(--gray-400);
}

/* ========================================
   STATUS CARDS
   ======================================== */

.status-card {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 2.5rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: var(--shadow);
}

.status-icon-wrapper {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.status-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing-icon {
  background: rgba(211, 129, 63, 0.15);
  color: var(--primary);
  animation: rotate 2s linear infinite;
}

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

.success-icon {
  background: rgba(211, 129, 63, 0.15);
  color: var(--primary);
  animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.error-icon {
  background: rgba(255, 68, 68, 0.15);
  color: #cc0000;
}

.status-icon svg {
  stroke-width: 2;
}

.status-card h3 {
  font-size: 1.5rem;
  font-family: 'n27bold', sans-serif;
  color: #1a1410;
  margin-bottom: 1.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
  box-shadow: 0 0 10px rgba(199, 255, 0, 0.5);
}

.status-message {
  font-size: 0.95rem;
  color: var(--gray-600);
  margin-top: 1rem;
}

.error-message {
  font-size: 1rem;
  font-family: 'n27regular', sans-serif;
  color: #cc0000;
  margin-bottom: 1.5rem;
}

/* ========================================
   RESULTS CONTAINER (NEW LAYOUT)
   ======================================== */

.results-container {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 32px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: var(--shadow-lg);
}

.success-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

/* Combined Success Header with Document Info */
.success-header-combined {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

.success-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.document-info-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.document-info-inline h2 {
  font-size: 1.25rem;
  font-family: 'n27bold', sans-serif;
  color: #1a1410;
  margin: 0;
  font-weight: normal;
}

.document-info-inline .doc-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.document-info-inline .meta-separator {
  color: var(--gray-400);
}

.success-icon-inline {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(211, 129, 63, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.success-icon-inline svg {
  stroke-width: 2;
}

.success-header h3,
.success-status h3 {
  font-size: 1.5rem;
  font-family: 'n27bold', sans-serif;
  color: #1a1410;
  margin: 0;
}

/* Side-by-Side Card Grid */
.content-grid-cards {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-bottom: 2rem;
}

/* New Document Viewer Layout */
.document-viewer-layout {
  display: flex;
  gap: 24px;
  margin-bottom: 2rem;
  position: relative;
}

.document-preview-main {
  flex: 1;
  transition: all 0.3s ease;
}

.extracted-text-panel {
  width: 400px;
  flex-shrink: 0;
  transform: translateX(0);
  transition: all 0.3s ease;
  display: flex; /* Show when visible */
}

.extracted-text-panel.hidden {
  display: none; /* Hide when hidden class is applied */
}

.content-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  height: calc(100vh - 320px); /* Full viewport height minus header/footer/margins */
  min-height: 900px; /* Minimum height fallback */
}

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

.card-header {
  background: #faf9f6;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h4 {
  font-size: 1rem;
  font-family: 'n27medium', sans-serif;
  color: var(--primary);
  margin: 0;
  font-weight: normal;
}

.btn-copy-header {
  background: transparent;
  border: 1px solid var(--gray-200);
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--gray-600);
}

.btn-copy-header:hover {
  background: rgba(199, 255, 0, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-copy-header svg {
  display: block;
}

.btn-copy-header.copied {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--color-primary-text);
}

.btn-copy-header.copied svg {
  stroke: var(--color-primary-text);
}

.btn-toggle-text {
  background: var(--primary);
  color: var(--color-primary-text);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'n27medium', sans-serif;
  font-weight: normal;
  transition: background-color 200ms ease-out;
}

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

.btn-toggle-text svg {
  display: block;
}

.btn-close-panel {
  background: transparent;
  border: 1px solid var(--gray-200);
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--gray-600);
}

.btn-close-panel:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-close-panel svg {
  display: block;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preview-toggle {
  display: flex;
  gap: 0.5rem;
  background: #faf9f6;
  padding: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(174, 170, 151, 0.3);
}

.toggle-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-family: 'n27medium', sans-serif;
  font-size: 0.875rem;
  font-weight: normal;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.toggle-btn:hover {
  color: var(--gray-900);
  background: rgba(211, 129, 63, 0.1);
}

.toggle-btn.active {
  background: var(--primary);
  color: var(--color-primary-text);
  box-shadow: 0 2px 4px rgba(58, 42, 40, 0.12);
}

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

/* Version Selector */

/* ========================================
   OLD EDIT MODE STYLES REMOVED
   ======================================== */
/* Google Docs flow: Documents are immediately editable,
   no Edit button or edit mode UI needed */


/* ========================================
   TEXT PREVIEW
   ======================================== */

.text-preview-content {
  background: #faf9f6;
  border: 1px solid rgba(174, 170, 151, 0.3);
  border-radius: 0.5rem;
  padding: 1.5rem;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'n27regular', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1a1410;
  white-space: pre-wrap;
  word-break: break-word;
}

.text-preview-content::-webkit-scrollbar {
  width: 8px;
}

.text-preview-content::-webkit-scrollbar-track {
  background: var(--gray-50);
  border-radius: 4px;
}

.text-preview-content::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

.text-preview-content::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.text-loading {
  color: var(--gray-600);
  font-style: italic;
  text-align: center;
}

/* ========================================
   DOCUMENT PREVIEW (A4 PAGE STYLING)
   ======================================== */

.preview-container-card {
  background: #d4cfc0;
  padding: 2rem;
  height: 100%;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* A4 sizing for UNTXT HTML preview only */
.preview-container-card iframe#untxtPreview {
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  width: 21cm !important;  /* A4 width */
  height: 29.7cm !important;  /* A4 height */
  min-height: 29.7cm !important;
  margin: 0 auto;
  border: none !important;
  display: block !important;
}

/* Original PDF preview - match UNTXT A4 dimensions */
.preview-container-card iframe#originalPreview {
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  width: 21cm !important;  /* A4 width - match UNTXT */
  height: 29.7cm !important;  /* A4 height - match UNTXT */
  min-height: 29.7cm !important;
  margin: 0 auto;
  border: none !important;
  display: block !important;
}

/* ========================================
   PDF VIEWER (HIPAA-Compliant In-Memory Cache)
   ======================================== */

.pdf-viewer {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.pdf-loading-state,
.pdf-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 100%;
  min-height: 600px;
  color: var(--text-secondary);
}

.pdf-loading-state .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.pdf-loading-state p {
  font-size: 1rem;
  font-weight: 500;
}

.pdf-error-state svg {
  stroke: var(--error);
  opacity: 0.7;
}

.pdf-error-state .error-message {
  font-size: 1rem;
  font-weight: 500;
  color: var(--error);
  text-align: center;
  max-width: 400px;
}

.pdf-error-state .btn-retry {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--color-primary-text);
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pdf-error-state .btn-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(199, 255, 0, 0.4);
}

/* ========================================
   BUTTONS
   ======================================== */

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-family: 'n27medium', sans-serif;
  font-size: 0.95rem;
  font-weight: normal;
  cursor: pointer;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--color-primary-text);
  border: 2px solid var(--primary);
}

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

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

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 2px solid var(--btn-secondary-border);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Pseudo-element for mask/wipe effect */
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  background-color: var(--btn-secondary-bg-hover);
  transition: width 300ms cubic-bezier(0.2, 0, 0.2, 1);
  z-index: -1;
}

.btn-secondary:hover {
  border-color: var(--btn-secondary-border-hover);
  color: var(--btn-secondary-fg-hover);
}

.btn-secondary:hover::before {
  width: 100%;
}

.btn-secondary:active {
  background-color: var(--btn-secondary-bg-active);
  border-color: var(--btn-secondary-border-active);
  color: var(--btn-secondary-fg-active);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 2px solid var(--error);
}

.btn-danger:hover {
  border-color: #cc0000;
  color: #cc0000;
}

.btn-danger:active {
  background: var(--error);
  color: #ffffff;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary svg,
.btn-secondary svg,
.btn-danger svg {
  stroke-width: 2;
}

/* ========================================
   WEBSOCKET INDICATOR
   ======================================== */

.ws-indicator {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-100);
  padding: 0.75rem 1rem;
  border-radius: 2rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.ws-indicator:hover {
  box-shadow: var(--shadow-xl);
}

.ws-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-400);
  transition: all 0.3s;
}

.ws-dot.connected {
  background: var(--success);
  animation: pulse 2s infinite;
  box-shadow: 0 0 10px rgba(199, 255, 0, 0.6);
}

.ws-dot.disconnected {
  background: var(--warning);
}

.ws-tooltip {
  font-size: 0.875rem;
  color: var(--gray-700);
  font-weight: 500;
  display: none;
}

.ws-indicator:hover .ws-tooltip {
  display: block;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
  .content-grid-cards {
    grid-template-columns: 1fr;
  }

  .document-viewer-layout {
    flex-direction: column;
  }

  .extracted-text-panel {
    width: 100%;
  }

  .viewer-main-full {
    padding: 24px;
  }

  .results-container {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 1rem;
  }

  .app-main {
    padding: 1rem;
  }

  .viewer-main-full {
    padding: 16px;
  }

  .upload-section-centered h1 {
    font-size: 2rem;
  }

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

  .stats-inline {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .content-grid-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .success-header-combined {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .document-info-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .result-stats-inline {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger {
    width: 100%;
    justify-content: center;
  }

  .viewer-main {
    padding: 1.5rem;
  }

  .results-container {
    padding: 16px;
  }

  .card-body {
    padding: 16px;
  }

  .bottom-section {
    gap: 16px;
    padding-top: 16px;
  }

  .preview-container-card,
  .text-preview-content {
    height: 500px;
    min-height: 400px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .card-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: space-between;
  }

  .preview-toggle {
    width: 100%;
  }

  .toggle-btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .upload-section-centered h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .upload-dropzone,
  .empty-state-upload-dropzone {
    padding: 3rem 1.5rem;
  }

  .section-header-inline {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================
   SAVE INDICATOR (Google Docs Flow)
   ======================================== */

.save-indicator {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  background: transparent;
  transition: all 0.3s;
  opacity: 0;
  visibility: hidden;
}

.save-indicator:not(:empty) {
  opacity: 1;
  visibility: visible;
}

.save-indicator.saving {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.save-indicator.saved {
  background: rgba(199, 255, 0, 0.2);
  color: var(--primary);
  border: 1px solid rgba(199, 255, 0, 0.3);
}

.save-indicator.error {
  background: rgba(255, 68, 68, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(255, 68, 68, 0.3);
}

/* ========================================
   FOLDERS SIDEBAR
   ======================================== */

.folders-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid rgba(174, 170, 151, 0.4);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 73px;
  height: calc(100vh - 73px);
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Full width for files tab */
#uploadTabContent .main-content,
#uploadTabContent {
  max-width: none;
  margin: 0;
}

.folders-header {
  padding: 1.5rem 1rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gray-200);
}

.folders-header-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.folders-header h3 {
  font-size: 0.875rem;
  font-family: 'n27medium', sans-serif;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-700);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-back-folders {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.btn-back-folders:hover {
  background: var(--gray-200);
  color: var(--primary);
}

.btn-new-folder {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.btn-new-folder:hover {
  background: var(--gray-200);
  color: var(--primary);
}

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

.folder-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-900);
  position: relative;
  margin-bottom: 0.25rem;
}

.folder-item:hover {
  background: var(--gray-200);
}

.folder-item.active {
  background: var(--gray-200);
  color: var(--primary);
}

.folder-item svg {
  flex-shrink: 0;
  stroke: currentColor;
}

.folder-name {
  flex: 1;
  font-size: 0.925rem;
  font-family: 'n27medium', sans-serif;
  font-weight: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-count {
  font-size: 0.75rem;
  background: var(--gray-300);
  color: var(--gray-700);
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  margin-right: 0.25rem;
}

.folder-item.active .folder-count {
  background: var(--primary);
  color: var(--gray-50);
}

.document-item {
  cursor: pointer;
}

.document-item .folder-name {
  font-weight: 400;
  font-size: 0.875rem;
}

.empty-state-small {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--gray-600);
  font-size: 0.875rem;
}

/* Three-dot menu button */
.folder-menu-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  opacity: 0;
  flex-shrink: 0;
}

.folder-item:hover .folder-menu-btn {
  opacity: 1;
}

.folder-menu-btn:hover {
  background: var(--gray-300);
  color: var(--gray-900);
}

/* Dropdown menu */
.folder-menu {
  display: none;
  position: absolute;
  right: 0.5rem;
  top: 100%;
  margin-top: 0.25rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 1000;
  overflow: hidden;
}

.folder-menu.show {
  display: block;
}

.folder-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: #1a1a1a;
  font-weight: 500;
  transition: background 0.15s;
  text-align: left;
}

.folder-menu-item:hover {
  background: #f5f5f5;
}

.folder-menu-item:active {
  background: #e5e5e5;
}

.folder-menu-item svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.folder-menu-item.delete-folder {
  color: #dc2626;
}

.folder-menu-item.delete-folder:hover {
  background: rgba(220, 38, 38, 0.1);
}

.btn-icon {
  width: 28px;
  height: 28px;
  background: var(--gray-100);
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.btn-icon:hover {
  background: var(--gray-300);
  color: var(--primary);
}

/* Main content area */
.main-content {
  min-width: 0;
}

/* Drag and drop styling */
.folder-item.drag-over {
  background: var(--gray-300);
  border: 2px dashed var(--primary);
}

.document-card.dragging {
  opacity: 0.5;
}

/* ========================================
   FOLDER MODAL
   ======================================== */

.modal-small {
  max-width: 480px;
}

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

.folder-name-error {
  color: #ef4444;
  font-family: var(--font-family-base, sans-serif);
  font-size: 13px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.25s ease, max-height 0.25s ease, margin-top 0.25s ease;
  margin-top: 0;
}

.folder-name-error.visible {
  opacity: 1;
  max-height: 40px;
  margin-top: 8px;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: 'n27medium', sans-serif;
  font-weight: normal;
  color: #1a1410;
  font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: #faf9f6;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  color: #1a1410;
  font-size: 0.95rem;
  font-family: 'n27regular', sans-serif;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(211, 129, 63, 0.15);
}

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

.color-picker {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.color-picker input[type="color"] {
  width: 60px;
  height: 40px;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  cursor: pointer;
  background: var(--gray-50);
}

.color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.color-picker input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 0.25rem;
}

.color-label {
  font-size: 0.875rem;
  color: var(--gray-700);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

/* ========================================
   CREDITS SYSTEM
   ======================================== */

/* Credits Widget in Header */
.credits-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #faf9f6;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  cursor: default;
}

.credits-widget:hover {
  border-color: var(--primary);
}

.credits-widget svg {
  color: var(--primary);
  flex-shrink: 0;
}

.credits-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.credits-label {
  font-size: 0.75rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.credits-balance {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.credits-balance.low {
  color: var(--warning);
  animation: pulse 2s ease-in-out infinite;
}

.credits-balance.empty {
  color: var(--error);
}

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

.btn-buy-credits {
  background: var(--primary);
  color: var(--color-primary-text);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-family: 'n27bold', sans-serif;
  font-weight: normal;
  cursor: pointer;
  transition: background-color 200ms ease-out, transform 200ms ease-out;
}

.btn-buy-credits:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.btn-buy-credits:active {
  transform: scale(0.95);
}

/* Purchase Credits Modal */
.modal-credits .modal-content {
  max-width: 800px;
  width: 90vw;
}

.credits-packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.package-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--gray-600);
}

.credit-package {
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.credit-package:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.credit-package.selected {
  border-color: var(--primary);
  background: #faf9f6;
}

.credit-package.popular {
  border-color: var(--primary);
}

.credit-package.popular::before {
  content: 'POPULAR';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--primary);
  color: #000;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.package-name {
  font-size: 1rem;
  font-family: 'n27medium', sans-serif;
  font-weight: normal;
  color: #1a1410;
  margin-bottom: 0.5rem;
}

.package-credits {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.5rem 0;
}

.package-credits-label {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.package-price {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0.75rem 0 0.5rem;
}

.package-savings {
  font-size: 0.875rem;
  color: var(--success);
  font-weight: 500;
}

.package-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 0.75rem;
  line-height: 1.4;
}

.btn-select-package {
  width: 100%;
  background: var(--primary);
  color: var(--color-primary-text);
  border: 2px solid var(--primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: 'n27medium', sans-serif;
  font-weight: normal;
  font-size: 0.875rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: background-color 200ms ease-out, border-color 200ms ease-out;
}

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

.btn-select-package:active {
  background: #9d5726;
  border-color: #9d5726;
}

.btn-select-package.loading {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.purchase-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-300);
}

.purchase-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.purchase-note svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Test Mode Indicator */
.test-mode-badge {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--warning);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

/* Insufficient Credits Warning */
.insufficient-credits-alert {
  background: var(--error);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.insufficient-credits-alert svg {
  flex-shrink: 0;
}

.insufficient-credits-alert p {
  margin: 0;
  font-size: 0.875rem;
}

.insufficient-credits-alert button {
  margin-left: auto;
  background: white;
  color: var(--error);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .credits-widget {
    padding: 0.375rem 0.75rem;
    gap: 0.5rem;
  }
  
  .credits-label {
    font-size: 0.625rem;
  }
  
  .credits-balance {
    font-size: 1rem;
  }
  
  .credits-packages {
    grid-template-columns: 1fr;
  }
  
  .modal-credits .modal-content {
    width: 95vw;
  }
}

/* Notification animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ========================================
   FORMAT SELECTION MODAL
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.show,
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay .modal-content {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}

.modal-overlay.show .modal-content,
.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-title {
  font-family: 'n27bold', sans-serif;
  font-size: 1.5rem;
  color: rgba(0, 0, 0, 0.9);
  margin: 0 0 1.5rem 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.modal-subtitle {
  font-family: 'n27regular', sans-serif;
  font-size: 0.9375rem;
  color: rgba(0, 0, 0, 0.6);
  margin: 0 0 1.5rem 0;
}

.format-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.format-option {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 150ms ease-out;
  user-select: none;
}

.format-option:hover {
  border-color: var(--primary);
  background-color: rgba(123, 168, 46, 0.05);
}

.format-option:has(.format-modal-checkbox:checked) {
  border-color: var(--primary);
  background-color: rgba(123, 168, 46, 0.1);
}

.format-modal-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.format-option-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.format-option-icon {
  font-family: 'n27bold', sans-serif;
  font-size: 0.875rem;
  color: var(--primary);
}

.format-option-label {
  font-family: 'n27medium', sans-serif;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.9);
}

.format-option-description {
  font-family: 'n27regular', sans-serif;
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.6);
}

.format-option-warning {
  font-family: 'n27regular', sans-serif;
  font-size: 0.75rem;
  color: #f59e0b;
  margin-top: 0.25rem;
  display: block;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-save-default {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.modal-save-default span {
  font-family: 'n27regular', sans-serif;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.7);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.15);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(123, 168, 46, 0.2);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.btn-modal-cancel,
.btn-modal-confirm {
  padding: 0.625rem 1.5rem;
  border-radius: 999px;
  font-family: 'n27medium', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 150ms ease-out;
  border: 2px solid;
}

.btn-modal-cancel {
  background: transparent;
  color: rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.2);
}

.btn-modal-cancel:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
}

.btn-modal-confirm {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-modal-confirm:hover {
  background: rgba(123, 168, 46, 0.08);
  border-color: var(--primary-dark);
}

.btn-modal-confirm:active {
  background: rgba(123, 168, 46, 0.12);
}

/* Delete confirmation modal styling */
.modal-confirm {
  text-align: center;
  max-width: 560px !important;
}

.modal-confirm-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.modal-confirm-icon svg {
  color: #ef4444;
  opacity: 0.9;
}

.modal-confirm-message {
  color: #6b7280;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 1rem 0 1.5rem 0;
}

.btn-modal-danger {
  padding: 0.625rem 1.5rem;
  border-radius: 999px;
  font-family: 'n27medium', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  border: 2px solid #ef4444;
  background: transparent;
  color: #ef4444;
  transition: all 0.2s ease;
}

.btn-modal-danger:hover {
  background: rgba(239, 68, 68, 0.06);
  border-color: #ef4444;
}

.btn-modal-danger:active {
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================
   INLINE VIEWER
   ========================================== */

.files-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'n27regular', sans-serif;
  z-index: 1;
  table-layout: fixed;
}

.file-row {
  position: relative;
  background: white;
}

.file-row-clickable {
  cursor: pointer;
}

.file-row-clickable:hover {
  background: rgba(0, 0, 0, 0.08);
}

.file-row-loading {
  pointer-events: none;
  opacity: 0.6;
}

.file-row-loading .file-name-text::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary, #7ba82e);
  border-radius: 50%;
  animation: row-spin 0.7s linear infinite;
  vertical-align: middle;
}

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

.file-row.has-drawer-open::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0));
  pointer-events: none;
  z-index: 10;
}

.inline-viewer-row {
  background: rgba(123, 168, 46, 0.08);
}

.inline-viewer-row td {
  padding: 0 !important;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.6s cubic-bezier(0.8, 0, 0.2, 1);
}

.inline-viewer-row:not(.closing) td {
  max-height: 2000px;
}

.inline-viewer-row.closing td {
  max-height: 0;
  transition: max-height 0.5s cubic-bezier(0.8, 0, 0.2, 1);
}

.inline-viewer-slide-wrapper {
  /* No animation - just let it reveal naturally */
}

.inline-viewer {
  padding: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.inline-viewer-header {
  margin-bottom: 1.5rem;
}

.inline-viewer-title {
  font-family: 'n27bold', sans-serif;
  font-size: 1.125rem;
  color: rgba(0, 0, 0, 0.9);
  margin: 0;
}

.inline-viewer-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.inline-viewer-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'n27medium', sans-serif;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  bottom: -1px;
}

.inline-viewer-tab:hover {
  color: rgba(0, 0, 0, 0.9);
}

.inline-viewer-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.inline-viewer-download-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(123, 168, 46, 0.05);
  border-radius: 6px;
  align-items: center;
}

.btn-download-format,
.btn-download-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 0.375rem;
  font-family: 'n27regular', sans-serif;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: visible;
  z-index: auto;
}

/* Reset any inherited pseudo-elements */
.btn-download-format::before,
.btn-download-all::before {
  display: none !important;
}

.btn-download-format:hover,
.btn-download-all:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 168, 46, 0.3);
}

.btn-download-format:active,
.btn-download-all:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-download-all {
  margin-left: auto;
  font-family: 'n27medium', sans-serif;
}

.btn-download-format svg,
.btn-download-all svg {
  flex-shrink: 0;
}

.inline-viewer-content-wrapper {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 2rem;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.inline-viewer-content-wrapper.has-json-sidebar {
  flex-direction: row;
  gap: 0;
  padding: 0;
}

.inline-viewer-content {
  font-family: 'n27regular', sans-serif;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.8);
  line-height: 1.6;
  flex: 1;
}

.inline-viewer-content-wrapper.has-json-sidebar .inline-viewer-content {
  padding: 2rem;
  overflow-x: auto;
}

.inline-viewer-content.format-html {
  /* HTML content rendered directly */
}

.inline-viewer-content.format-txt {
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
}

.inline-viewer-content.format-json {
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 1rem;
  border-radius: 4px;
}

/* JSON Field Selector Sidebar */
.json-field-selector {
  display: flex;
  flex-direction: column;
  width: 240px;
  min-width: 240px;
  background: rgba(123, 168, 46, 0.04);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px 0 0 8px;
  overflow: hidden;
}

.json-selector-header {
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(123, 168, 46, 0.06);
  position: relative;
}

.json-preset-dropdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.75);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 200ms, color 200ms;
  font-family: 'n27regular', sans-serif;
}

.json-preset-dropdown:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 1);
}

.json-preset-text {
  flex: 1;
  text-align: left;
}

.json-preset-chevron {
  flex-shrink: 0;
  color: rgba(0, 0, 0, 0.75);
  transition: transform 200ms;
}

.json-preset-dropdown.open .json-preset-chevron {
  transform: rotate(180deg);
}

.json-preset-menu {
  position: absolute;
  top: 100%;
  left: 12px;
  right: 12px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.json-preset-item {
  padding: 8px 12px;
  font-family: 'n27regular', sans-serif;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: background 150ms;
}

.json-preset-item:hover {
  background: rgba(123, 168, 46, 0.08);
}

.json-preset-separator {
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 4px 0;
}

.json-field-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.json-field-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'n27regular', sans-serif;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.8);
}

.json-field-item:hover {
  background: rgba(123, 168, 46, 0.1);
}

.json-field-item input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.json-field-item span {
  word-break: break-word;
}

.json-selector-actions {
  padding: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(123, 168, 46, 0.06);
}

.json-preset-name {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-family: 'n27regular', sans-serif;
  font-size: 0.8125rem;
}

.btn-save-preset {
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: 'n27medium', sans-serif;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.2s;
}

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

/* ==========================================
   DRAG AND DROP ENHANCEMENTS
   ========================================== */

.document-card[draggable="true"] {
  cursor: move;
  user-select: none;
}

.document-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  transition: opacity 0.2s, transform 0.2s;
}

.folder-item.drag-over {
  background: rgba(199, 255, 0, 0.15);
  border-left: 3px solid var(--primary);
  padding-left: calc(0.75rem - 3px);
  transition: all 0.2s;
}

.folder-item {
  transition: background 0.2s, border-left 0.2s;
}

/* ==========================================
   EMAIL VERIFICATION BANNER
   ========================================== */

.email-verify-banner {
  position: fixed;
  top: 12px;
  left: calc(260px + (100% - 260px) / 2);
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 24px;
  background: #FEF3C7;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-family: var(--font-family-medium, sans-serif);
  font-size: 0.8125rem;
  color: #92400E;
  white-space: nowrap;
  transition: left 0.3s ease;
}

.sidebar-collapsed .email-verify-banner {
  left: calc(90px + (100% - 90px) / 2);
}

@media (max-width: 1024px) {
  .email-verify-banner {
    left: 50% !important;
  }
}

.email-verify-text {
  flex-shrink: 1;
}

.email-verify-resend {
  background: none;
  border: none;
  color: #92400E;
  font-family: var(--font-family-medium, sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.email-verify-resend:hover {
  color: #78350F;
}

.email-verify-dismiss {
  background: none;
  border: none;
  color: #92400E;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
}

.email-verify-dismiss:hover {
  opacity: 1;
}


/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

#toast-container {
  position: fixed;
  top: 24px;
  right: 2rem;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--gray-900, #1f2937);
  color: #fff;
  font-family: var(--font-family-medium, sans-serif);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 360px;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3), 0 4px 12px rgba(16, 185, 129, 0.2);
}

.toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3), 0 4px 12px rgba(239, 68, 68, 0.2);
}

.toast-info {
  background: var(--primary, #c7ff00);
  color: var(--gray-900, #111827);
  box-shadow: 0 10px 25px rgba(199, 255, 0, 0.3), 0 4px 12px rgba(199, 255, 0, 0.2);
}

@media (max-width: 640px) {
  #toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
  }
}

/* ==========================================
   FOLDER MENU IMPROVEMENTS
   ========================================== */

.folder-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-700, #374151);
  transition: background 0.2s;
  border-radius: 4px;
}

.folder-menu-item:hover {
  background: var(--gray-50, #f9fafb);
}

.folder-menu-item.delete {
  color: #ef4444;
}

.folder-menu-item.delete:hover {
  background: #fef2f2;
}

.folder-menu-item svg {
  flex-shrink: 0;
}

/* ==========================================
   MAIN DOCUMENT VIEWER (TAB-BASED)
   Uses same styling as inline-viewer
   ========================================== */

.main-document-viewer {
  background: rgba(123, 168, 46, 0.08);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.viewer-document-header {
  margin-bottom: 1.5rem;
}

.viewer-document-title {
  font-family: 'n27bold', sans-serif;
  font-size: 1.125rem;
  color: rgba(0, 0, 0, 0.9);
  margin: 0;
}

/* ============================================
   UPLOAD BANNER (no folder selected)
   ============================================ */
.upload-banner {
  position: fixed;
  top: 24px;
  right: 2rem;
  transform: translateY(-8px);
  background: var(--color-error, #d44);
  color: #fff;
  font-family: var(--font-family-medium, sans-serif);
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.upload-banner.visible {
  opacity: 1;
  transform: translateY(0);
}
