:root {
  --primary: #0F1B2B;
  --primary-hover: #0d1521;
  --success: #2ECC71;
  --success-hover: #1E9D58;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --bg: #F4F6F8;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --border: #B0B8C1;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* Header - Barra superior */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

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

.topbar-title-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.page-icon {
  font-size: 24px;
  color: white;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: white;
  margin: 0;
  white-space: nowrap;
}

/* Menu Toggle Button */
.btn-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.btn-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.btn-menu-toggle:active {
  transform: scale(0.95);
}

.btn-menu-toggle .material-symbols-outlined {
  font-size: 24px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

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

/* btn-icon dentro de páginas (con fondo claro) */
.page-content .btn-icon {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0;
}

.page-content .btn-icon:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-content .btn-icon .material-symbols-outlined {
  font-size: 20px;
}

/* Usage Info */
.usage-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  opacity: 0.9;
  visibility: visible !important;
  margin-left: auto;
  flex-shrink: 0;
}

/* Usage Info dentro de páginas (con fondo claro) */
.page-content .usage-info {
  color: var(--text);
  margin-left: 0;
}

.page-content .usage-label {
  color: var(--text-secondary);
}

.page-content .usage-value {
  background: var(--bg-tertiary);
  color: var(--text);
}

.page-content .usage-bar {
  background: var(--bg-tertiary);
}

.page-content .usage-bar-fill {
  background: var(--primary);
}

.usage-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.usage-label {
  font-weight: 500;
}

.usage-value {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.usage-bar {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-left: 4px;
}

.usage-bar-fill {
  height: 100%;
  background: white;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Actions Section */
.actions {
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.actions .row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.actions .row:last-child {
  margin-bottom: 0;
}

.files-counter-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  cursor: help;
}

.files-counter-short {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 0;
  white-space: nowrap;
  font-weight: 500;
}

.files-counter-info {
  font-size: 11px;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  background: var(--bg-tertiary);
  transition: all 0.2s;
}

.files-counter-info:hover {
  background: var(--border);
  color: var(--text);
}

.files-counter-wrapper::after {
  content: attr(data-full-text);
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  background: var(--text);
  color: white;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.files-counter-wrapper:hover::after {
  opacity: 1;
}

.files-counter-wrapper::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 6px);
  left: 10px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--text);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.files-counter-wrapper:hover::before {
  opacity: 1;
}

.btn-add-analysis {
  background-color: var(--primary);
  color: white;
}

.btn-add-analysis:hover:not(:disabled) {
  background-color: var(--primary-hover);
}

label {
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

select, input[type="text"], input[type="file"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-secondary);
  color: var(--text);
  transition: all 0.2s;
  font-family: inherit;
}

select:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

input[type="file"] {
  display: none;
}

/* Floating Label Select */
.select-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
}

.select-wrapper select {
  padding: 16px 12px 8px 12px;
  background: var(--bg-secondary);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.select-wrapper label {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s;
  background: var(--bg-secondary);
  padding: 0 4px;
}

.select-wrapper:focus-within label,
.select-wrapper.has-value label {
  color: var(--success);
  font-size: 10px;
  top: -6px;
}

/* Botones principales */
button {
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  background-color: var(--success);
  color: white;
}

button:hover:not(:disabled) {
  background-color: var(--success-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

/* Botón Parar - Estilo diferenciado (rojo) */
#btnStopProcessing {
  background: var(--danger);
  color: white;
  font-weight: 600;
}

#btnStopProcessing:hover:not(:disabled) {
  background: var(--danger-hover);
  transform: scale(1.02);
}

#btnStopProcessing:active {
  transform: scale(0.98);
}

/* Botón Procesar lista - Estilo diferenciado (primary) */
#btnProcessSelected {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

#btnProcessSelected:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.02);
}

#btnProcessSelected:active {
  transform: scale(0.98);
}

/* Botón Volcar todos - Estilo diferenciado (verde/success) */
#btnDumpAll {
  background: var(--success);
  color: white;
  font-weight: 600;
}

