/* taskpane.css - Professional, Responsive Design for Word Add-in Taskpane */

/* === ROOT LAYOUT === */
.taskpane-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f8f9fa;
  border-left: 1px solid #e0e0e0;
  overflow: hidden;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
}

/* === GLOBAL STATUS & LOADING === */
.status-message {
  margin: 0 16px 16px;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 14px;
  animation: slideIn 0.3s ease-out;
  position: relative;
  z-index: 10;
}

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

.status-info {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #90caf9;
}
.status-success {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #81c784;
}
.status-error {
  background: #ffebee;
  color: #c62828;
  border-color: #ef5350;
}

.loading-indicator {
  margin: 0 16px 16px;
  text-align: center;
  color: #1976d2;
  padding: 12px;
  background: #e3f2fd;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

/* === THUMBNAILS & CONTENT LAYOUT === */
.thumbnails-and-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.page-thumbnails-container {
  width: 192px;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  border-right: 1px solid #cbd5e1;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 12px;
  box-shadow: inset -2px 0 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-thumbnails-container.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
  transition: margin-left 0.3s ease;
}

/* === THUMBNAILS HEADER === */
.thumbnails-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #cbd5e1;
}

.thumbnails-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

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

.thumbnails-count {
  font-size: 11px;
  background: #ffffff;
  color: #475569;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
}

.toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #475569;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #1e293b;
}

/* === THUMBNAILS LIST === */
.thumbnails-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);
}

.page-thumbnail:hover {
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.16),
    0 2px 4px rgba(0, 0, 0, 0.23);
  transform: translateY(-1px);
}

.page-thumbnail.selected {
  border: 2px solid #3b82f6;
  box-shadow:
    0 4px 12px rgba(59, 130, 246, 0.3),
    0 0 0 1px rgba(59, 130, 246, 0.1);
  transform: scale(1.02);
}

.page-thumbnail.selected::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.08) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 1;
}

.page-thumbnail:not(.selected) {
  border: 1px solid #e2e8f0;
}
.page-thumbnail:not(.selected):hover {
  border-color: #3b82f6;
}

/* Preview */
.thumbnail-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  color: #64748b;
  background: #ffffff;
  transform: scale(0.15);
  transform-origin: top left;
  width: 667%;
  height: 667%;
  pointer-events: none;
  overflow: hidden;
}

.thumbnail-preview-content {
  font-size: 12px;
  line-height: 1.4;
  padding: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 100%;
  word-break: break-word;
}

/* Page Number */
.thumbnail-page-number {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  min-width: 24px;
  text-align: center;
}

.page-thumbnail:hover .thumbnail-page-number {
  background: #3b82f6;
  transform: scale(1.05);
}

.page-thumbnail.selected .thumbnail-page-number {
  background: #3b82f6;
}

/* Selection Bar */
.page-thumbnail.selected::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  z-index: 2;
}

/* Overlay */
.thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.page-thumbnail:hover .thumbnail-overlay {
  opacity: 1;
}

/* Loading */
.thumbnails-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thumbnails-loading-text {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  margin-bottom: 8px;
}

.thumbnail-skeleton {
  width: 100%;
  aspect-ratio: 210/297;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Empty State */
.thumbnails-empty {
  color: #94a3b8;
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
  line-height: 1.5;
}

/* Scrollbar */
.page-thumbnails-container::-webkit-scrollbar {
  width: 6px;
}
.page-thumbnails-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}
.page-thumbnails-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.page-thumbnails-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* === MAIN CONTENT SECTIONS === */
.insert-section,
.placeholder-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.search-section {
  margin-bottom: 16px;
}

.auto-detect-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin: 20px 0;
}

.nav-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  margin-top: 20px;
}

/* Typography */
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 13px;
  color: #475569;
}

/* Inputs */
.text-input,
.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  margin-bottom: 12px;
  font-size: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}

