/* Agregados de Gestoría sobre app.css (copiado tal cual de proveedores). */

/* .modal-overlay / .batch-dropzone tienen display propio que le gana a [hidden]. */
[hidden] { display: none !important; }

textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  color: var(--text-dark);
  outline: none;
  resize: vertical;
  width: 100%;
}
textarea:focus { border-color: var(--brand-color); }
input:disabled, select:disabled, textarea:disabled { background: #f8f7f2; color: var(--text-dark); }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }

.badge-danger { background: rgba(200, 16, 46, 0.12); color: var(--brand-color); }
.badge-muted { background: #eceae3; color: #57534e; }

.error-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 4px;
  background: rgba(200, 16, 46, 0.07);
  border: 1px solid rgba(200, 16, 46, 0.3);
  color: #7f1d1d;
  font-size: 13px;
}
.error-box span { flex: 1; }

/* Encabezados ordenables y paginado como links (en proveedores eran botones) */
table.data-table th.sortable a { color: inherit; display: inline-flex; align-items: center; }
.pagination .page-item a {
  display: flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--border-color); border-radius: 3px;
  background: #fff; color: var(--text-dark); font-size: 12px;
}
.pagination .page-item a:hover { background: #f8f7f2; }
.pagination .page-item.active a { background: var(--brand-color); border-color: var(--brand-color); color: #fff; }

.tab { text-decoration: none; }
.tab-count {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px;
  background: #eceae3; color: var(--text-muted);
}
.tab.active .tab-count { background: rgba(200, 16, 46, 0.12); color: var(--brand-color); }

/* Barra de filtros de las tablas */
.list-toolbar { flex-wrap: wrap; gap: 10px; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; }
.search-box input { padding-left: 30px; width: 240px; }

/* Filas según vencimiento */
table.data-table tbody tr.row-vencida > td:first-child { box-shadow: inset 3px 0 0 var(--brand-color); }
table.data-table tbody tr.row-vencida > td { background: rgba(200, 16, 46, 0.04); }
table.data-table tbody tr.row-por-vencer > td:first-child { box-shadow: inset 3px 0 0 #d97706; }
table.data-table tbody tr.row-por-vencer > td { background: rgba(217, 119, 6, 0.05); }
table.data-table tbody tr.row-inactiva > td { color: #8a8a86; }
.dominio {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 700; letter-spacing: 0.04em;
  background: #f4f5f7; border: 1px solid var(--border-color); border-radius: 3px; padding: 1px 6px;
}

/* Formulario de prenda en modal */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid input, .form-grid select { width: 100%; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.checkbox-row { justify-content: flex-end; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dark); cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important; }
.check input, .form-stack .check input, .form-grid .check input { width: auto; flex: 0 0 auto; }
.modal-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-color);
}
.btn-link { background: none; color: var(--text-muted); }
.btn-link:hover { color: var(--text-dark); }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack input, .form-stack select { width: 100%; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.cad-suggest { color: #b45309; cursor: pointer; text-decoration: underline; }

/* Gráfico de barras del resumen */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-value { font-size: 11px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.bar { width: 100%; max-width: 38px; background: #94a3b8; border-radius: 3px 3px 0 0; transition: opacity 0.15s; }
.bar-hot { background: var(--brand-color); }
.bar-col:hover .bar { opacity: 0.8; }
.bar-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; text-align: center; line-height: 1.1; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #efeee7; font-size: 13px; }
.timeline li:last-child { border-bottom: none; }
.timeline li i { margin-top: 3px; }

.code-box {
  display: block; font-size: 11px; background: #f4f5f7; border: 1px solid var(--border-color);
  border-radius: 3px; padding: 8px; word-break: break-all;
}
.change-list { margin: 6px 0 0; padding-left: 16px; font-size: 12px; }

.nav-section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin: 10px 0 6px; }
.sortable-list { list-style: none; margin: 0 0 8px; padding: 0; }
.sortable-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 3px; margin-bottom: 6px; background: #fff; }

.batch-dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 20px; border: 2px dashed var(--border-color); border-radius: 6px; cursor: pointer; text-align: center; }
.batch-dropzone.drag-over, .batch-dropzone:hover { border-color: var(--brand-color); background: rgba(200, 16, 46, 0.03); }
.import-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.import-count { border: 1px solid var(--border-color); border-radius: 4px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.import-count span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.import-count strong { font-size: 20px; }
.import-count.warn strong { color: #b45309; }

/* Responsive: sidebar como cajón en celular, tablas como tarjetas */
@media (max-width: 760px) {
  .main-sidebar { position: fixed; z-index: 300; height: 100vh; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.18s ease; }
  .app-wrapper.sidebar-open .main-sidebar { transform: none; }
  .app-wrapper.sidebar-collapsed .main-sidebar { width: var(--sidebar-width); }
  .app-wrapper.sidebar-collapsed .brand-link span,
  .app-wrapper.sidebar-collapsed .sidebar-menu .nav-item a span,
  .app-wrapper.sidebar-collapsed .sidebar-logout span { display: inline; }
  .content-wrapper { padding: 14px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .check-grid { grid-template-columns: 1fr; }
  .search-box input { width: 100%; }
  .toolbar-right, .search-box { width: 100%; }
  table.data-table thead { display: none; }
  table.data-table tr { display: block; border-bottom: 1px solid var(--border-color); padding: 6px 0; }
  table.data-table td { display: flex; gap: 10px; border: none; padding: 4px 12px; }
  table.data-table td[data-label]::before { content: attr(data-label); min-width: 90px; font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
  .bar-chart { gap: 3px; }
}