#btnDumpAll:hover:not(:disabled) {
  background: var(--success-hover);
  transform: scale(1.02);
}

#btnDumpAll:active {
  transform: scale(0.98);
}

/* Botón Añadir - Estilo diferenciado */
#btnAddFiles {
  background: var(--primary);
  color: white;
  font-weight: 500;
}

#btnAddFiles:hover:not(:disabled) {
  background: var(--primary-hover);
}

/* Botones del modal - Auto-OCR y OCR recorte */
#btnAutoOCR {
  background: var(--primary);
  color: white;
  font-weight: 500;
}

#btnAutoOCR:hover:not(:disabled) {
  background: var(--primary-hover);
}

#btnCropOCR {
  background: var(--warning);
  color: white;
  font-weight: 500;
}

#btnCropOCR:hover:not(:disabled) {
  background: #d97706;
  opacity: 0.9;
}

/* Botón Desde móvil */
#btnMobileUpload {
  background: #9333ea;
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

#btnMobileUpload .material-symbols-outlined {
  font-size: 18px;
}

#btnMobileUpload span:not(.material-symbols-outlined) {
  font-size: 13px;
}

#btnMobileUpload:hover:not(:disabled) {
  background: #7e22ce;
  transform: scale(1.02);
}

#btnMobileUpload:active {
  transform: scale(0.98);
}

/* Modal QR móvil */
.mobile-qr-modal .modal-body {
  max-height: 80vh;
  overflow-y: auto;
}

/* Table - Tablas */
section {
  padding: 10px;
  overflow-x: auto;
}

#tblFiles {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#tblFiles thead {
  background-color: var(--primary);
}

#tblFiles th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

#tblFiles td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 13px;
}

#tblFiles tbody tr:hover {
  background: var(--bg);
}

#tblFiles tbody tr:last-child td {
  border-bottom: none;
}

#tblFiles button {
  padding: 4px 10px;
  margin-right: 4px;
  font-size: 12px;
}

.btnView {
  background: var(--primary);
}

.btnView:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btnToExcel {
  background: var(--success);
}

.btnToExcel:hover:not(:disabled) {
  background: var(--success-hover);
}

.btnDelete {
  background: var(--danger);
  padding: 4px 8px;
}

.btnDelete:hover:not(:disabled) {
  background: var(--danger-hover);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-secondary);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

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

.modal-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-header button {
  background: transparent;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 20px;
  border-radius: var(--radius-sm);
}

.modal-header button:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  padding: 10px;
  overflow: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.modal-footer > div {
  display: flex;
  gap: 10px;
}

.btn-reanalyze {
  background: var(--warning);
  color: white;
}

.btn-reanalyze:hover:not(:disabled) {
  background: var(--warning);
  opacity: 0.9;
}

.already-processed-notice {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
  width: 100%;
  text-align: center;
}

.viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 20px;
}

#imgPreview, #pdfCanvas {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.hidden {
  display: none !important;
}

/* Settings Sidebar */
.settings {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings.show-below-topbar {
  top: var(--topbar-height, 72px);
  height: calc(100vh - var(--topbar-height, 72px));
}

.settings.hidden {
  display: none;
}

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

.settings-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.settings-header button {
  background: transparent;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 20px;
}

.settings-header button:hover {
  background: var(--border);
  color: var(--text);
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tabs-container {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  position: relative;
}

.tabs-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  white-space: nowrap;
}

.tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.tab-nav-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  transition: all 0.2s;
}

.tab-nav-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

.tab {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

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

.tab.active {
  color: var(--success);
  border-bottom-color: var(--success);
  background: transparent;
}

.tabpane {
  display: none;
}

.tabpane.show {
  display: block;
}

.tabpane h5 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.tabpane label {
  display: block;
  margin-bottom: 6px;
  margin-top: 16px;
}

.tabpane input[type="text"],
.tabpane textarea,
.tabpane select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-secondary);
}