.text-input:focus,
.search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.text-input:disabled,
.search-input:disabled {
  background: #f8fafc;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Checkbox */
.checkbox-wrapper {
  margin-top: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #475569;
  user-select: none;
}

.checkbox {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #3b82f6;
}

/* Buttons */
.button-group-row {
  display: flex;
  gap: 8px;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.insert-button,
.highlight-button,
.convert-button,
.clear-button,
.primary-button {
  padding: 10px 16px;
  color: white;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.insert-button {
  background: #10b981;
}
.insert-button:hover:not(:disabled) {
  background: #059669;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.highlight-button {
  background: #f59e0b;
}
.highlight-button:hover:not(:disabled) {
  background: #d97706;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.convert-button {
  background: #3b82f6;
}
.convert-button:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.clear-button {
  background: #ef4444;
}
.clear-button:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.primary-button {
  padding: 10px 24px;
  background: #1e40af;
  min-width: 100px;
}
.primary-button:hover:not(:disabled) {
  background: #1e3a8a;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.3);
}

.insert-button:disabled,
.highlight-button:disabled,
.convert-button:disabled,
.clear-button:disabled,
.primary-button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

/* === PLACEHOLDERS SECTION === */
.placeholders-display-section {
  margin: 20px 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.3s ease-out;
}

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

.placeholders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.close-placeholders-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #64748b;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-placeholders-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.placeholders-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.placeholders-container::-webkit-scrollbar {
  width: 6px;
}
.placeholders-container::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 3px;
}
.placeholders-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.placeholders-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* No Placeholders */
.no-placeholders {
  text-align: center;
  padding: 32px 16px;
  color: #64748b;
}

.no-placeholders-text {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}
.no-placeholders-hint {
  font-size: 12px;
  color: #94a3b8;
}

/* Placeholders List */
.placeholders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Placeholder Card */
.placeholder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  transition: all 0.2s;
}

.placeholder-card:hover {
  border-color: #fbbf24;
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.15);
}

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

.placeholder-name {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 4px;
  word-wrap: break-word;
}

.placeholder-syntax {
  font-size: 12px;
  color: #b45309;
  font-family: "Courier New", monospace;
  margin-bottom: 8px;
}

/* Navigation */
.placeholder-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.nav-btn {
  padding: 4px;
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #92400e;
  width: 24px;
  height: 24px;
}

.nav-btn:hover:not(:disabled) {
  background: #fef3c7;
  border-color: #fbbf24;
}

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

.nav-counter {
  font-size: 11px;
  color: #78716c;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}

/* Actions */
.placeholder-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}

.action-btn {
  padding: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #475569;
  width: 28px;
  height: 28px;
}

.view-btn:hover {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}

.delete-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

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

/* Tablet */
@media (max-width: 768px) {
  .page-thumbnails-container {
    width: 140px;
    padding: 8px;
  }
  .thumbnails-title {
    font-size: 12px;
  }
  .thumbnails-count {
    font-size: 10px;
    padding: 2px 6px;
  }
  .thumbnail-page-number {
    font-size: 10px;
    padding: 3px 6px;
    bottom: 6px;
    right: 6px;
  }
  .thumbnail-preview {
    transform: scale(0.12);
    width: 833%;
    height: 833%;
  }
  .main-content {
    padding: 12px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .thumbnails-and-content {
    flex-direction: column;
    height: auto;
  }
  .page-thumbnails-container {
    width: 100%;
    height: auto;
    max-height: 40vh;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid #cbd5e1;
  }
  .page-thumbnails-container.collapsed {
    height: 0;
    padding: 0;
    max-height: 0;
  }
  .thumbnails-list {
    gap: 6px;
  }
  .page-thumbnail {
    aspect-ratio: 16/9;
  }
  .thumbnail-preview {
    transform: scale(0.1);
    width: 1000%;
    height: 1000%;
  }
  .main-content {
    height: calc(60vh);
    padding: 8px;
  }
  .section-title {
    font-size: 15px;
  }
  .text-input,
  .search-input {
    font-size: 13px;
    padding: 8px 10px;
  }
  .insert-button,
  .highlight-button,
  .convert-button,
  .clear-button,
  .primary-button {
    padding: 9px 14px;
    font-size: 13px;
  }
  .placeholder-card {
    padding: 12px;
  }
  .placeholder-name {
    font-size: 13px;
  }
  .action-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .primary-button {
    flex: 1;
    min-width: 80px;
  }
}

/* Small Mobile */
@media (max-width: 320px) {
  .page-thumbnails-container {
    max-height: 30vh;
    padding: 6px;
  }
  .thumbnail-preview-content {
    font-size: 10px;
    padding: 10px;
  }
  .main-content {
    padding: 4px;
  }
}

/* === ACCESSIBILITY & ANIMATIONS === */
.page-thumbnail:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.page-thumbnail:active {
  transform: scale(0.98);
}
.toggle-btn:focus-visible,
button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

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

.page-thumbnail {
  animation: fadeInUp 0.3s ease-out backwards;
}
.page-thumbnail:nth-child(1) {
  animation-delay: 0.05s;
}
.page-thumbnail:nth-child(2) {
  animation-delay: 0.1s;
}
.page-thumbnail:nth-child(3) {
  animation-delay: 0.15s;
}
.page-thumbnail:nth-child(4) {
  animation-delay: 0.2s;
}
.page-thumbnail:nth-child(5) {
  animation-delay: 0.25s;
}
.page-thumbnail:nth-child(n + 6) {
  animation-delay: 0.3s;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .taskpane-layout {
    /* background: #0f172a; */
    /* color: #f1f5f9; */
  }
  .main-content {
    /* background: #0f172a; */
  }
  .page-thumbnails-container {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-right-color: #475569;
  }
  .thumbnails-title,
  .toggle-btn {
    color: #f1f5f9;
  }
  .thumbnails-count {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
  }
  .thumbnail-skeleton {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  }
  .status-info {
    background: #1e3a8a;
    color: #bfdbfe;
    border-color: #60a5fa;
  }
  /* Add more dark mode styles as needed */
}

/* Print */
@media print {
  .page-thumbnails-container {
    display: none;
  }
}
.primary-button {
  position: relative;
}

.btn-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: rgba(255, 255, 255, 1);
  border-radius: 50%;
  display: inline-block;
  animation: btn-spin 0.8s linear infinite;
}
.close-taskpane-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.close-taskpane-btn:hover {
  color: #000;
}
.close-taskpane-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
/* Panel container */
.placeholders-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background-color: #fffdf5;
  border: 1px solid #f6e3a8;
}

