/* Estilos comunes para pantallas administrativas: users, logs, proveedores, disposiciones_2026 */
.container { max-width: 1200px; display: block; }
.container.xwide { max-width: 1400px; }

.toolbar, .filters, .leyenda, .limit-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--blanco);
  border: 1.5px solid var(--borde);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toolbar input[type=text], .filters input, .filters select, .toolbar select {
  padding: 8px 12px;
  border: 1.5px solid var(--borde);
  border-radius: 7px;
  font-size: 13px;
  outline: none;
  min-height: 37px;
}
.toolbar input[type=text] { flex: 1; min-width: 200px; }
.toolbar input:focus, .filters input:focus, .filters select:focus { border-color: var(--azul-claro); }

.btn {
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary { background: var(--azul); color: white; }
.btn-primary:hover { background: var(--azul-claro); }
.btn-success { background: var(--verde); color: white; }
.btn-success:hover { background: #27ae60; }
.btn-danger { background: var(--rojo); color: white; }
.btn-danger:hover { background: #922b21; }
.btn-secondary { background: #ecf0f1; color: var(--texto); }
.btn-secondary:hover { background: #d5dbdb; }

.modal-overlay, .overlay, .confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open, .overlay.open, .confirm-overlay.open { display: flex; }
.modal {
  background: var(--blanco);
  border-radius: 14px;
  padding: 28px 30px;
  width: 96%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,0.28);
}
.modal h2 { font-size: 17px; color: var(--azul); margin-bottom: 20px; font-weight: 700; }
.modal-footer, .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--verde);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 200;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--rojo); }


/* Administración: headers, badges, logs y usuarios */
.header-icon {
  font-size: 22px;
}

.header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

header {
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-icon {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.header-right {
  margin-left: auto;
  flex-shrink: 0;
}

.btn-h {
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 7px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.btn-h:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.42);
}

.header-right button.btn-h {
  background: rgba(192,57,43,0.18);
}

.header-right button.btn-h:hover {
  background: rgba(192,57,43,0.32);
}

.hidden {
  display: none;
}

.modal-footer-center {
  justify-content: center;
}

.btn-danger-soft {
  background: var(--rojo-suave);
  color: var(--rojo);
  margin-left: auto;
}
.filters .btn-danger-soft {
  margin-left: 0;
}
.btn-danger-soft:hover {
  background: #f5b7b1;
}

.badge-ok {
  background: var(--verde-suave);
  color: var(--verde);
  border: 1px solid #a9dfbf;
}

.badge-off {
  background: #eee;
  color: #777;
  border: 1px solid #ddd;
}

.limit-label,
.limit-text {
  font-size: 13px;
  font-weight: 700;
  color: #555;
}

.limit-label {
  font-weight: 600;
}

.limit-track {
  flex: 1;
  min-width: 160px;
  height: 10px;
  background: #eef2f5;
  border-radius: 999px;
  overflow: hidden;
}

.limit-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--verde), var(--verde-claro));
  border-radius: 999px;
  transition: width .2s ease;
}

.users-count {
  font-size: 13px;
  font-weight: 700;
  color: #555;
}

.modal-error {
  display: none;
  background: var(--rojo-suave);
  color: var(--rojo);
  border: 1px solid #f1948a;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.modal-error.show {
  display: block;
}

.modal-divider {
  border-top: 1px solid var(--borde);
  margin-top: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--blanco);
  border: 1.5px solid var(--borde);
  border-radius: 10px;
  padding: 16px 18px;
}

.stat-num {
  color: var(--azul);
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 6px;
}

.stat-label {
  color: #666;
  font-size: 12px;
  font-weight: 700;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 132px;
}

.filter-group label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: #555;
}

.pagination-btns {
  display: flex;
  gap: 8px;
}

.btn-page {
  border: 1px solid var(--borde);
  background: var(--blanco);
  color: var(--azul);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-page:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.table-empty-cell {
  text-align: center;
  color: #888;
  padding: 24px;
}

.state-message {
  color: #666;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 14px 10px;
}

.state-loading {
  color: var(--azul);
}

.state-empty {
  color: #888;
}

.state-error {
  color: var(--rojo);
}

.role-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.role-badge-administrador {
  background: #fdecea;
  color: #c0392b;
  border: 1px solid rgba(192,57,43,0.2);
}

.role-badge-completo {
  background: #e8f8ef;
  color: #1e7a4a;
  border: 1px solid rgba(30,122,74,0.2);
}

.role-badge-readonly {
  background: #fef9e7;
  color: #7a6a0a;
  border: 1px solid rgba(122,106,10,0.2);
}

.role-badge-disp2026 {
  background: #e8f8f5;
  color: #16a085;
  border: 1px solid rgba(22,160,133,0.2);
}

.role-badge-unknown {
  background: #eee;
  color: #666;
}

@media (max-width: 700px) {
  .toolbar,
  .filters,
  .leyenda,
  .limit-bar {
    align-items: stretch;
  }

  .toolbar > *,
  .filters > *,
  .filter-group,
  .header-right,
  .pagination,
  .pagination-btns {
    width: 100%;
  }

  .header-right,
  .pagination,
  .pagination-btns {
    flex-wrap: wrap;
  }

  .header-left {
    width: 100%;
  }

  .header-right {
    margin-left: 0;
  }

  .modal {
    width: calc(100% - 24px);
    padding: 22px 18px;
  }

  .modal-footer,
  .modal-actions {
    flex-direction: column;
  }
}