.tabpane textarea {
  min-height: 120px;
  resize: vertical;
}

.tabpane small {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.tabpane input[type="checkbox"] {
  margin-right: 8px;
}

.settings-footer {
  padding: 16px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.btn-advanced-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s;
  width: 36px;
  height: 36px;
}

.btn-advanced-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
}

.btn-advanced-toggle .material-symbols-outlined {
  font-size: 20px;
}

.analisis-list {
  display: none;
}

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

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

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

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

/* Status badges */
.status-pendiente { color: var(--text-secondary); }
.status-procesando { color: var(--warning); font-weight: 500; }
.status-procesado { color: var(--success); font-weight: 500; }
.status-error { color: var(--danger); font-weight: 500; }
.status-insertado { color: var(--success); font-weight: 500; }

/* Animación para estado procesando */
.processing-animation {
  animation: pulse-processing 1.5s ease-in-out infinite;
  display: inline-block;
}

@keyframes pulse-processing {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}

/* Asegurar que todos los estados de procesando tengan animación */
[class*="status-procesando"] {
  animation: pulse-processing 1.5s ease-in-out infinite;
  display: inline-block;
  color: var(--warning);
  font-weight: 500;
}

/* Columns Info */
.columns-info {
  margin-bottom: 16px;
}

.columns-list {
  margin-top: 8px;
  min-height: 40px;
}

.columns-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.column-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

/* Sidebar Menu */
.sidebar-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.sidebar-menu.hidden {
  transform: translateX(-100%);
}

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

.sidebar-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.btn-close-menu {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-menu:hover {
  background: var(--border);
  color: var(--text);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.menu-list {
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--bg);
}

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

.menu-item .material-symbols-outlined {
  font-size: 24px;
}

.menu-item span:not(.material-symbols-outlined) {
  font-size: 14px;
  font-weight: 500;
}

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

.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login .material-symbols-outlined {
  font-size: 20px;
}

/* Overlay para cerrar el menú al hacer clic fuera */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 997;
  backdrop-filter: blur(2px);
}

/* Page Container */
.page-container {
  flex: 1;
  overflow-y: auto;
}

.page-content {
  display: none;
}

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