/* Title */
.placeholders-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #854d0e;
  margin-bottom: 0.75rem;
}

/* Empty state */
.placeholders-empty {
  font-size: 0.85rem;
  color: #6b7280;
}

.placeholders-empty-main {
  margin-bottom: 0.25rem;
}

.placeholders-empty-sub {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* List wrapper */
.placeholders-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Card */
.placeholder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background-color: #fffbeb;
  border: 1px solid #facc6b;
}

/* Left side of card */
.placeholder-card-main {
  flex: 1;
  min-width: 0;
}

/* Name row */
.placeholder-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.placeholder-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #854d0e;
}

/* Optional count badge if you re-enable it */
.placeholder-count-badge {
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background-color: #fef3c7;
  color: #854d0e;
}

/* Jinja syntax text */
.placeholder-jinja {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #92400e;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

/* Navigation (for multiple occurrences) */
.placeholder-nav {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.placeholder-nav-btn {
  border: none;
  background-color: transparent;
  padding: 0.2rem;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.placeholder-nav-btn:hover:not(:disabled) {
  background-color: #fef3c7;
}

.placeholder-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.placeholder-nav-index {
  font-size: 0.75rem;
  color: #4b5563;
}

/* Right side actions */
.placeholder-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.75rem;
}

.placeholder-action-btn {
  border: none;
  background-color: transparent;
  padding: 0.25rem;
  border-radius: 0.35rem;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.placeholder-action-btn:hover {
  background-color: #fef3c7;
}

.placeholder-action-delete {
  color: #dc2626;
}

.placeholder-action-delete:hover {
  background-color: #fee2e2;
}

/* Icon size */
.icon-xs {
  width: 12px;
  height: 12px;
}

.batches-section {
  margin: 20px 0;
}
.batches-panel {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dee2e6;
}
.refresh-btn {
  background: #0078d4;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}
.refresh-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}
.batch-card {
  background: white;
  border: 1px solid #ced4da;
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 12px;
}
.batch-card.completed {
  border-color: #28a745;
}
.case-id {
  font-weight: 600;
  color: #495057;
}
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
}
.status-completed {
  background: #d4edda;
  color: #155724;
}
.status-ready {
  background: #d1ecf1;
  color: #0c5460;
}
.documents-list {
  margin-top: 12px;
}
.document-item {
  padding: 10px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #fff;
}
.doc-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  background: #e7f3ff;
  border-radius: 4px;
}
.filename {
  font-family: monospace;
  font-size: 0.85em;
  color: #0d6efd;
  flex: 1;
}
.open-link-btn {
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.secure-btn {
  background: #dc3545;
  color: white;
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.all-failed-banner {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  font-weight: 600;
}

.retry-btn {
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  cursor: pointer;
}
.retry-btn:hover {
  background: #fee2e2;
}

.doc-error {
  margin-top: 6px;
  font-size: 12px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 6px 8px;
  border-radius: 6px;
}
/* Master Warning Card */
.master-warning-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  margin-top: 20px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  border: 2px solid #ffc107;
  border-radius: 8px;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
  animation: slideDown 0.3s ease-out;
}

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

.master-warning-card .warning-icon {
  font-size: 24px;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.master-warning-card .warning-content {
  flex: 1;
}

.master-warning-card .warning-content h4 {
  margin: 0 0 6px 0;
  color: #856404;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.master-warning-card .warning-content p {
  margin: 0;
  color: #856404;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .master-warning-card {
    flex-direction: column;
    gap: 8px;
  }

  .master-warning-card .warning-icon {
    font-size: 20px;
  }

  .master-warning-card .warning-content h4 {
    font-size: 15px;
  }

  .master-warning-card .warning-content p {
    font-size: 13px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .master-warning-card {
    background: linear-gradient(135deg, #664d03 0%, #523e02 100%);
    border-color: #ffc107;
  }

  .master-warning-card .warning-content h4,
  .master-warning-card .warning-content p {
    color: #ffecb5;
  }
}
.doc-status {
  /* padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent; */
}

/* Red when READY */
.doc-status.status-ready {
  background: rgba(220, 38, 38, 0.12);
  color: rgb(220, 38, 38);
  border-color: rgba(220, 38, 38, 0.35);
}

/* Yellow when DRAFT */
.doc-status.status-draft {
  background: rgba(234, 179, 8, 0.14);
  color: rgb(161, 98, 7);
  border-color: rgba(234, 179, 8, 0.45);
}

/* Green when COMPLETED */
.doc-status.status-completed {
  background: rgba(34, 197, 94, 0.14);
  color: rgb(22, 101, 52);
  border-color: rgba(34, 197, 94, 0.4);
}

.doc-status.status-default {
  background: rgba(148, 163, 184, 0.15);
  color: rgb(71, 85, 105);
  border-color: rgba(148, 163, 184, 0.35);
}
/* Form wrapper and container */
.form-wrapper {
  background-color: white;
  min-height: 100vh;
  padding: 1rem;
}

.form-container {
  width: 100%;
  max-width: 32rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.upload-form {
  padding: 1.5rem;
}

/* Form groups and labels */
.form-group {
  margin-bottom: 1rem;
  max-width: 36rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #374151;
  /* padding-left: 0.5rem; */
}

/* Inputs */
.form-input {
  width: 95%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #D8D8D8;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  ring: 2px solid #00426E;
  border-color: #00426E;
}

/* Select elements */
.select-wrapper {
  position: relative;
  width: 100%;
}

.form-select {
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  background-color: white;
  border: 1px solid #D8D8D8;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  appearance: none;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  ring: 2px solid #00426E;
  border-color: #00426E;
}

.select-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #6B7280;
}

/* Error states */
.input-error {
  border-color: #EF4444;
}

.input-error:focus {
  ring: 2px solid #EF4444;
}

.error-message {
  color: #EF4444;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  /* padding: 1.5rem; */
  max-width: 36rem;
}

/* Buttons */
.btn-primary {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  background-color: #00426E;
  color: white;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background-color: #003357;
}

.btn-secondary {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  background-color: white;
  border: 1px solid #D1D5DB;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #F9FAFB;
}

/* Disabled states */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Loading states */
select:disabled {
  background-color: #F3F4F6;
  cursor: not-allowed;
}

/* Additional utility classes */
.text-sm {
  font-size: 0.875rem;
}

.font-medium {
  font-weight: 500;
}



.relative {
  position: relative;
  z-index: 10;
  /* Ensure proper stacking context */
}

/* State select specific styles */
.form-select-container {
  width: 100%;
  background-color: white;
  border: 1px solid #D8D8D8;
  border-radius: 0.5rem;
  /* padding: 0rem 0.5rem; */
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.form-select-container:hover {
  border-color: #00426E;
}

.selected-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selected-item {
  background-color: #EFF6FF;
  /* blue-100 */
  color: #1D4ED8;
  /* blue-700 */
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.remove-item {
  border: none;
  background: none;
  padding: 0;
  color: #1D4ED8;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.remove-item:hover {
  color: #1E40AF;
  /* blue-900 */
}

.placeholder {
  /* color: #6B7280; */
  /* gray-500 */
  font-size: 0.875rem;
  padding-left: 0.5rem;
}

/* Dropdown menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  z-index: 50;
  width: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background-color: white;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-height: 300px;
  overflow-y: auto;
}

/* Search container */
.search-container {
  position: sticky;
  top: 0;
  background-color: white;
  padding: 0.5rem;
  border-bottom: 1px solid #E5E7EB;
}

.search-input {
  width: 100%;
  padding: 0.5rem 2.25rem;
  font-size: 0.875rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.375rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-size: 1rem;
}

.search-input:focus {
  outline: none;
  ring: 2px solid #00426E;
  border-color: #00426E;
}

.clear-search {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 1.25rem;
}

.clear-search:hover {
  color: #6B7280;
}

/* Options list */
.options-list {
  padding: 0.25rem 0;
}

.option-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option-item:hover {
  background-color: #F3F4F6;
}

/* Scrollbar styling */
.dropdown-menu::-webkit-scrollbar {
  width: 0.5rem;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: #F3F4F6;
  border-radius: 0.25rem;
}

.dropdown-menu::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 0.25rem;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}