/* ===== PAGES CSS - REPLICA EXACTA BOLETEALO ===== */

/* ===== PAGE CONTAINER (global) ===== */
.page-container { padding: 24px; background: #f3f4f6; min-height: 100vh; }
.page-header { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: center; align-items: center; margin-bottom: 20px; -webkit-flex-wrap: wrap; flex-wrap: wrap; gap: 12px; }
.page-title { margin: 0; font-size: 28px; font-weight: 700; color: #111827; }
.page-subtitle { margin: 4px 0 0 0; font-size: 14px; color: #6b7280; }
.header-actions { display: -webkit-flex; display: flex; gap: 12px; -webkit-align-items: center; align-items: center; }

/* ===== KPI CARDS (Dashboard) ===== */
.db-kpi-grid { display: -webkit-flex; display: flex; gap: 16px; margin-bottom: 20px; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.db-kpi-card { -webkit-flex: 1; flex: 1; min-width: 180px; background: white; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-left: 4px solid #6b7280; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 16px; }
.db-kpi-card.success { border-left-color: #10b981; }
.db-kpi-card.danger { border-left-color: #dc2626; }
.db-kpi-card.primary { border-left-color: #0bb3a7; }
.db-kpi-card.info { border-left-color: #3b82f6; }
.db-kpi-card.warning { border-left-color: #f59e0b; }
.db-kpi-icon { width: 48px; height: 48px; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; -webkit-flex-shrink: 0; flex-shrink: 0; }
.db-kpi-icon.success-bg { background: #d1fae5; color: #065f46; }
.db-kpi-icon.danger-bg { background: #fee2e2; color: #991b1b; }
.db-kpi-icon.primary-bg { background: #ccfbf1; color: #0bb3a7; }
.db-kpi-icon.info-bg { background: #dbeafe; color: #1e40af; }
.db-kpi-icon.warning-bg { background: #fef3c7; color: #92400e; }
.db-kpi-data { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; gap: 2px; min-width: 0; }
.db-kpi-value { font-size: 20px; font-weight: 700; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-kpi-label { font-size: 13px; color: #6b7280; }

/* ===== SECTION ROW (Dashboard 2fr 1fr) ===== */
.section-row { display: -webkit-flex; display: flex; gap: 20px; margin-bottom: 20px; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.section-row .db-card { margin-bottom: 0; }
.section-row .db-card:first-child { -webkit-flex: 2; flex: 2; min-width: 300px; }
.section-row .db-card:last-child { -webkit-flex: 1; flex: 1; min-width: 250px; }

/* ===== CARD (Dashboard) ===== */
.db-card { background: white; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid #c2c2c2; margin-bottom: 20px; }
.db-card-title { margin: 0 0 16px 0; font-size: 16px; font-weight: 600; color: #111827; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 8px; }
.db-card-title svg { color: #6b7280; }

/* Comprobantes grid */
.comprobantes-grid { display: -webkit-flex; display: flex; gap: 12px; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.comprobante-stat { -webkit-flex: 1; flex: 1; min-width: 100px; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-align-items: center; align-items: center; gap: 4px; padding: 12px; background: #f9fafb; }
.comprobante-stat.total { background: #f0fdfa; }
.comprobante-num { font-size: 28px; font-weight: 700; color: #111827; }
.comprobante-label { font-size: 12px; color: #6b7280; font-weight: 500; }
.comprobante-monto { font-size: 13px; font-weight: 600; color: #374151; }

/* IGV */
.igv-main { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: center; align-items: center; padding: 16px; background: #f9fafb; }
.igv-label { font-size: 14px; font-weight: 500; color: #374151; }
.igv-value { font-size: 22px; font-weight: 700; color: #111827; }
.igv-hint { margin: 12px 0 0; font-size: 12px; color: #9ca3af; line-height: 1.5; }

/* Chart */
.chart-legend { display: -webkit-flex; display: flex; gap: 20px; margin-bottom: 16px; }
.legend-item { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 6px; font-size: 13px; color: #6b7280; }
.legend-dot { width: 10px; height: 10px; display: inline-block; }
.success-dot { background: #10b981; }
.danger-dot { background: #dc2626; }
.primary-dot { background: #0bb3a7; }
.chart-bars-wrap { display: -webkit-flex; display: flex; -webkit-align-items: flex-end; align-items: flex-end; gap: 16px; height: 200px; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; }
.chart-month { -webkit-flex: 1; flex: 1; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-align-items: center; align-items: center; gap: 8px; height: 100%; }
.bars-wrap { display: -webkit-flex; display: flex; -webkit-align-items: flex-end; align-items: flex-end; gap: 4px; height: 100%; width: 100%; -webkit-justify-content: center; justify-content: center; }
.bar { width: 20px; min-height: 4px; -webkit-transition: height 0.5s ease; transition: height 0.5s ease; cursor: pointer; }
.bar:hover { opacity: 0.8; }
.bar-ingreso { background: #10b981; }
.bar-egreso { background: #dc2626; }
.bar-utilidad { background: #0bb3a7; }
.chart-month-label { font-size: 12px; color: #6b7280; font-weight: 500; }

/* Cuentas pendientes */
.cuentas-grid { display: -webkit-flex; display: flex; gap: 20px; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.cuentas-grid .db-card { -webkit-flex: 1; flex: 1; min-width: 280px; margin-bottom: 0; }
.cuenta-row { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: center; align-items: center; padding: 10px 12px; background: #f9fafb; margin-bottom: 8px; }
.cuenta-row.alerta { background: #fef2f2; border: 1px solid #fecaca; }
.cuenta-row.total-row { background: transparent; border-top: 1px solid #e5e7eb; margin-top: 4px; }
.cuenta-label { font-size: 13px; color: #374151; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 8px; }
.cuenta-value { font-size: 14px; font-weight: 700; color: #111827; }
.badge-vencido { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600; background: #dc2626; color: white; }
.db-card-link { display: inline-block; margin-top: 12px; padding: 0; border: none; background: none; font-size: 13px; font-weight: 600; color: #0bb3a7; cursor: pointer; }
.db-card-link:hover { text-decoration: underline; }

/* ===== FILTERS CARD (Listings) ===== */
.filters-card { background: white; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid #d1d5db; }
.filters-header { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: center; align-items: center; margin-bottom: 16px; }
.filters-title-section { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 8px; font-weight: 600; color: #374151; font-size: 14px; }
.filters-actions { display: -webkit-flex; display: flex; gap: 12px; }
.btn-text { border: none; border-bottom: 1px solid #2e2f2f; background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: #242424; padding: 0; }
.btn-text:hover { color: #0bb3a7; border-bottom-color: #0bb3a7; }
.filters-grid { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; gap: 12px; }
.filter-group { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; gap: 4px; min-width: 160px; -webkit-flex: 1; flex: 1; }
.filter-label { font-size: 13px; font-weight: 500; color: #6b7280; }
.filter-input { padding: 10px 12px; border: 1px solid #d1d5db; font-size: 13px; color: #374151; background: white; -webkit-transition: all 0.2s; transition: all 0.2s; }
.filter-input:focus { outline: none; border-color: #0bb3a7; box-shadow: 0 0 0 3px rgba(11,179,167,0.1); }

/* ===== RESUMEN CARDS (Stats) ===== */
.resumen-cards { display: -webkit-flex; display: flex; gap: 16px; margin-bottom: 20px; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.resumen-card { -webkit-flex: 1; flex: 1; min-width: 120px; background: white; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-left: 4px solid #6b7280; text-align: center; }
.resumen-card.primary { border-left-color: #0bb3a7; }
.resumen-card.success { border-left-color: #10b981; }
.resumen-card.warning { border-left-color: #f59e0b; }
.resumen-card.danger { border-left-color: #dc2626; }
.resumen-numero { display: block; font-size: 32px; font-weight: 700; color: #0bb3a7; }
.resumen-label { font-size: 13px; color: #6b7280; }

/* ===== TABLE CARD (Listings) ===== */
.table-card { background: white; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid #d1d5db; margin-bottom: 20px; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-count { font-size: 13px; color: #6b7280; display: block; margin-bottom: 12px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; border: 1px solid #e5e7eb; }
.data-table th { padding: 12px 16px; text-align: center; font-size: 13px; font-weight: 600; color: #374151; background: #f9fafb; border-bottom: 2px solid #dbdbdb; border-right: 1px solid #e5e7eb; white-space: nowrap; }
.data-table th:last-child { border-right: none; }
.data-table td { padding: 12px 16px; font-size: 14px; color: #111827; border-bottom: 1px solid #dbdbdb; border-right: 1px solid #f3f4f6; }
.data-table td:last-child { border-right: none; }
.data-table tbody tr:hover { background: #f9fafb; }
.data-table .text-center { text-align: center; }
.data-table .text-right { text-align: right; }
.row-stock-bajo { background: #fef2f2; }
.row-stock-bajo:hover { background: #fee2e2; }
.empty-row { text-align: center; color: #9ca3af; padding: 40px 16px; }

/* Cliente cell */
.cliente-cell { display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; gap: 2px; }
.cliente-cell strong { font-size: 13px; }
.cliente-cell .documento { font-size: 12px; color: #6b7280; font-weight: 400; }

/* Tipo badge */
.tipo-badge { display: inline-block; padding: 4px 10px; font-size: 11px; font-weight: 600; background: #f0f0f0; color: #374151; }

/* Codigo */
.codigo { font-family: 'Courier New', monospace; font-size: 12px; font-weight: 700; color: #374151; }

/* File buttons */
.file-buttons { display: -webkit-flex; display: flex; gap: 4px; -webkit-justify-content: center; justify-content: center; }
.btn-file { padding: 4px 10px; border: 1px solid #d1d5db; background: white; font-size: 11px; font-weight: 600; cursor: pointer; -webkit-transition: all 0.2s; transition: all 0.2s; }
.btn-file:hover { background: #f9fafb; }
.btn-file.btn-xml { color: #059669; border-color: #059669; }
.btn-file.btn-pdf { color: #dc2626; border-color: #dc2626; }
.btn-file.btn-cdr { color: #7c3aed; border-color: #7c3aed; }

/* Icon action buttons */
.action-buttons { display: -webkit-flex; display: flex; gap: 6px; -webkit-justify-content: center; justify-content: center; }
.btn-icon-action { position: relative; padding: 6px; border: none; cursor: pointer; color: white; -webkit-transition: all 0.2s; transition: all 0.2s; display: -webkit-inline-flex; display: inline-flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; min-width: 28px; min-height: 28px; }
.btn-icon-action.btn-primary-icon { background: #0bb3a7; }
.btn-icon-action.btn-primary-icon:hover { background: #099a8f; }
.btn-icon-action.btn-menu-icon { background: #6b7280; }
.btn-icon-action.btn-menu-icon:hover { background: #4b5563; }

/* Stock action buttons */
.btn-action-stock { padding: 6px; border: none; cursor: pointer; display: -webkit-inline-flex; display: inline-flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; min-width: 28px; min-height: 28px; -webkit-transition: all 0.2s; transition: all 0.2s; }
.btn-entrada { background: #d1fae5; color: #059669; }
.btn-entrada:hover { background: #a7f3d0; }
.btn-salida { background: #fed7aa; color: #ea580c; }
.btn-salida:hover { background: #fdba74; }
.btn-ajuste { background: #dbeafe; color: #2563eb; }
.btn-ajuste:hover { background: #bfdbfe; }
.btn-kardex { background: #f3f4f6; color: #6b7280; }
.btn-kardex:hover { background: #e5e7eb; }
.stock-bajo-text { color: #dc2626; }

/* Table footer pagination */
.table-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e5e7eb; display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: center; align-items: center; -webkit-flex-wrap: wrap; flex-wrap: wrap; gap: 12px; }
.table-info { font-size: 13px; color: #6b7280; }
.page-btns { display: -webkit-flex; display: flex; gap: 4px; -webkit-align-items: center; align-items: center; }
.page-btn { padding: 6px 10px; border: 1px solid #d1d5db; background: white; color: #6b7280; font-size: 12px; cursor: pointer; -webkit-transition: all 0.2s; transition: all 0.2s; }
.page-btn:hover { border-color: #0bb3a7; color: #0bb3a7; }
.page-btn.active { background: #0bb3a7; color: white; border-color: #0bb3a7; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info-text { font-size: 13px; color: #6b7280; min-width: 60px; text-align: center; }

/* ===== HELP TOUR BUTTON ===== */
.btn-help-tour { width: 32px; height: 32px; border: 1px solid #d1d5db; background: white; color: #6b7280; font-size: 16px; font-weight: 700; cursor: pointer; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; -webkit-transition: all 0.2s; transition: all 0.2s; }
.btn-help-tour:hover { border-color: #0bb3a7; color: #0bb3a7; background: #f0fdfa; }

/* ===== DROPDOWN MENU ===== */
.action-menu-container { position: relative; display: inline-block; }
.action-dropdown { position: absolute; top: 100%; right: 0; background: white; border: 1px solid #e5e7eb; box-shadow: 0 4px 6px rgba(0,0,0,0.1); z-index: 100; min-width: 180px; }
.dropdown-item { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: none; background: none; color: #374151; font-size: 13px; font-weight: 500; cursor: pointer; -webkit-transition: all 0.2s; transition: all 0.2s; text-align: left; }
.dropdown-item:hover { background: #f9fafb; color: #0bb3a7; }
.dropdown-item.danger { color: #dc2626; }
.dropdown-item.danger:hover { background: #fef2f2; }
.dropdown-divider { height: 1px; background: #e5e7eb; margin: 4px 0; }

/* ===== CONFIG SECTIONS ===== */
.config-card { background: white; border: 1px solid #e5e7eb; overflow: hidden; margin-bottom: 16px; border-radius: 0.75rem; }
.config-card-header { padding: 0.8rem 1.2rem; font-size: 1.125rem; font-weight: 600; color: #fff; background: #083a3a; border-bottom: 2px solid #e5e7eb; margin: 0; }
.config-card-body { padding: 1.5rem; }

/* ===== PERMISOS TABLE ===== */
.permisos-table { width: 100%; border-collapse: collapse; }
.permisos-table th { padding: 12px; background: #f9fafb; font-size: 13px; font-weight: 600; color: #374151; border-bottom: 2px solid #e5e7eb; }
.permisos-table td { padding: 12px; border-bottom: 1px solid #e5e7eb; font-size: 13px; }
.check-on { color: #059669; font-weight: 700; font-size: 16px; }
.check-off { color: #d1d5db; font-size: 16px; }

/* ===== UTILITIES ===== */
.text-danger { color: #dc2626; }
.text-success { color: #059669; }
.primary-text { color: #0bb3a7; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'Courier New', monospace; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .db-kpi-grid { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
  .db-kpi-card { min-width: calc(50% - 8px); }
}
@media (max-width: 768px) {
  .page-container { padding: 16px; }
  .page-title { font-size: 22px; }
  .page-header { -webkit-flex-direction: column; flex-direction: column; -webkit-align-items: flex-start; align-items: flex-start; }
  .section-row { -webkit-flex-direction: column; flex-direction: column; }
  .comprobantes-grid { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
  .comprobante-stat { min-width: calc(50% - 6px); }
  .cuentas-grid { -webkit-flex-direction: column; flex-direction: column; }
  .chart-bars-wrap { height: 160px; gap: 8px; }
  .bar { width: 14px; }
  .filters-grid { -webkit-flex-direction: column; flex-direction: column; }
  .resumen-cards { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
  .resumen-card { min-width: calc(50% - 8px); }
  .data-table th, .data-table td { font-size: 12px; padding: 8px 10px; white-space: nowrap; }
}
@media (max-width: 480px) {
  .page-container { padding: 12px; }
  .page-title { font-size: 20px; }
  .db-kpi-card { min-width: 100%; }
  .resumen-card { min-width: 100%; }
  .resumen-numero { font-size: 24px; }
  .chart-bars-wrap { height: 140px; }
  .bar { width: 10px; }
}