.page-header {
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.page-header p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.page-body {
  padding: 20px;
  background: var(--bg);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state p {
  margin: 16px 0 8px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.empty-state small {
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state button {
  margin-top: 16px;
}

.help-section {
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.help-section h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.help-section p {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Advanced Settings Page */
.advanced-settings {
  max-width: 600px;
  margin: 0 auto;
}

.setting-group {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.setting-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

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

.setting-select,
.setting-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 45px;
  padding: 19px 12px 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.35;
  background: var(--bg-secondary);
  color: var(--text);
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.setting-input.openai-key-field.openai-key-highlight,
.setting-group.openai-key-pending .openai-key-field {
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.25);
}

.setting-select:focus,
.setting-input:focus {
  outline: none;
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

/* Floating label para inputs dentro de setting-group */
.setting-group .select-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.setting-group .select-wrapper label {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s;
  background: var(--bg-secondary);
  padding: 0 4px;
}

.setting-group .select-wrapper:focus-within label,
.setting-group .select-wrapper.has-value label {
  color: var(--success);
  font-size: 10px;
  top: -6px;
}

.setting-group small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Checkbox Style for Advanced Settings */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: var(--bg-tertiary);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkbox-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.checkbox-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: normal;
}

.advanced-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

/* Login Modal */
.login-modal-content {
  max-width: 400px;
}

.btn-microsoft-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 24px;
  background: #2F2F2F;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-microsoft-signin:hover {
  background: #1F1F1F;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-microsoft-signin:active {
  transform: translateY(0);
}

.microsoft-logo {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.microsoft-square {
  width: 11px;
  height: 11px;
  border-radius: 1px;
}

.square-red {
  background: #F35325;
}

.square-green {
  background: #81BC06;
}

.square-blue {
  background: #05A6F0;
}

.square-yellow {
  background: #FFBA08;
}

/* Login Form */
.login-form-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text);
  transition: all 0.2s;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.password-input-wrapper .login-input {
  padding-right: 40px;
  flex: 1;
}

.toggle-password-btn {
  position: absolute;
  right: 8px;
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  padding: 4px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s;
  margin: 0 !important;
  z-index: 1;
}

.toggle-password-btn:hover {
  color: var(--primary) !important;
  background: rgba(37, 99, 235, 0.05) !important;
  border-radius: 4px;
}

.toggle-password-btn:active {
  transform: none !important;
}

.toggle-password-btn .material-symbols-outlined {
  font-size: 20px;
}

.login-options {
  display: flex;
  justify-content: flex-start;
}

.remember-me-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.remember-me-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.btn-signin {
  width: 100%;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-signin:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-signin:active {
  transform: translateY(0);
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 8px 0;
}

/* Credits Plans Page */
.credits-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.credit-plan {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

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

.credit-plan.plan-popular {
  border-color: var(--success);
  border-width: 1px;
}

.credit-plan.plan-best-value {
  border-color: var(--warning);
  border-width: 1px;
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.plan-badge-premium {
  background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
}

.plan-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.plan-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plan-popular .plan-icon {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-hover) 100%);
}

.plan-best-value .plan-icon {
  background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
}

.plan-icon .material-symbols-outlined {
  font-size: 18px;
  color: white;
}

.plan-title {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.plan-title-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.plan-title h3 {
  margin: 0 0 2px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
}

.plan-subtitle {
  margin: 0 0 4px 0;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
}

.price-per-doc {
  display: block;
  /* font-size: 10px; */
  color: var(--success);
  font-weight: 600;
  margin-top: 2px;
}

.plan-price-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.price-amount-inline {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.price-with-discount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.original-price-inline {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.discount-badge-inline {
  background: rgba(46, 204, 113, 0.1);
  color: var(--success);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.discount-badge-inline.discount-10 {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.discount-badge-inline.discount-20 {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.plan-features {
  flex: 1;
  margin-bottom: 8px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.feature-item:last-child {
  margin-bottom: 0;
}

.feature-item .material-symbols-outlined {
  font-size: 16px;
  color: var(--success);
  flex-shrink: 0;
  margin-top: 1px;
}

.feature-item span:not(.material-symbols-outlined) {
  line-height: 1.4;
}

.btn-plan-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: auto;
}

.btn-plan-select:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-plan-select:active {
  transform: translateY(0);
}

.btn-plan-primary {
  background: var(--success);
}

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

.plan-best-value .btn-plan-select {
  background: var(--warning);
}

.plan-best-value .btn-plan-select:hover {
  background: #d97706;
}

/* Credits page specific adjustments */
#pageCredits .page-body {
  margin-top: 10px;
  padding: 0px;
}

#pageCredits .page-header {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#pageCredits .page-header > div:first-child {
  flex: 1;
}

#pageCredits .page-header h2 {
  font-size: 20px;
  margin: 0 0 4px 0;
}

#pageCredits .page-header p {
  font-size: 12px;
}

/* Plans page specific adjustments */
#pagePlans .page-body {
  margin-top: 10px;
  padding: 0px;
}

#pagePlans .page-header {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#pagePlans .page-header > div:first-child {
  flex: 1;
}

#pagePlans .page-header h2 {
  font-size: 20px;
  margin: 0 0 4px 0;
}

#pagePlans .page-header p {
  font-size: 12px;
}

/* History page specific adjustments */
#pageHistory .page-body {
  margin-top: 10px;
  padding: 0px;
}

#pageHistory .page-header {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#pageHistory .page-header > div:first-child {
  flex: 1;
}

#pageHistory .page-header h2 {
  font-size: 20px;
  margin: 0 0 4px 0;
}

#pageHistory .page-header p {
  font-size: 12px;
  margin: 0;
}

/* Activity Chart */
.activity-chart-container {
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.activity-chart-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.activity-chart-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.activity-chart {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #1a2d47 0%, #0f1b2b 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.chart-max-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #2ECC71;
  z-index: 1;
}

.chart-area {
  position: relative;
  width: 100%;
  height: calc(100% - 38px);
  margin-top: 2px;
  margin-bottom: 36px;
}

.chart-spike {
  position: absolute;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
}

.chart-spike:hover {
  background: rgba(255, 255, 255, 0.7);
  width: 3px;
  transform: translateX(-1px);
}

.chart-axis {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 6px;
}

.chart-label {
  position: absolute;
  bottom: 4px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  transform: translateX(-50%);
}

.chart-label:first-child {
  left: 0;
  transform: translateX(0);
}

.chart-label:last-child {
  right: 0;
  transform: translateX(0);
}

.chart-label:nth-child(2) {
  left: 50%;
  transform: translateX(-50%);
}

/* History List */
.history-list-container {
  padding: 0 12px;
}

.history-list-title {
  margin: 16px 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.history-item-main {
  display: flex;
  align-items: center;
  /* gap: 10px; */
  /* flex-wrap: wrap; */
}

.history-date-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
  flex-shrink: 0;
}

.history-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.history-time {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  line-height: 1.2;
}

.history-day {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
  line-height: 1.2;
}

.history-file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 150px;
}

.history-file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

.history-file-type {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.history-status {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 3px;
  width: fit-content;
}

.history-status.success {
  background: rgba(46, 204, 113, 0.1);
  color: var(--success);
}

.history-actions {
  display: flex;
  gap: 8px;
}

.btn-view-data {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-view-data:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-view-data:active {
  transform: translateY(0);
}

.btn-view-data .material-symbols-outlined {
  font-size: 14px;
}

/* History Modal */
.history-modal-content {
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
}

.history-modal-file-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.history-modal-file-name,
.history-modal-file-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.history-modal-file-name {
  font-weight: 600;
  font-size: 15px;
}

.history-modal-file-name .material-symbols-outlined,
.history-modal-file-date .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-secondary);
}

.history-modal-data {
  margin-bottom: 12px;
  max-height: 450px;
  overflow-y: auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.history-modal-data pre {
  margin: 0;
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
}

/* Estilos mejorados para JSON en el modal */
.history-modal-data pre {
  background: transparent;
  border: none;
}

/* Mejorar scrollbar del modal */
.history-modal-data::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.history-modal-data::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

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

.history-modal-data::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.history-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.history-modal-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
}

.history-modal-actions .material-symbols-outlined {
  font-size: 16px;
}

.credits-available {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.credits-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.credits-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .credits-plans {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .credit-plan {
    padding: 12px;
  }
  
  .price-amount {
    font-size: 22px;
  }
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.divider-text {
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* File Details in Table */
.file-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.file-type {
  font-size: 12px;
  color: var(--text-secondary);
}

.file-status {
  margin-top: 2px;
}

/* Table Action Buttons */
.actions-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.btnAction {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  width: 100%;
}

.btnAction:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--primary);
  transform: scale(1.1);
}

.btnAction:active:not(:disabled) {
  transform: scale(0.95);
}

.btnAction:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btnAction .material-symbols-outlined {
  font-size: 20px;
}

.btnAction.btnView .material-symbols-outlined {
  color: var(--primary);
}

.btnAction.btnToExcel .material-symbols-outlined {
  color: var(--success);
}

.btnAction.btnDelete .material-symbols-outlined {
  color: var(--danger);
}

.btnAction.btnView:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.1);
}

.btnAction.btnToExcel:hover:not(:disabled) {
  background: rgba(46, 204, 113, 0.1);
}

.btnAction.btnDelete:hover:not(:disabled) {
  background: rgba(231, 76, 60, 0.1);
}


/*# sourceMappingURL=taskpane.33c7bdf7.css.map*/